Definition: Command injection is an attack in which the goal is execution of arbitrary commands on the host operating system via a vulnerable application. Command injection attacks are possible when an application passes unsafe user supplied data (forms, cookies, HTTP headers etc.) to a system shell. In this attack, the attacker-supplied operating system commands are usually executed with the privileges of the vulnerable application. Command injection attacks are possible largely due to insufficient input validation.
Victim Machine: Here victim is a server (WinXP SP2), hosting DVWA where OS Command Injection is there in “LOW” Security.
OS: Win XP SP2
OS: BackBox 4.7
Browser: Mozilla Firefox
- First of all we need to find the Injection Point and Cookie for DVWA Command Injection. Tamper Data has been used for this purpose.
- After finding Cookie and Injection point, We have to run commix from terminal.
- After successful injection by commix it will ask for pseudo shell and we will choose that to interact with the victim.
- Before proceed further, we need to create python based reverse tcp listener in metasploit.
- Let’s continue with commix’s option. We have to select python based reverse shell at the end and provide LHOST and LPORT.
- After selecting Python based Meterpreter payload a reverse tcp connection will be made with our metasploit listener.