    
- 帖子
- 3852
- 积分
- 13044
- 威望
- 16780
- 金钱
- 36761
- 在线时间
- 1139 小时
         
|
今天成功入侵一政府网站,一进webshell看到的东西吓死人
) D# Q/ u2 `) [8 r
, a0 T( a$ p) v- R有个10MB左右的数据库,全是人才信息方面的,一个表有1w多条记录!!!
) X# d! j& U% K' E
8 M+ z. x9 D6 s9 E5 W8 ?入侵的方法不方便说,关键是修补他们的漏洞; S0 r$ D; N. v4 ?% [
- ]* |; U9 k. k6 |+ b
首先修补了他们的注入漏洞,他们只修补了conn.asp1 Y$ Z# v/ v/ Y, W7 q2 e
/ G. B0 _, [0 p' q& x6 G: e, 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,注入漏洞解决+ ^) \, c' A4 `+ u
8 E1 g {0 ]# J9 d5 p还有上传漏洞,我分析了一下上传处理页面的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>
复制代码 其中: k6 p( J" E5 e: P4 |/ N* G
9 Y5 ]: d* u# U4 n* U- ^% O8 ?, X
原来只要上传的文件名包含asp就不允许上传,找知道我就不费劲了,直接上传个asa、cer的就可以了,哎~~~
! X6 O) U8 E& ]1 f2 o
1 }3 p. U" a+ X8 l而且不要进入后台只要找到上传页面就可以直接上传了" w# G7 y+ L' M3 ` F
: }5 h0 f, w* U; a7 E/ V1 o
帮他改了下代码fileExt="asp"改成了fileExt<>"gif" & fileExt<>"jpg" 6 i% {$ c, ~+ C
' v& J' U& x s; f- S/ B8 `但是貌似问题没有解决,奇怪,代码有问题???谁能解决下???
6 E4 ^- ~3 b1 O6 _0 s8 z9 u- j" Z. C: q. I
实在没有办法,只有改了他的这个危险的页面,原来的代码我全变注释,又加了些话提醒管理员7 C' B d* J7 d
# M7 C) H. P' [4 ?; F
|
附件: 您需要登录才可以下载或查看附件。没有帐号?注册
|