I'm exercising with DVWA high level command injection. I know there is a hole for |
, but I'm looking for a way to get an output like the following:
root@vwksOffensive:~# ping -c 4 10.0.0.1 ; ls
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
--- 10.0.0.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3066ms
a a_post Documenti Immagini Modelli Musica pocl rockyou.txt Scrivania WebScarab.properties
Add b hash JavaSnoop.properties mtu plain Pubblici Scaricati Video
root@vwksOffensive:~#
starting from
<<<printf "[ping ip argument] \u003B the_command_I_choose"
My problem is that can do this:
root@vwksOffensive:~# ping -c 4 <<<printf "10.0.0.1"
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
--- 10.0.0.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3055ms
root@vwksOffensive:~#
but I'm not able to do this:
root@vwksOffensive:~# ping -c 4 <<<printf "10.0.0.1 \u003b ls"
PING 10.0.0.1 \u003b ls (10.0.0.1) 56(84) bytes of data.
--- 10.0.0.1 \u003b ls ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3075ms
root@vwksOffensive:~#
and not even this:
root@vwksOffensive:~# ping -c 4 <<<printf "10.0.0.1 ; ls"
PING 10.0.0.1 ; ls (10.0.0.1) 56(84) bytes of data.
--- 10.0.0.1 ; ls ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3075ms
root@vwksOffensive:~#
I searched deeply and the most similar, if it could be said so, is the first answer to this question: How to make a bash function which can read from standard input?
Unfortunately, this did not help me completely, so I decided to post here my question because I'm sure that, in my ignorance, I'm missing something.
The solution must contain the char ;
or any other needed special char coded in unicode. The forbidden, substituted with blank, char are the following:
$substitutions = array(
'&' => '',
';' => '',
'| ' => '',
'-' => '',
'$' => '',
'(' => '',
')' => '',
'`' => '',
'||' => '',
);