Last updated
Last updated
This lab contains a vulnerable image upload function. It attempts to prevent users from uploading unexpected file types, but relies on checking user-controllable input to verify this.
To solve the lab, upload a basic PHP web shell and use it to exfiltrate the contents of the file /home/carlos/secret
. Submit this secret using the button provided in the lab banner.
You can log in to your own account using the following credentials: wiener:peter
After login as Wiener user there's an upload option to upload avatar image:
with the avatar image at this path/location:
We need to obtain Carlos's secret, we can do it upload a php shell (php_web_shell.php
) that get secret file content
there's not a sanitizaiton and we can upload it directly:
Obtaining Carlos's secret and solving the lab.
We know the file location and we can open it going to:
https://portswigger.net/web-security/learning-paths/server-side-vulnerabilities-apprentice/file-upload-apprentice/file-upload/lab-file-upload-remote-code-execution-via-web-shell-upload