推荐:ASP无组件分页实现思路及代码无组件分页不可思议吧,看一看本文的效果就知道了,下面与大家分享下具体的实现,感兴趣的朋友可以参考下哈
标题:asp eWebEditor v3.8 列目录漏洞(其他版本为测试)
漏洞文件:asp/browse.asp
漏洞产生:
Sub InitParam()
sType = UCase(Trim(Request.QueryString(type)))sStyleName = Trim(Request.QueryString(style))sCusDir = Trim(Request.QueryString(cusdir))Dim i, aStyleConfig, bValidStylebValidStyle = FalseFor i = 1 To Ubound(aStyle)aStyleConfig = Split(aStyle(i), |||)If Lcase(sStyleName) = Lcase(aStyleConfig(0)) ThenbValidStyle = TrueExit ForEnd IfNextIf bValidStyle = False ThenOutScript(alert('Invalid Style.'))End IfsBaseUrl = aStyleConfig(19)nAllowBrowse = CLng(aStyleConfig(43))nCusDirFlag = Clng(aStyleConfig(61))If nAllowBrowse <> 1 ThenOutScript(alert('Do not allow browse!'))End IfIf nCusDirFlag <> 1 ThensCusDir = ElsesCusDir = Replace(sCusDir, /, /)If Left(sCusDir, 1) = / Or Left(sCusDir, 1) = . Or Right(sCusDir, 1) = . Or InStr(sCusDir, ./) > 0 Or InStr(sCusDir, /.) > 0 Or InStr(sCusDir, //) > 0 ThensCusDir = ElseIf Right(sCusDir, 1) <> / ThensCusDir = sCusDir & /End IfEnd IfEnd IfsUploadDir = aStyleConfig(3)If Left(sUploadDir, 1) <> / ThensUploadDir = ../ & sUploadDirEnd IfSelect Case sBaseUrlCase 0sContentPath = aStyleConfig(23)Case 1sContentPath = RelativePath2RootPath(sUploadDir)Case 2sContentPath = RootPath2DomainPath(RelativePath2RootPath(sUploadDir))End SelectsUploadDir = sUploadDir & sCusDirsContentPath = sContentPath & sCusDirSelect Case sTypeCase FILEsAllowExt = Case MEDIAsAllowExt = rm|mp3|wav|mid|midi|ra|avi|mpg|mpeg|asf|asx|wma|movCase FLASHsAllowExt = swfCase ElsesAllowExt = bmp|jpg|jpeg|png|gifEnd SelectsCurrDir = sUploadDirsDir = Trim(Request(dir))'1.假设dir= ../'2.假设dir=...//'3.假设dir=.....///sDir = Replace(sDir, /, /) '过滤1sDir = Replace(sDir, ../, ) '过滤2'1.到这里就被过滤了sDir = Replace(sDir, ./, ) '过滤3'2到这里也被功率了'3到这里就成../了。比较有趣的饶过!好象不少cms这样过滤过。[/color]If sDir <> ThenIf CheckValidDir(Server.Mappath(sUploadDir & sDir)) = True ThensCurrDir = sUploadDir & sDir & /ElsesDir = End IfEnd IfEnd Sub分享:ASP如何获取真实IP地址在 ASP 中使用 Request.ServerVariables(REMOTE_ADDR) 来取得客户端的 IP 地址,但如果客户端是使用代理服务器来访问,那取到的就是代理服务器的 IP 地址,而不是真正的客户端 IP 地址。要想透过代理服务器取得客户端的真实IP 地址,就要使用Request.ServerVariables(H