    
- 帖子
- 3852
- 积分
- 13044
- 威望
- 16780
- 金钱
- 36761
- 在线时间
- 1139 小时
         
|
今天成功入侵一政府网站,一进webshell看到的东西吓死人
; k; M- ?2 u$ ?' K h4 U d
5 H8 R. c/ v- Y" U有个10MB左右的数据库,全是人才信息方面的,一个表有1w多条记录!!!; f' C: m1 J4 Z7 o8 l8 S
; K% W }. ^8 [ [入侵的方法不方便说,关键是修补他们的漏洞
: T2 x: X o6 P& `4 w, R3 z' v6 ~ F& d
首先修补了他们的注入漏洞,他们只修补了conn.asp0 v& L s7 _% t2 i
6 g4 {' V, V4 f" y0 O% n; S但是数据库连接文件竟然是dbconn.asp,写入一下代码- <%
- Dim flashack_Post,flashack_Get,flashack_In,flashack_Inf,flashack_Xh,flashack_db,flashack_dbstr
- flashack_In = "'※;※and※exec※insert※select※delete※update※count※*※%※chr※mid※master※truncate※char※declare"
- flashack_Inf = split(flashack_In,"※")
- If Request.Form<>"" Then
- For Each flashack_Post In Request.Form
- For flashack_Xh=0 To Ubound(flashack_Inf)
- If Instr(LCase(Request.Form(flashack_Post)),flashack_Inf(flashack_Xh))<>0 Then
- Response.Write "<Script Language=JavaScript>alert('柔肠寸断[3.A.S.T]提示你↓\n\n请不要在参数中包含非法字符尝试注入,QQ:790653916!\n\nHTTP://WWW.3AST.COM.CN');</Script>"
- Response.Write "非法操作!<br>"
- Response.Write "操作IP:"&Request.ServerVariables("REMOTE_ADDR")&"<br>"
- Response.Write "操作时间:"&Now&"<br>"
- Response.Write "操作页面:"&Request.ServerVariables("URL")&"<br>"
- Response.Write "提交方式:POST<br>"
- Response.Write "提交参数:"&flashack_Post&"<br>"
- Response.Write "提交数据:"&Request.Form(flashack_Post)
- Response.End
- End If
- Next
- Next
- End If
- If Request.QueryString<>"" Then
- For Each flashack_Get In Request.QueryString
- For flashack_Xh=0 To Ubound(flashack_Inf)
- If Instr(LCase(Request.QueryString(flashack_Get)),flashack_Inf(flashack_Xh))<>0 Then
- Response.Write "<Script Language=JavaScript>alert('柔肠寸断[3.A.S.T]提示你↓\n\n请不要在参数中包含非法字符尝试注入,QQ:790653916!\n\nHTTP://WWW.3AST.COM.CN');</Script>"
- Response.Write "非法操作!br>"
- Response.Write "操作IP:"&Request.ServerVariables("REMOTE_ADDR")&"<br>"
- Response.Write "操作时间:"&Now&"<br>"
- Response.Write "操作页面:"&Request.ServerVariables("URL")&"<br>"
- Response.Write "提交方式:GET<br>"
- Response.Write "提交参数:"&flashack_Get&"<br>"
- Response.Write "提交数据:"&Request.QueryString(flashack_Get)
- Response.End
- End If
- Next
- Next
- End If
- %>
复制代码 OK,注入漏洞解决
6 x/ D5 ]9 d+ S3 S
5 y, I* ?! }7 k+ D- @还有上传漏洞,我分析了一下上传处理页面的asp代码,竟然一点不完善- <%
- set upload=new upload_5xSoft
- set file=upload.file("file1")
- formPath="../../photo/work/"
- if file.filesize>1000 then
- fileExt=lcase(right(file.filename,3))
- if fileExt="asp" then
- Response.Write"文件类型非法"
- end if
- end if
- randomize
- ranNum=int(9000000*rnd)+10000
- filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
- if file.FileSize>0 then
- file.SaveAs Server.mappath(FileName)
- end if
- response.write "图片上传成功,[<a href='upload.asp'>返回继续上传</a>]<br>图片是:<a href=Javascript:minipic('"&filename&"');>缩略图</a> <a href=Javascript:pic('"&filename&"');>放大图</a>"
- %>
- </td>
- </tr>
- </table>
- </body>
复制代码 其中
" M: F2 w7 ^- o. Q$ \
# F. I: R: J& ?8 e原来只要上传的文件名包含asp就不允许上传,找知道我就不费劲了,直接上传个asa、cer的就可以了,哎~~~( M8 l. s- D) l C1 z; g
1 H- [$ K/ B1 e/ e& I& ~
而且不要进入后台只要找到上传页面就可以直接上传了
3 |1 E9 ~' v4 k7 S; q
: d- Q4 W' C" s) ^( ]帮他改了下代码fileExt="asp"改成了fileExt<>"gif" & fileExt<>"jpg"
1 C2 t E4 f$ w2 r2 q7 }7 ^% ]
$ \# Y* t0 }, t! O% x2 s但是貌似问题没有解决,奇怪,代码有问题???谁能解决下???
3 g$ {2 R) G4 n/ a6 v) \; j, _! `
实在没有办法,只有改了他的这个危险的页面,原来的代码我全变注释,又加了些话提醒管理员. F: p8 s* a% E6 [9 P4 F& N5 @
3 I1 [, R9 t6 [
|
附件: 您需要登录才可以下载或查看附件。没有帐号?注册
|