As I understand it, this is how an attacker would exploit clickjacking:
- Create a new website malicioussite.com which includes my site in a frame, but overlays malicious input fields or buttons over the HTML elements of my site.
- Send out phishing emails to get users to click on the link that goes to malicioussite.com rather than my site (or use some other technique to distribute the phishing link).
- Users enter data into or click on the malicious elements.
- Profit
Savvy users would either not click the link, or notice that the address bar is incorrect. However, plenty of people would probably not notice.
My question is this: Can't the attacker achieve the same thing by using malicioussite.com as a reverse proxy? All the steps above would be the same, except that malicioussite.com would forward the requests to my site and then insert an extra <script> tag in the HTML response to run the malicious code and add the malicious HTML elements. The X-FRAME-OPTIONS header wouldn't help in that case because there are no frames (and the reverse proxy can strip it out anyway).
The attack relies on the user not checking the address bar, so if the attacker can implement the same attack in a different way that can't be defeated, why bother with X-FRAME-OPTIONS or other clickjacking protections?
evil.com, he will be presented with a full version ofgood.comloaded entirely fromevil.com. All requests, including the first request loading the page itself and then any subsequent requests, are going toevil.comfrom the user browser's point of view. No client-side protection can prevent this. The only way this can be protected is by informing users to check the address bar forhttps://good.com– Adi Mar 23 '15 at 05:13good.comonevil.comitself without reverse-proxying at all. This way, you can just grab the username/password without injecting any scripts in the page and possible alerting the user. Another benefit of avoiding reverse-proxying is that you, the attacker, won't have to interact with the server, and yourevil.comwon't appear ongood.com's access logs. I honestly cannot think of a reason why reverse-proxying is beneficial to an attacker in a way other easier attacks aren't. – Adi Mar 23 '15 at 06:21