<? PHP
Set_time_limit (0 );
Function tree ($ directory)
{
$ Mydir = Dir ($ directory );
While ($ file = $ mydir-> Read ()){
If (is_dir ("$ directory/$ File") & ($ file! = ".") & ($ File! = ".."))
{
Tree ("$ directory/$ File ");
}
Else {
If ($ file! = "." & $ File! = ".." & Eregi (". php", $ file )){
$ FD = realpath ($ directory. "/". $ file );
$ Fop = fopen ($ FD, "R ");
$ I = 0;
While ($ buffer = fgets ($ fop, 4096 )){
$ I ++;
If (eregi ("include", $ buffer) | eregi ("require", $ buffer) & strpos ($ buffer, "$ ")){
Countall ();
Echo "<li> <font color = \" # ff00cc \ "> file path :". $ FD. "</font> </LI> ". "<TD> <a href = \"? Downfile = ". $ FD. "\"> down & Open </a> ". "<br> the file line <font color = \" # 0000ff \ "> ". $ I. "</font >::======> ". $ buffer. "<HR> ";
}
}
Fclose ($ FOP );
}
}
}
$ Mydir-> close ();
}
Function countall ()
{
Static $ COUNT = 1;
Echo "the files Number". $ count ."";
$ Count ++;
}
If ($ _ Get ['act '] = "findmm "){
$ Fuck = $ _ Get ['guid '];
Tree ($ fuck );
}
If ($ _ Get ['downfile']) {
$ Downfile = $ _ Get ['downfile'];
If (! @ Is_file ($ downfile )){
Echo "<SCRIPT> alert (\" the file is out \ ") </SCRIPT> ";
}
$ Filename = basename ($ downfile );//
$ Filename_info = explode ('.', $ filename );//
$ Fileext = $ filename_info [count ($ filename_info)-1];
Header ('content-type: Application/X-'. $ fileext );
Header ('content-Disposition: attachment; filename = '. $ filename );
Header ('content-Description: php3 generated data ');
Readfile ($ downfile );
Exit;
}
?>
<Br>
<Form action = "<? Echo $ php_self?> "Method =" get ">
<Table width = "600" border = "0" align = "center" cellpadding = "0" cellspacing = "0">
<Tr>
<TD width = "400" Height = "22"> Please wirte path (like:/usr/www/): </TD>
<TD> <input name = "guid" type = "text" id = "guid" value = "E: \ myphp \ apmserv5.1.2 \ www \ htdocs \ ecshop "size =" 40 "/> </TD>
</Tr>
<Input type = "hidden" name = "act" value = "findmm"/>
<Tr>
<TD Height = "22"> & nbsp; </TD>
<TD> <input type = "Submit" name = "Submit" value = "post fuck"/> </TD>
</Tr>
<Tr>
<TD Height = "22"> & nbsp; </TD>
<TD> & nbsp; </TD>
</Tr>
</Table>
</Form>
<Center> <li> <font color = "# ff00cc"> <B> copy write by % 5c e_mail: isno_sec@163.com </B> </font> </LI> </center>
<Center> <li> <font color = "# ff00cc"> <B> Bluestar warning: it's just a tool </B> </font> </LI> </center>
<Center> <li> <font color = "# ff00cc"> <B> welcome to my blog !! </B> </font> </LI> </center>
<Center> <li> <font color = "# ff00cc"> <B> <a href = http://www.cnblogs.com/allyesno/> http://www.cnblogs.com/allyesno/ </B> </font> </LI> </center>