更新后的代码修改了之前后台绕过的方式。
利用随机函数
Code:
Sub chklogin
dim sql,rs
dim M_Name,loginValidate
M_Name = GetCookie("AdminName")
M_Name = replace(M_Name,"'","")
on error resume next
set rs = Database.GetRecordDetail("Tbl_Manager","M_Name='" & M_Name &"'")
loginValidate = md5(rs("M_Random") & rs("M_Name") & rs("M_ID")) ''''''''''''''这里是利用 随机数+用户名+id号。
if err then
SetCookie "check","",30
writeend "<script>top.location.href='index.asp?action=login';</script>"
end if
if GetCookie("check") <> loginValidate then ''''不等于则返回登录页面
SetCookie "check","",30
writeend "<script>top.location.href='index.asp?action=login';</script>"
end if
'''''''到这里也就可以算登陆了。
End Sub
分析到这里大家就会去想注射了, 因为我们如果注射就能拿到以上三个条件所有的内容那么就可以直接登陆后台了, 由于没时间详细看, 所以就只观看下大概, 发现他是利用函数来进行设置查询更新之类的。 所以就不看了。 时间有限。
只说一下这个问题 GETIP 这个函数里的ServerVariables肯定是没做过滤的, 所以我们就可以提交注射了, 大家自己找注射漏洞就可以了。
Code:
Function GetIP()
Dim addr, x, y
x = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
y = Request.ServerVariables("REMOTE_ADDR")
addr = IIF(isN(x) or lCase(x)="unknown",y,x)
If InStr(addr,".")=0 Then addr = "0.0.0.0"
GetIP = addr
End Function












