Exemplo n.º 1
0
        public void DigWebHostName_Other()
        {
            //resolver will cache these, so remove the cache lookup
            //dig does a friendly name lookup as well, that can be removed for a VERY slight speed increase over a large #
            Dig dig = new Dig();

            List <string> domainList  = new List <string>();
            List <string> webhostList = new List <string>();
            List <string> dnshostList = new List <string>();

            //domainList.Add("mprconsultinghk.com");
            domainList.Add("weebly.com");
            domainList.Add("kraftymoms.com");
            domainList.Add("paranique.com");
            domainList.Add("casaartandphoto.com");


            foreach (var item in domainList)
            {
                webhostList.Add(dig.GetWebHostName(item));
            }

            foreach (var item in domainList)
            {
                dnshostList.Add(dig.GetDNSHostName(item));
            }
        }
Exemplo n.º 2
0
        internal CompanyRoot GetFullCompany(string permalinkName, Dig digMgr)
        {
            CompanyRoot company = compManager.GetFullCompany(permalinkName);

            if (!Object.Equals(company, null) && !Object.Equals(null, company.homepage_url))
            {
                Records r = new Records();
                company.homepage_url = Utility.CleanUrl(company.homepage_url);
                IPAddress ip = digMgr.GetIPAddress(company.homepage_url);
                if (!Object.Equals(null, ip))
                {
                    company.ip_address = ip.ToString();
                }
                SSLCert cert = digMgr.GetSSLVerification(company.homepage_url);

                if (!Object.Equals(cert, null))
                {
                    r.SSLIssuer       = cert.FixedName;
                    r.CertificateType = cert.SubjectType;
                }
                r.WebHost   = digMgr.GetWebHostName(company.homepage_url);
                r.EmailHost = digMgr.GetEmailHostName(company.homepage_url);
                r.DNSHost   = digMgr.GetDNSHostName(company.homepage_url);
                r.Registrar = digMgr.GetRegistrar(company.homepage_url);

                company.records = r;
            }

            return(company);
        }
Exemplo n.º 3
0
        public void FindCompanyInLookups()
        {
            Dig dig = new Dig();

            string foundName = dig.GetRegistrar("1computer.info");

            Assert.AreEqual("Network Solutions", foundName);

            //self hosted
            foundName = dig.GetEmailHostName("fash-art.com");
            Assert.AreEqual("Self Hosted", foundName);

            foundName = dig.GetEmailHostName("blooclick.com");
            Assert.AreEqual("ovh systems", foundName.ToLower());

            //email
            foundName = dig.GetEmailHostName("sawyerit.com");
            Assert.AreEqual("Go Daddy", foundName);

            //not found, use record
            foundName = dig.GetDNSHostName("travellution.com");
            Assert.AreEqual("technorail.com", foundName);

            //found, use company name
            foundName = dig.GetDNSHostName("godaddy.com");
            Assert.AreEqual("Go Daddy", foundName);

            //no SSL issuer
            foundName = dig.GetCompanyFromRecordName(dig.GetSSLVerification("cybergeekshop.com").IssuerName, "cybergeekshop.com", DigTypeEnum.SSL);
            Assert.AreEqual("None", foundName);

            //webhost (split AS name with -)
            foundName = dig.GetWebHostName("cybergeekshop.com");
            Assert.AreEqual("Unified Layer", foundName);

            foundName = dig.GetWebHostName("microteksystems.net");
            Assert.AreEqual("SoftLayer", foundName);

            //webhost (splitting AS Name without -)
            foundName = dig.GetWebHostName("eatads.com");
            Assert.AreEqual("Amazon", foundName);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets registrars for all companies in our database
        /// </summary>
        internal void GetAllDNSHosts()
        {
            MarketShareDataSource mds = DroneDataSource as MarketShareDataSource;

            if (!Object.Equals(null, mds))
            {
                using (Dig dig = new Dig())
                {
                    foreach (var company in mds.GetAllCompanies(MarketShareTypeBitMaskEnum.DNSHost, XMLUtility.GetIntFromAccountNode(Xml, "dnshost/recordcount")))
                    {
                        try
                        {
                            MarketShareDataType marketType = new MarketShareDataType();
                            string url = Utility.CleanUrl(company.Uri.ToString());
                            WriteToUsageLogFile("Domain:" + url, string.Format("Executing {0}.{1}", ComponentTypeName, MethodInfo.GetCurrentMethod().Name), true);

                            if (!String.IsNullOrWhiteSpace(url))
                            {
                                marketType.Value      = dig.GetDNSHostName(url);
                                marketType.DomainId   = company.DomainId;
                                marketType.TypeId     = (int)MarketShareDataTypeEnum.DNSHost;
                                marketType.BitMaskId  = (int)MarketShareTypeBitMaskEnum.DNSHost;
                                marketType.SampleDate = company.DomainAttributes["SampleDate"];

                                if (!string.IsNullOrWhiteSpace(marketType.Value))
                                {
                                    MarketShareDataComponent dc = new MarketShareDataComponent();
                                    dc.MarketShareType = marketType;
                                    DroneDataSource.Process(dc);
                                }
                                else
                                {
                                    Utility.WriteToLogFile(String.Format("SmallBiz_NoDNSHost_{0:M_d_yyyy}", DateTime.Today) + ".log", string.Format("Domain: ,{0}", url));
                                }
                            }
                        }
                        catch (Exception e)
                        {
                            ExceptionExtensions.LogError(e, "DNSHost.GetAllDNSHosts", "Domain: " + company.Uri.ToString());
                        }
                    }
                }
            }
        }
Exemplo n.º 5
0
        public void DigWRegistrar_PerformanceTest()
        {
            //resolver will cache these, so remove the cache lookup
            Dig    dig    = new Dig();
            Crunch crunch = new Crunch();

            List <string> domainList  = new List <string>();
            List <string> webhostList = new List <string>();

            domainList.Add("coderow.com");
            domainList.Add("slashcommunity.com");
            domainList.Add("vantronix.com");
            domainList.Add("sociofy.com");
            domainList.Add("netconstructor.com");
            domainList.Add("dotfox.com");
            domainList.Add("go.co");
            domainList.Add("1computer.info");
            domainList.Add("andyet.net");
            domainList.Add("p1us.me");
            domainList.Add("10cms.com");
            domainList.Add("1010data.com");
            domainList.Add("1800vending.com");
            domainList.Add("easybacklog.com");
            domainList.Add("abcotechnology.com");
            domainList.Add("abcsignup.com");
            domainList.Add("airtag.com");
            domainList.Add("nuospace.com");
            domainList.Add("brightscope.com");
            domainList.Add("data180.com");
            domainList.Add("chicagolandlordsattorney.com");

            DateTime endTime;
            DateTime startTime = DateTime.Now;
            Random   rand      = new Random();

            foreach (var item in domainList)
            {
                webhostList.Add(dig.GetDNSHostName(item));
            }

            endTime = DateTime.Now;
            TimeSpan elapsedTime1 = endTime.Subtract(startTime);
        }
Exemplo n.º 6
0
        public void DigInvalidDomainName_ReturnsNone()
        {
            string result = _dig.GetDNSHostName("abadname");

            Assert.AreEqual("None", result);
        }