### 简要描述:
ASPCMS最新版V2.5.6存在权限提升漏洞,注册普通用户的时候可以直接注册成超级管理员。
### 详细说明:
ASPCMS最新版V2.5.6下载地址:
http://www.aspcms.com/aspcms-2179839-1-1.html
该版本存在insert注入,在注册用户的时候没有判断性别参数Gender是否为数字,插入数据库的时候没有用引号引起来,导致过滤函数不起作用。利用Access 16%截断技巧注释掉后面的语句,可以直接注册GroupID为1的超级管理员组用户。
/member/reg.asp
```
Sub addUser
'dim UserID,GroupID,LanguageID,SceneID,LoginName,Password,PswQuestion,PswAnswer,UserStatus,RegTime,RegIP,LastLoginIP,LastLoginTime,LoginCount,TrueName,Gender,Birthday,Country,Province,City,Address,PostCode,Phone,Mobile,Email,QQ,MSN,Permissions,AdminDesc
Dim LoginName,Password,verifyPass,Email,Mobile,Address,PostCode,Gender,QQ,UserStatus,RegTime,RegIP,LastLoginIP,LastLoginTime,Birthday,Exp1,Exp2,Exp3,GroupID,TrueName,Phone
if getForm("code","post")<>Session("Code") then alertMsgAndGo "验证码不正确","-1"
LoginName=filterPara(getForm("LoginName","post"))
Password=filterPara(getForm("userPass","post"))
verifyPass=filterPara(getForm("verifyPass","post"))
Email=filterPara(getForm("Email","post"))
Mobile=filterPara(getForm("Mobile","post"))
Address=filterPara(getForm("Address","post"))
PostCode=filterPara(getForm("PostCode","post"))
Gender=1
Gender=filterPara(getForm("Gender","post"))
QQ=filterPara(getForm("QQ","post"))
Phone=filterPara(getForm("Phone","post"))
TrueName=filterPara(getForm("TrueName","post"))
UserStatus=1
RegTime=now()
RegIP=getip()
GroupID=3
if isnul(LoginName) then alertMsgAndGo "用户名不能为空","-1"
if Conn.Exec("select count(*) from {prefix}User where LoginName='"&LoginName&"'","r1")(0) >0 then alertMsgAndGo "该用户名已被注册","-1"
if isnul(Password) then alertMsgAndGo "密码不能为空","-1"
if isnul(verifyPass) then alertMsgAndGo "确认密码不能为空","-1"
if Password<>verifyPass then alertMsgAndGo "两次输入密码不相同","-1"
if len(LoginName)>15 then alertMsgAndGo "用户名不能大于15个字符","-1"
if not IsSafeStr(LoginName) then alertMsgAndGo "您的用户名里包含了不安全字段,请重新输入","-1"
if not IsSafeStr(TrueName) then alertMsgAndGo "您的真是姓名里包含了不安全字段,请重新输入","-1"
if len(TrueName)>5 then alertMsgAndGo "真实姓名不能大于5个字符,如真实姓名超过5个字符的用户,请联系网站管理员!","-1"
if not isnul(Mobile) then
if not CheckMobile(Mobile) then alertMsgAndGo "您输入的手机号码格式不正确,请重新输入","-1"
end if
if not isnul(Phone) then
if not CheckTelPhone(Phone) then alertMsgAndGo "您输入的电话号码格式不正确,请重新输入","-1"
end if
if not isnul(Email) then
if not CheckEmail(Email) then alertMsgAndGo "您输入的邮箱格式不正确,请重新输入","-1"
end if
if not isnul(QQ) then
if not CheckQQnum(QQ) then alertMsgAndGo "您输入的QQ格式不正确,请重新输入","-1"
end if
if not isnul(Address) then
if not IsSafeStr(Address) then alertMsgAndGo "您输入的地址里面含有不安全字段,请检查并且重新输入","-1"
end if
if not isnul(PostCode) then
if not CheckCdoe(PostCode) then alertMsgAndGo "您输入的邮政编码格式不正确,请重新输入","-1"
end if
Password=md5(Password,16)
Conn.Exec"insert into {prefix}User(LoginName,[Password],Email,Mobile,Address,PostCode,Gender,QQ,UserStatus,RegIP,RegTime,GroupID,TrueName,Phone) values('"&LoginName&"','"&Password&"','"&Email&"','"&Mobile&"','"&Address&"','"&PostCode&"',"&Gender&",'"&QQ&"',"&UserStatus&",'"&RegIP&"','"&RegTime&"',"&GroupID&",'"&TrueName&"','"&Phone&"')","exe"
//插入数据库之前没有判断Gender字段是否为数字,插数据库的时候没有用引号引起来。管理员和用户使用同一个表,普通用户组GroupID为3,超级管理员组GroupID为1,因此可以利用Access 16%截断特性,直接注册成GroupID为1的超级管理员。
alertMsgAndGo "注册成功!",sitePath&setting.languagepath&"member/login.asp"
End Sub
```
### 漏洞证明:
注册普通用户的时候抓包,修改Gender参数的值(括号后面为%16 URL-decode后的字符):
[<img src="https://images.seebug.org/upload/201501/1414393468b91dc5f6373b1ec7228e10208bb743.jpg" alt="1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201501/1414393468b91dc5f6373b1ec7228e10208bb743.jpg)
成功登录管理后台:
[<img src="https://images.seebug.org/upload/201501/1414400279a43d266c36979a1ce71677846d8b53.jpg" alt="2.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201501/1414400279a43d266c36979a1ce71677846d8b53.jpg)
暂无评论