public void DigWhoIs() { string registrar = _dig.GetRegistrar("0731CARD.COM"); Assert.IsNotNull(registrar); registrar = _dig.GetRegistrar("notarealdomainxyz123asd"); Assert.AreEqual(registrar, "N/A"); }
public void DigWhoIs() { string registrar = _dig.GetRegistrar("theblissfulbakker.com"); Assert.IsNotNull(registrar); registrar = _dig.GetRegistrar("theblissfulbakker.com"); Assert.IsTrue(registrar.ToLower().Contains("wild west")); }
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); }
/// <summary> /// Gets registrars for all companies in our database /// </summary> internal void GetAllRegistrars() { MarketShareDataSource mds = DroneDataSource as MarketShareDataSource; if (!Object.Equals(null, mds)) { using (Dig dig = new Dig()) { var list = mds.GetAllCompanies(MarketShareTypeBitMaskEnum.Registrar, XMLUtility.GetIntFromAccountNode(Xml, ProcessorName + "/recordcount")); foreach (var company in list) { 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.GetRegistrar(url); marketType.DomainId = company.DomainId; marketType.SampleDate = company.DomainAttributes["SampleDate"]; marketType.TypeId = (int)MarketShareDataTypeEnum.Registrar; marketType.BitMaskId = (int)MarketShareTypeBitMaskEnum.Registrar; if (!string.IsNullOrWhiteSpace(marketType.Value)) { MarketShareDataComponent dc = new MarketShareDataComponent(); dc.MarketShareType = marketType; DroneDataSource.Process(dc); } else { Utility.WriteToLogFile(String.Format("SmallBiz_NoRegistrar_{0:M_d_yyyy}", DateTime.Today) + ".log", string.Format("Domain: ,{0}", url)); } } } catch (Exception e) { ExceptionExtensions.LogError(e, "WhoIs.GetAllRegistrars", "Domain: " + company.Uri.ToString()); } } } } }
public void DigWRegistrar_PerformanceTest() { //resolver will cache these, so remove the cache lookup Dig dig = new Dig(); 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"); DateTime endTime; DateTime startTime = DateTime.Now; Random rand = new Random(); Parallel.For(0, 50, (i) => { foreach (var item in domainList) { webhostList.Add(dig.GetRegistrar(item)); } }); endTime = DateTime.Now; TimeSpan elapsedTime1 = endTime.Subtract(startTime); }
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); }