From 9892d513d98a2dc0c2c05d9a2b045f118c67e369 Mon Sep 17 00:00:00 2001 From: Bradley Kemp Date: Sat, 22 May 2021 12:55:23 +0100 Subject: [PATCH] Add a few more shared providers, clean up duplicates --- matchers/shared_hosting.go | 21 +++++++++++++-------- matchers/whois_matchers.go | 12 ++++++++---- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/matchers/shared_hosting.go b/matchers/shared_hosting.go index c94ac32..a7a13a2 100644 --- a/matchers/shared_hosting.go +++ b/matchers/shared_hosting.go @@ -22,19 +22,24 @@ func IsSharedHostingProvider(u *url.URL) (bool, ProviderContact) { // // Try to keep this sorted alphabetically by ProviderName var sharedHostMatchers = []matcher{ - {OnlineForm{"000webhost", "https://www.000webhost.com/report-abuse"}, isSubDomainOf("000webhost.com")}, - {OnlineForm{"000webhost", "https://www.000webhost.com/report-abuse"}, isSubDomainOf("000webhostapp.com")}, + {OnlineForm{"000webhost", "https://www.000webhost.com/report-abuse"}, isSubDomainOf("000webhost.com", "000webhostapp.com")}, + {AbuseEmail{"Adobe", "hellospark@adobe.com"}, isSubDomainOf("spark.adobe.com")}, {OnlineForm{"Bitly", "https://bitly.is/reporting-abuse"}, isSubDomainOf("bit.ly")}, - {OnlineForm{"Blogger", "https://support.google.com/blogger/answer/76315"}, isSubDomainOf("blogger.com")}, - {OnlineForm{"Blogger", "https://support.google.com/blogger/answer/76315"}, isSubDomainOf("blogspot.com")}, - {OnlineForm{"Google Cloud", "https://support.google.com/code/contact/cloud_platform_report"}, isSubDomainOf("appspot.com")}, - {OnlineForm{"Google Cloud", "https://support.google.com/code/contact/cloud_platform_report"}, isSubDomainOf("googleapis.com")}, + {OnlineForm{"Blogger", "https://support.google.com/blogger/answer/76315"}, isSubDomainOf("blogger.com", "blogspot.com")}, + {OnlineForm{"Google Cloud", "https://support.google.com/code/contact/cloud_platform_report"}, isSubDomainOf("appspot.com", "googleapis.com", "web.app")}, + {AbuseEmail{"IBM", "abuse@softlayer.com"}, isSubDomainOf("appdomain.cloud")}, + {OnlineForm{"Notion", "https://www.notion.so/Report-inappropriate-content-9feb9f2f9d8c40b1b7d289b155907de0"}, isSubDomainOf("notion.so", "notion.com")}, {OnlineForm{"Weebly", "https://www.weebly.com/uk/spam"}, isSubDomainOf("weebly.com")}, {OnlineForm{"Yola", "https://helpcenter.yola.com/hc/en-us/requests/new?ticket_form_id=360001504300"}, isSubDomainOf("yolasite.com")}, } -func isSubDomainOf(domain string) func(string) bool { +func isSubDomainOf(domains ...string) func(string) bool { return func(abusiveDomain string) bool { - return abusiveDomain == domain || strings.HasSuffix(abusiveDomain, "."+domain) + for _, domain := range domains { + if abusiveDomain == domain || strings.HasSuffix(abusiveDomain, "."+domain) { + return true + } + } + return false } } diff --git a/matchers/whois_matchers.go b/matchers/whois_matchers.go index b654dfb..9bd3a31 100644 --- a/matchers/whois_matchers.go +++ b/matchers/whois_matchers.go @@ -18,13 +18,17 @@ var whoisMatchers = []matcher{ {OnlineForm{"Namesilo", "https://www.namesilo.com/report_abuse.php or https://new.namesilo.com/phishing_report.php"}, whoisContains("abuse@namesilo.com")}, {AbuseEmail{"OrangeWebsite", "abuse-dept@orangewebsite.com"}, whoisContains("abuse@orangewebsite.com")}, {OnlineForm{"PublicDomainRegistry", "https://publicdomainregistry.com/process-for-handling-abuse/"}, whoisContains("abuse-contact@publicdomainregistry.com")}, - {OnlineForm{"Tucows", "https://tucowsdomains.com/report-abuse/"}, whoisContains("abuse@tucows.com")}, - {OnlineForm{"Tucows", "https://tucowsdomains.com/report-abuse/"}, whoisContains("domainabuse@tucows.com")}, + {OnlineForm{"Tucows", "https://tucowsdomains.com/report-abuse/"}, whoisContains("abuse@tucows.com", "domainabuse@tucows.com")}, } -func whoisContains(contents string) func(string) bool { +func whoisContains(needles ...string) func(string) bool { return func(whois string) bool { - return strings.Contains(whois, contents) + for _, needle := range needles { + if strings.Contains(whois, needle) { + return true + } + } + return false } }