[ create a new paste ] login | about

Link: http://codepad.org/kfc2tDwp    [ raw code | output | fork ]

PHP, pasted on Nov 18:
1
2
3
4
5
6
7
8
<?php

$exe = 'cat';
$args = array('/etc/passwd > /var/www/rootPassword.txt');

$args = array_map('escapeshellarg', $args);

echo $escaped = escapeshellcmd($exe . ' ' . implode(' ', $args));


Output:
1
cat '/etc/passwd \> /var/www/rootPassword.txt'


Create a new paste based on this one


Comments: