Lab: Web shell upload via obfuscated file extension
Summary: PortSwigger's lab presents an image upload function that blacklists certain file extensions, and the defense can be bypassed with a classic obfuscation technique. The solution is to upload a basic PHP web shell, using a URL-encoded null byte followed by a .jpg extension in the filename parameter of the Content-Disposition header, then use it to exfiltrate the contents of /home/carlos/secret.
Key Takeaway: An extension blacklist is defeated by a single null byte in the filename, so the control that looks like it blocks executable uploads does not - and the payoff in this lab is reading a file the attacker was never meant to see.
Read the original at PortSwigger Research ↗
- Topics
- Vulnerabilities & Patching
- Related
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026