Sitemap
Shabhika

Shabhika

CLICKJACKING

--

PORTSWIGGER LABS

(UI REDRESSING)

Lab 1 — Basic clickjacking with CSRF token protection

Step 1

I logged in to the target account and opened the account page so that I could use the Delete account action in the clickjacking attack.

Step 2

I opened the Exploit Server and added an iframe pointing to the account page. I also added a decoy element called “Test me”.

Step 3

I adjusted the iframe size, opacity, and the position of the decoy element so that it was placed over the Delete account button.

Step 4

I stored the exploit and viewed it to check whether the decoy action was correctly aligned with the hidden account action.

Press enter or click to view image in full size

Step 5

After aligning the click position, I used the final decoy text and delivered the exploit to the victim.

Lab 2 — Clickjacking with form input data prefilled from a URL parameter

Step 1

I opened the Exploit Server and created an iframe for the target account page with the email value prefilled through the URL parameter.

Step 2

I added the decoy “Test me” element and adjusted its position so that it matched the Update email button inside the iframe.

Step 3

I checked the exploit in the browser and verified that the decoy click was positioned over the target action.

Press enter or click to view image in full size

Step 4

I stored the final exploit and delivered it to the victim after changing the decoy action to the required click text.

Lab 3 — Clickjacking with a frame buster script

Step 1

I created the clickjacking payload on the Exploit Server and targeted the account page with the required email parameter.

Step 2

Get Shabhika’s stories in your inbox

Join Medium for free to get updates from this writer.

I used the sandbox attribute with allow-forms in the iframe so that the frame-busting script could be bypassed.

Press enter or click to view image in full size

Step 3

I viewed the exploit and checked the position of the decoy “Test me” element against the Update email action.

Step 4

After confirming the alignment, I changed the decoy text to the final click action and delivered the exploit to the victim.

Lab 4 — Exploiting clickjacking vulnerability to trigger DOM-based XSS

Step 1

I created an iframe pointing to the Submit feedback page and placed the DOM-based XSS payload in the name parameter.

Step 2

I positioned the decoy “Click me” element so that it was aligned with the Submit feedback button inside the iframe.

Step 3

I tested the click action and the browser opened the print dialog, showing that the print() function was triggered.

Step 4

I kept the final clickjacking payload and delivered the exploit to the victim.

Lab 5 — Multistep clickjacking

Step 1

I opened the account page and created two decoy elements, “Test me first” and “Test me next”, for the two click actions.

Step 2

I positioned “Test me first” over the Delete account button so that the first click would trigger the account deletion flow.

Step 3

After the first click opened the confirmation page, I positioned “Test me next” over the Yes button.

Step 4

I checked the second click position and made sure the decoy action was aligned with the confirmation button.

Press enter or click to view image in full size

Step 5

I used the final click text for both decoy elements and delivered the multistep exploit to the victim.

--

--