DNS Rebinding: Methodology
Setup Phase:
Register a malicious domain (e.g.,
malicious.com).Configure a custom DNS server capable of resolving
malicious.comto different IP addresses.
Initial Victim Interaction:
Create a webpage on
malicious.comcontaining malicious JavaScript or another exploit mechanism.Entice the victim to visit the malicious webpage (e.g., via phishing, social engineering, or advertisements).
Initial DNS Resolution:
When the victim's browser accesses
malicious.com, it queries the attacker's DNS server for the IP address.The DNS server resolves
malicious.comto an initial, legitimate-looking IP address (e.g., 203.0.113.1).
Rebinding to Internal IP:
After the browser's initial request, the attacker's DNS server updates the resolution for
malicious.comto a private or internal IP address (e.g., 192.168.1.1, corresponding to the victim’s router or other internal devices).
This is often achieved by setting a very short TTL (time-to-live) for the initial DNS response, forcing the browser to re-resolve the domain.
Same-Origin Exploitation:
The browser treats subsequent responses as coming from the same origin (malicious.com).
Malicious JavaScript running in the victim's browser can now make requests to internal IP addresses or local services (e.g., 192.168.1.1 or 127.0.0.1), bypassing same-origin policy restrictions.
Example:
Register a domain.
Edit the autoattack HTML page for your needs.
Browse to
http://rebinder.your.domain:8080/autoattack.html.Wait for the attack to finish (it can take few seconds/minutes).
Comments
No comments yet.