diff --git a/fingerprints.json b/fingerprints.json index f9af7cc..c08247e 100644 --- a/fingerprints.json +++ b/fingerprints.json @@ -9,6 +9,71 @@ ], "nxdomain": false }, + { + "service": "cargo", + "cname": [ + "cargo.site", + "cargocollective.com" + ], + "fingerprint": [ + "Once completed, this domain will automatically display your Cargo site", + "Connect it by adding it to your Settings", + "This domain has been configured for use by" + ], + "nxdomain": false + }, + { + "service": "anima", + "cname": [ + "" + ], + "fingerprint": [ + "If this is your website and you", + "Missing Website" + ], + "nxdomain": false + }, + { + "service": "airee.ru", + "cname": [ + "" + ], + "fingerprint": [ + "Ошибка 402. Сервис Айри.рф не оплачен", + "did not pay for the Airi.rf service. Access to the site is temporarily unavailable" + ], + "nxdomain": false + }, + { + "service": "elasticbeanstalk", + "cname": [ + ".elasticbeanstalk.com" + ], + "fingerprint": [], + "nxdomain": true + }, + { + "service": "tilda_cc", + "cname": [ + "" + ], + "fingerprint": [ + "Domain has been assigned", + "Please go to the site settings", + "put the domain name in the Domain tab" + ], + "nxdomain": false + }, + { + "service": "agilecrm", + "cname": [ + "agilecrm.com" + ], + "fingerprint": [ + "this page is no longer available" + ], + "nxdomain": false + }, { "service": "github", "cname": [ @@ -49,6 +114,17 @@ ], "nxdomain": false }, + { + "service": "uptimerobot", + "cname": [ + "uptimerobot.com" + ], + "fingerprint": [ + "page not found" + ], + "nxdomain": false, + "checkall": true + }, { "service": "wordpress", "cname": [ @@ -99,6 +175,39 @@ ], "nxdomain": false }, + { + "service": "strikinglydns", + "cname": [ + "strikinglydns.com" + ], + "fingerprint": [ + "Page not found - Strikingly", + "But if you're looking to build your own website", + "you've come to the right place" + ], + "nxdomain": false, + "checkall": true + }, + { + "service": "kinsta", + "cname": [ + "" + ], + "fingerprint": [ + "No Site For Domain | Kinsta" + ], + "nxdomain": false + }, + { + "service": "launchrock", + "cname": [ + "" + ], + "fingerprint": [ + "404 Not Found | Launchrock" + ], + "nxdomain": false + }, { "service": "ghost", "cname": [ @@ -230,7 +339,7 @@ "bigcartel.com" ], "fingerprint": [ - "

Oops! We could’t find that page.

" + "

Oops! We couldn’t find that page.

" ], "nxdomain": false }, @@ -240,6 +349,7 @@ "createsend.com" ], "fingerprint": [ + "Trying to access your account", "Double check the URL or \nLearn more about Worksites.net" ], "nxdomain": false + }, + { + "service": "gemfury", + "cname": [ + "furyns.com" + ], + "fingerprint": [ + "https://gemfury.com/404" + ], + "nxdomain": false, + "checkall": true + }, + { + "service": "pingdom", + "cname": [ + "stats.pingdom.com" + ], + "fingerprint": [ + "This could be because the account was cancelled", + "Sorry, couldn’t find the status page", + "maybe you slipped over the keyboard" + ], + "nxdomain": false, + "checkall": true + }, + { + "service": "ngrok", + "cname": [ + "ngrok.io" + ], + "fingerprint": [ + " not found" + ], + "nxdomain": false, + "checkall": true + }, + { + "service": "smartjobboard", + "cname": [ + "" + ], + "fingerprint": [ + "This job board website is either expired or its domain name is invalid" + ], + "nxdomain": false + }, + { + "service": "hubspot", + "cname": [ + "hubspot.net" + ], + "fingerprint": [ + "This page isn’t available", + "does not exist in our system" + ], + "nxdomain": false, + "checkall": true } + ] + diff --git a/main.go b/main.go index 4f9e9ad..e229c43 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,8 @@ import ( "fmt" "os" - "github.com/haccer/subjack/subjack" + subjack "./subjack" + //"github.com/manasmbellani/subjack/subjack" ) func main() { diff --git a/subjack/fingerprint.go b/subjack/fingerprint.go index fcc7433..92d6fbc 100644 --- a/subjack/fingerprint.go +++ b/subjack/fingerprint.go @@ -13,6 +13,7 @@ type Fingerprints struct { Cname []string `json:"cname"` Fingerprint []string `json:"fingerprint"` Nxdomain bool `json:"nxdomain"` + CheckAll bool `json:"checkall"` } /* @@ -90,8 +91,13 @@ func Identify(subdomain string, forceSSL, manual bool, timeout int, fingerprints IDENTIFY: for f := range fingerprints { - // Begin subdomain checks if the subdomain returns NXDOMAIN - if nx { + // Track whether a matching cname has been detected + foundcname := false + + // Begin subdomain checks if the subdomain returns NXDOMAIN OR we need + // to perform both CNAME and findgerpint checks + if nx || fingerprints[f].CheckAll { + // Uncomment for Debugging: fmt.Printf("f: %d, fingerprints[f].Service: %s, fingerprints[f].CheckAll: %t\n", f, fingerprints[f].Service, fingerprints[f].CheckAll) // Check if we can register this domain. dead := available.Domain(cname) @@ -100,28 +106,42 @@ IDENTIFY: break IDENTIFY } - // Check if subdomain matches fingerprinted cname - if fingerprints[f].Nxdomain { - for n := range fingerprints[f].Cname { - if strings.Contains(cname, fingerprints[f].Cname[n]) { - service = strings.ToUpper(fingerprints[f].Service) - break IDENTIFY - } - } - } - // Option to always print the CNAME and not check if it's available to be registered. if manual && !dead && cname != "" { service = "DEAD DOMAIN - " + cname break IDENTIFY } + + // Check if subdomain matches fingerprinted cname (when NX OR + // if user requests to check ALL fingerprints) + if fingerprints[f].Nxdomain || fingerprints[f].CheckAll { + for n := range fingerprints[f].Cname { + if strings.Contains(cname, fingerprints[f].Cname[n]) { + //Uncomment for Debugging: fmt.Printf("cname: %s, subdomain: %s, Found cname: %s\n", cname, fingerprints[f].Service, fingerprints[f].Cname) + foundcname = true + if fingerprints[f].CheckAll { + // Now, we must also check if body contains matching fingerprint + break + } else { + // Found matching cname as per fingerprint for NX + // Successfully found a match + service = strings.ToUpper(fingerprints[f].Service) + break IDENTIFY + } + } + } + } } - // Check if body matches fingerprinted response - for n := range fingerprints[f].Fingerprint { - if bytes.Contains(body, []byte(fingerprints[f].Fingerprint[n])) { - service = strings.ToUpper(fingerprints[f].Service) - break + // Check the fingerprint for body if we found a mathcing cname when all + // checks must match OR if nxdomain for fingerprint set to false + if (fingerprints[f].CheckAll && foundcname) || (!fingerprints[f].CheckAll && !fingerprints[f].Nxdomain) { + // Check if body matches fingerprinted response + for n := range fingerprints[f].Fingerprint { + if bytes.Contains(body, []byte(fingerprints[f].Fingerprint[n])) { + service = strings.ToUpper(fingerprints[f].Service) + break + } } } }