Attack flow
- Victim visits
http://140.238.208.152:8081/awbuckets
because it looks like a cool blog or smth. - The script on
awbuckets.html
will dynamically load an iframe from the domainA.140.238.208.152.1time.127.0.0.1.forever.randomPart.rebind.cryptosec.se
on port 5600. - The first time the browser does a DNS record for this domain, it will see the result
140.238.208.152
, and thus it will fetch the page140.238.208.152:5600/exporter-buckets.html
. - The
exporter-buckets.html
page contains a JavaScript that does afetch()
for/api/0/buckets/
, i.e. the same domain as it already is on. Naturally, the browser believes this is the same origin. - The domain
A.140.238.208.152.1time.127.0.0.1.forever.randomPart.rebind.cryptosec.se
has a short TTL (1 second). It has now expired. The browser does a new DNS request for the same domain. - The whonow DNS server now returns 127.0.0.1 as the IP of the domain, since it is the second time it gets a request. The browser still consider this the same origin, since the domain is the same, even though the IP differs
- The browser happily accepts the result, and will now request
127.0.0.1/api/0/export
. - The attack scripts stores the result, and uploads it to some attacker controlled server.
- Success!