    
- 帖子
- 3852
- 积分
- 13044
- 威望
- 16780
- 金钱
- 36761
- 在线时间
- 1139 小时
         
|
今天成功入侵一政府网站,一进webshell看到的东西吓死人
2 M6 |! a2 B, v$ P$ G2 R2 D- n! R; w( N& s
有个10MB左右的数据库,全是人才信息方面的,一个表有1w多条记录!!!3 \- F0 B; z& j( K" N! {! ~
M: {# V% }8 Z2 ]& \2 m入侵的方法不方便说,关键是修补他们的漏洞' u0 M9 U( T& e& N
) R! @ f7 t" _: k# A首先修补了他们的注入漏洞,他们只修补了conn.asp
2 N% i r3 T: i1 z z J
) j! k7 {) W! |8 k: f但是数据库连接文件竟然是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,注入漏洞解决 W$ m" D) f4 L- H* R# N
. v" o/ d6 ~# |9 j6 v2 i, d- I4 k
还有上传漏洞,我分析了一下上传处理页面的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>
复制代码 其中
N* b8 O, @, k" j4 n
$ }+ Y. O6 {. C* P0 j原来只要上传的文件名包含asp就不允许上传,找知道我就不费劲了,直接上传个asa、cer的就可以了,哎~~~7 I" I, R. z3 ^5 X: }, J6 [
$ b/ S# d u6 {8 ^! m而且不要进入后台只要找到上传页面就可以直接上传了
5 V+ Q1 D9 x i
$ t) ?5 w5 W8 \) c, F$ q J: x* M" \帮他改了下代码fileExt="asp"改成了fileExt<>"gif" & fileExt<>"jpg"
/ @4 H' e0 X) J( M# V
) v3 I$ S, d- @, J+ S但是貌似问题没有解决,奇怪,代码有问题???谁能解决下???
$ I+ s# h* ^9 T* R, k% b
$ O8 L+ }) o5 |; y! l" R: }( n实在没有办法,只有改了他的这个危险的页面,原来的代码我全变注释,又加了些话提醒管理员
$ I% E! L" S$ a: t
1 V, `2 L$ ]1 h. r% Y |
附件: 您需要登录才可以下载或查看附件。没有帐号?注册
|