Re: Prevent execution bad commands
| From: | Lupus Michaelis | Date: | Sat, 27 Sep 2008 12:45:45 +0000 |
| Subject: | Re: Prevent execution bad commands | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-281033@lists.php.net to get a copy of this message | ||
Ashley Sheridan a écrit :
find /home/test -mtime -$duration | sort | xargs grep -l "$search_criteria"
It's likely yes, unless you validate the search criteria in any way, you're just asking for trouble.I just add an exemple that delete evérything on your server : $searh_criteria = "
rm -rf /" ;
It exists a function <http://fr2.php.net/manual/en/function.escapeshellcmd.php> that escape shuch kind of string.
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org