Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript Injection On Third-Party Pages

I've recently stumbled upon a website called Overlay101 which allows you to create tours for other websites.

I was very interested to see the technique they use to load the third party websites for editing.

When you type the address of the website, it is loaded as a sub domain of the overlay101.com website.

For example, if I type https://stackoverflow.com/questions/111102/how-do-javascript-closures-work - it is loaded as http://stackoverflow.com.www.overlay101.com/questions/111102/how-do-javascript-closures-work

I was wondering how is that subdomain creation achieved and I saw in the source code of the page that JavaScript in injected. I was wondering how was that possible too.

What intrigued me most is that Stackoverflow.com does not allow pages to be loaded within frames - I was wondering how they managed to load up the page so that tour popups could be added.

like image 723
Hirvesh Avatar asked Jan 18 '13 12:01

Hirvesh


1 Answers

They simply use wildcard DNS entries to make all subdomains work. They then use the Host header to get the original domain name and download the HTML code of the site. Since they do this on the server side they do not need any frames etc.

like image 198
ThiefMaster Avatar answered Oct 04 '22 20:10

ThiefMaster