OS command injection, simple case
https://portswigger.net/web-security/learning-paths/server-side-vulnerabilities-apprentice/os-command-injection-apprentice/os-command-injection/lab-simple
Last updated
https://portswigger.net/web-security/learning-paths/server-side-vulnerabilities-apprentice/os-command-injection-apprentice/os-command-injection/lab-simple
Last updated
This lab contains an OS command injection vulnerability in the product stock checker.
The application executes a shell command containing user-supplied product and store IDs, and returns the raw output from the command in its response.
To solve the lab, execute the whoami
command to determine the name of the current user.
Every product has a dedicate check function to retrieve if a product is availble or not:
We can try to concatenate it with a payload like as ; & or |: ;whoami
and we obtain the user of system: peter-Gu9oqX solving the lab.