示例#1
0
        static void Parser(string str, string domain)
        {
            string result = "\r\n";

            result += "Domain Name: " + str.CopeAfter("Domain Name") + "\r\n";
            result += "Registrar: " + str.CopeAfter("Registrar") + "\r\n";
            result += "Updated Date: " + str.CopeAfter("Updated Date") + "\r\n";
            result += "Creation Date: " + str.CopeAfter("Creation Date") + "\r\n";
            result += "Expiration Date: " + str.CopeAfter("Expiration Date") + "\r\n\r\n";
            result += "Ports:\r\n";
            result += Nmap(domain) + "\r\n";
            result += "Servers:";
            Console.WriteLine(result);

            string server = "";

            while ((server = StringExtension.SearchAndDelete(ref str, "Name Server: ")) != "")
            {
                result            = "Name Server: " + server + "\r\n";
                Whois.Record_Type = "nameserver";
                string server_information = Whois.Lookup(server);

                string ip = "";
                while (server_information.IndexOf("IP Address") != -1)
                {
                    ip = StringExtension.SearchAndDelete(ref server_information, "IP Address: ");
                    if ((ip != "") && (ip.IndexOf(':') == -1))
                    {
                        result += "IP Address: " + ip + "\r\n";
                        result += "Port: " + Nmap(ip);
                    }
                }
                Console.WriteLine(result);
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter a domain name for scope creating.");
            string domainName = Console.ReadLine();

            try
            {
                Whois.Record_Type = "domain";
                string whoisText = Whois.Lookup(domainName);
                Parser(whoisText, domainName);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }