    
- 帖子
- 3852
- 积分
- 13044
- 威望
- 16780
- 金钱
- 36761
- 在线时间
- 1139 小时
         
|
今天成功入侵一政府网站,一进webshell看到的东西吓死人
! Y3 c6 |3 M/ C* J* K; p& i+ x5 S2 `( n# H$ T1 a
有个10MB左右的数据库,全是人才信息方面的,一个表有1w多条记录!!!
) n; H( E: l: r0 T
3 E" Q& p+ L4 H1 p4 S入侵的方法不方便说,关键是修补他们的漏洞7 u" i! U Y. l
* L1 ]' k5 q5 j1 y* W首先修补了他们的注入漏洞,他们只修补了conn.asp/ g4 X* o- P& v% [: l- l- H
2 D& ^7 x3 w! s# h- N! ^但是数据库连接文件竟然是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,注入漏洞解决
/ k) J' f! H0 x' Q1 D) n( @# M! @( ]2 N0 m/ _1 X
还有上传漏洞,我分析了一下上传处理页面的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>
复制代码 其中/ |; s7 w! E, H& V# Q3 a
' V7 g$ D) G) j1 @6 L4 T# ~* o9 p( [原来只要上传的文件名包含asp就不允许上传,找知道我就不费劲了,直接上传个asa、cer的就可以了,哎~~~( X5 B6 J; j. p8 }& g* |/ h
+ o& | v I. g6 d" L而且不要进入后台只要找到上传页面就可以直接上传了2 {% p" S6 F/ n# X
: i+ O5 J: N4 u: j1 i
帮他改了下代码fileExt="asp"改成了fileExt<>"gif" & fileExt<>"jpg" : P9 A1 }; t, A3 a5 c
7 n4 L3 n# F1 }) b) w) o' \! s* `但是貌似问题没有解决,奇怪,代码有问题???谁能解决下???
# e5 [# Q0 u! `2 H
1 q4 u+ o- L. A n8 C实在没有办法,只有改了他的这个危险的页面,原来的代码我全变注释,又加了些话提醒管理员2 `/ W, E0 P' T* m! P: L0 Y4 J
2 q! z3 n4 H I B% x9 k2 w5 D
|
附件: 您需要登录才可以下载或查看附件。没有帐号?注册
|