Cyber Risks · PortSwigger Research

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