exploiting-broken-link-hijacking

mukul975/Anthropic-Cybersecurity-Skills · updated May 25, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills install mukul975/Anthropic-Cybersecurity-Skills/exploiting-broken-link-hijacking
0 commentsdiscussion
summary

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.

skill.md
name
exploiting-broken-link-hijacking
description
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.
domain
cybersecurity
subdomain
web-application-security
tags
- broken-link-hijacking - blh - subdomain-takeover - dead-link - expired-domain - supply-chain - external-resource
version
'1.0'
author
mahipal
license
Apache-2.0
nist_csf
- PR.PS-01 - ID.RA-01 - PR.DS-10 - DE.CM-01

Exploiting Broken Link Hijacking

When to Use

  • When auditing web applications for references to expired or unclaimed external resources
  • During supply chain security assessments of third-party script and resource dependencies
  • When testing for subdomain takeover opportunities via dangling CNAME records
  • During bug bounty hunting for broken link hijacking vulnerabilities
  • When assessing the security of external resource dependencies in production applications

Prerequisites

  • Web crawler or spider for discovering all external links (Burp Suite Spider, Scrapy)
  • DNS lookup tools for checking CNAME records and domain availability
  • Domain registrar access for claiming expired domains (as proof of concept)
  • Understanding of CDN and cloud service provisioning (S3, Azure Blob, GitHub Pages)
  • blc (broken-link-checker) or similar tool for automated link validation
  • Knowledge of services vulnerable to subdomain takeover (can-i-take-over-xyz)

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.

Workflow

Step 1 — Crawl and Extract All External References

# 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

Step 2 — Identify Dead or Claimable Resources

# 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"

Step 3 — Check Service-Specific Takeover Possibilities

# 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

Step 4 — Verify External Script Hijacking

# 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

Step 5 — Exploit the Broken Link (Authorized Testing Only)

# 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

Step 6 — Assess Impact and Report

# 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

Key Concepts

ConceptDescription
Broken Link HijackingClaiming control of external resources referenced by target website
Dangling CNAMEDNS CNAME record pointing to unclaimed or decommissioned service
Subdomain TakeoverClaiming a subdomain by provisioning the service its CNAME points to
External Script HijackingRegistering expired domains that serve JavaScript loaded by target
Supply Chain AttackCompromising external dependencies to inject malicious content
Dead LinkURL reference returning 404 or DNS resolution failure
Resource FingerprintingIdentifying specific cloud services from error messages and headers

Tools & Systems

ToolPurpose
broken-link-checkerAutomated broken link discovery via web crawling
subjackSubdomain takeover detection tool
nucleiTemplate-based takeover detection scanner
can-i-take-over-xyzCommunity database of services vulnerable to takeover
BadDNSDNS auditing tool for detecting domain/subdomain takeovers
Wayback MachineHistorical URL analysis for discovering past external references

Common Scenarios

  1. JavaScript Supply Chain — Register expired domain that serves JavaScript loaded by target; inject malicious code affecting all visitors
  2. S3 Bucket Takeover — Claim deleted AWS S3 bucket referenced by target; serve malicious content or steal uploaded data
  3. GitHub Pages Hijack — Create GitHub Pages repository matching dangling CNAME to serve phishing pages on target subdomain
  4. Social Media Impersonation — Claim unclaimed social media handles linked from target website for brand impersonation
  5. CDN Package Hijack — Claim deprecated npm packages referenced via CDN URLs to inject malicious JavaScript

Output Format

## 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
how to use exploiting-broken-link-hijacking

How to use exploiting-broken-link-hijacking on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add exploiting-broken-link-hijacking
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills install mukul975/Anthropic-Cybersecurity-Skills/exploiting-broken-link-hijacking

The skills CLI fetches exploiting-broken-link-hijacking from GitHub repository mukul975/Anthropic-Cybersecurity-Skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/exploiting-broken-link-hijacking

Reload or restart Cursor to activate exploiting-broken-link-hijacking. Access the skill through slash commands (e.g., /exploiting-broken-link-hijacking) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.545 reviews
  • Shikha Mishra· Dec 28, 2024

    Keeps context tight: exploiting-broken-link-hijacking is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Nia Martin· Dec 28, 2024

    We added exploiting-broken-link-hijacking from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Ganesh Mohane· Dec 20, 2024

    exploiting-broken-link-hijacking reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Diya Abebe· Dec 20, 2024

    Keeps context tight: exploiting-broken-link-hijacking is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Nikhil Malhotra· Dec 12, 2024

    exploiting-broken-link-hijacking reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Hana Smith· Dec 4, 2024

    exploiting-broken-link-hijacking is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Benjamin Iyer· Nov 19, 2024

    Solid pick for teams standardizing on skills: exploiting-broken-link-hijacking is focused, and the summary matches what you get after install.

  • Sakshi Patil· Nov 11, 2024

    I recommend exploiting-broken-link-hijacking for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Dev Ramirez· Nov 3, 2024

    I recommend exploiting-broken-link-hijacking for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Charlotte Smith· Oct 22, 2024

    Useful defaults in exploiting-broken-link-hijacking — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

showing 1-10 of 45

1 / 5