Exemplo n.º 1
0
        public void ara()
        {
            switch (comboBox1.SelectedIndex)
            {
            case 0:
                listBox1.Items.Clear();
                label2.Text = "Cisco Omurga ";
                List <Host> cisco = shodan.Search("cisco-ios");
                foreach (Host h in cisco)
                {
                    listBox1.Items.Add(h.IP.ToString());
                }
                break;

            case 4:

                listBox1.Items.Clear();
                label2.Text = "Uzak Masaüstü";
                List <Host> rdp = shodan.Search("Remote desktop");
                foreach (Host h in rdp)
                {
                    listBox1.Items.Add(h.IP.ToString());
                }
                break;
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            // --> Insert your App Key in the app.config file <--
            Shodan shodan = new Shodan(ConfigurationManager.AppSettings["AppKey"]);

            //Print a list of cisco-ios devices
            List <Host> hosts = shodan.Search("cisco-ios");

            foreach (Host h in hosts)
            {
                Console.WriteLine(h.IP.ToString());
            }

            //Get all the information SHODAN has on the IP 217.140.75.46
            Host host = shodan.GetHost("217.140.75.46");

            Console.WriteLine(host.IP.ToString());

            //Search for exploits on ExploitDB and modules on MSF
            List <Exploit> exploits = shodan.SearchExploits("Microsoft Windows XP");

            foreach (Exploit exploit in exploits)
            {
                Console.WriteLine(exploit.Description);
            }

            List <MSFModule> modules = shodan.SearchMSFModules("Oracle");

            foreach (MSFModule msfModule in modules)
            {
                Console.WriteLine(msfModule.Name);
            }

            //Download exploit from ExploitDB and modules from MSF - Currently disabled by ShodanHQ
            //DataResponse exploitData = shodan.DownloadExploit(exploits[0].Id);
            //Console.WriteLine(exploitData.Filename);

            //DataResponse module = shodan.DownloadMSFModule("exploit/windows/browser/ms06_055_vml_method");

            //Note that we also write the file to disk
            //module.WriteToFile("C:\\" + module.Filename);
            //Console.WriteLine(module.Filename);

            Console.WriteLine("Press a key to continue.");
            Console.ReadLine();
        }