Пример #1
0
        public static void GetInfo(string[] args)
        {
            if (args.Length < 2)
            {
                Console.WriteLine("Shell Usage: reecon -shell shellType [IP Port]");
                Console.WriteLine("Types: bash, haskell, jar, jsp, nc, nodejs, php, python, war");
                General.PrintIPList();
                return;
            }
            string shellType = args[1];
            // If we have a tun0 IP, use that instead as the default
            List <General.IP> ipList = General.GetIPList();
            string            ip     = ipList.Any(x => x.Name == "tun0") ? ipList.FirstOrDefault(x => x.Name == "tun0").Address.ToString() : "10.0.0.1";
            string            port   = "9001";

            if (args.Length == 2)
            {
                Console.WriteLine("Don't forget to change the IP / Port!");
                General.PrintIPList();
            }
            if (args.Length == 3)
            {
                ip = args[2];
            }
            if (args.Length == 4)
            {
                ip   = args[2];
                port = args[3];
            }
            if (!Int32.TryParse(port, out int ignored))
            {
                Console.WriteLine("Port is not an integer - Possibly swapped it with IP?");
                Environment.Exit(0);
            }
            if (shellType == "bash")
            {
                Console.WriteLine("Bash Shell");
                Console.WriteLine("----------");
                Console.WriteLine(BashShell(ip, port));
            }
            else if (shellType == "haskell")
            {
                Console.WriteLine("Haskell Shell");
                Console.WriteLine("-------------");
                Console.WriteLine(HaskellShell(ip, port));
                Console.WriteLine();
                Console.WriteLine("--> Save as filename.hs (Note: Only use letters - No numbers or special characters)");
            }
            else if (shellType == "jar")
            {
                Console.WriteLine("Java Shell");
                Console.WriteLine("----------");
                Console.WriteLine(JavaShell(ip, port));
                Console.WriteLine();
                Console.WriteLine("--> Can just use a normal nc listener");
            }
            else if (shellType == "jsp")
            {
                Console.WriteLine("JSP Shell");
                Console.WriteLine("---------");
                Console.WriteLine(JSPShell(ip, port));
                Console.WriteLine();
                Console.WriteLine("--> Save as file.jsp");
            }
            else if (shellType == "nc")
            {
                Console.WriteLine("Netcat Shell");
                Console.WriteLine("------------");
                Console.WriteLine(NCShell(ip, port));
            }
            else if (shellType == "nodejs")
            {
                Console.WriteLine("NodeJS Shell");
                Console.WriteLine("------------");
                Console.WriteLine(NodeJSShell(ip, port));
            }
            else if (shellType == "php")
            {
                Console.WriteLine("PHP Shell");
                Console.WriteLine("---------");
                Console.WriteLine(PHPShell(ip, port));
            }
            else if (shellType == "python")
            {
                Console.WriteLine("Python Shell");
                Console.WriteLine("------------");
                Console.WriteLine(PythonShell(ip, port));
            }
            else if (shellType == "sh")
            {
                Console.WriteLine("sh Shell");
                Console.WriteLine("--------");
                Console.WriteLine(SHShell(ip, port));
            }
            else if (shellType == "war")
            {
                Console.WriteLine("WAR Shell");
                Console.WriteLine("---------");
                Console.WriteLine(JSPShell(ip, port));
                Console.WriteLine();
                Console.WriteLine("--> Save as file.jsp");
                Console.WriteLine("--> zip file.war file.jsp");
            }
            else
            {
                Console.WriteLine("Unknown Shell: " + shellType);
            }
        }