Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Add Edgecast and Squarespace to takeover detections #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions agents/url_takeover_detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ func (a *URLTakeoverDetector) runDetectorFunctions(u *url.URL) {
if a.detectPantheon(u.String(), addrs, cname, string(body)) {
return
}

if a.detectEdgecastCDN(u.String(), addrs, cname, string(body)) {
return
}

if a.detectSquarespace(u.String(), addrs, cname, string(body)) {
return
}
}

func (a *URLTakeoverDetector) detectGithubPages(u string, addrs []string, cname string, body string) bool {
Expand Down Expand Up @@ -426,3 +434,39 @@ func (a *URLTakeoverDetector) detectPantheon(u string, addrs []string, cname str
}
return true
}

func (a *URLTakeoverDetector) detectEdgecastCDN(u string, addrs []string, cname string, body string) bool {
if !strings.HasSuffix(cname, ".edgecastcdn.net") {
return false
}
a.session.AddTagToResponsiveURL(u, "EdgecastCDN", "info", "https://www.verizondigitalmedia.com")
if strings.Contains(body, "404 - Not Found") {
a.session.AddTagToResponsiveURL(u, "Domain Takeover", "danger", "https://www.verizondigitalmedia.com/platform/edgecast-cdn/")
}
return true
}

func (a *URLTakeoverDetector) detectSquarespace(u string, addrs []string, cname string, body string) bool {
detected := false
_, subnet1, _ := net.ParseCIDR("198.49.23.0/24")
_, subnet2, _ := net.ParseCIDR("198.185.159.0/24")

for _, addr := range addrs {
ip := net.ParseIP(addr)
if ip != nil && (subnet1.Contains(ip) || subnet2.Contains(ip)) {
detected = true
break
}
}
if strings.HasSuffix(cname, ".squarespace.com.") {
detected = true
}
if detected {
a.session.AddTagToResponsiveURL(u, "Squarespace", "info", "https://www.squarespace.com/")
if strings.Contains(body, "Squarespace - Claim This Domain") {
a.session.AddTagToResponsiveURL(u, "Domain Takeover", "danger", "https://support.squarespace.com/hc/en-us/articles/115002755267")
}
return true
}
return false
}