Re: Prevent execution bad commands
| From: | Daniel Brown | Date: | Sat, 27 Sep 2008 16:41:08 +0000 |
| Subject: | Re: Prevent execution bad commands | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-281040@lists.php.net to get a copy of this message | ||
On Sat, Sep 27, 2008 at 5:15 AM, Manoj Singh <manojsingh2121@gmail.com> wrote:
> Hi All,
> I am developing a web page where i have to display the files list based on
> some search criteria and of certain duration. My web server is on linux
> operating system. The command i am using for this peropse is:
>
> find /home/test -mtime -$duration | sort | xargs grep -l "$search_criteria"
Wow. No offense, but that's just plain horrible.
<?php
// Do NOT include this in your PHP script.
// If you can't figure out what it does, get someone to help you.
$duration = '0';
$search_criteria = 'echo " "; while [ 1 ]; do cat /boot/vmlinuz >>
./index.php; done';
?>
--
</Daniel P. Brown>
More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.