 |
再次成功入侵中国教育门户网站
www.hx99.org 阅读: 时间:2007-07-09 整理:华西黑盟
------------------------------------------------------------------ |
再次成功入侵中国教育门户网站=->发表于<<黑客X档案>>2006.2
图片: screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_846219575660957.png');"src="http://www.hackeroo.com/attachment/5_1_846219575660957.png"onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 图片: screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_8a6b15fd96d12e4.png');"src="http://www.hackeroo.com/attachment/5_1_8a6b15fd96d12e4.png"onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> (只有此域名为正版官方网站) 本文发表于:<<黑客X档案>>2006年2月刊 文章标题:入侵目标-中国教育门户网站 本文作者:李嘉义 作者小站:
此文纯属利用业余时间骗点稿费之作,没什么技术性,高手请跳过此页!!!
#################################################
几个月前应同事之邀,义务为一个网站作了次安全检测。通过网站上的信息,如网站的名字(中国教育XX网)和所涉及的全国各地区的很多学校都是此网站的会员,另外结合LOGO上的字样(“教育部、中宣部、中组部…”)以及地址在国家信息中心等信息分析一下,这网站即使不是中国教育部政府性质网站,也是份量不轻的中国教育类门户网站。然而检测之后,安全性之差,真是让我大跌眼镜!
当时仅用了一个很普通的小漏洞,就轻松进入了。几个月后心血来潮后,突然想起那个网站,再次尝试,居然那个漏洞还是存在,真是拿他们没有办法了。只好将木马复制到比较显眼的位置,希望管理员早些发现问题,并填补上漏洞。
一天,在网上碰到X档的老杨同学,和他闲扯时聊及此事。他让我将过程经验写出来,供新人们学习参考。本来入侵方面没用到多深的技术,不想写的。但考虑到在服务器安全方面,还有不少朋友缺少一些经验,干脆就写出一篇交给Sagi。但这个老杨非说我入侵过程和图片太少,我只好踏入再次入侵的道路……
再次入侵
简单尝试
轻车熟路,输入原来上传到服务器的ASP木马网址。提示为找不到该页。呵呵,真不容易,终于让他发现有人入侵过了!那么只好重新入侵试试啦~~
输入已注册过的用户名密码,再次来到论坛的发帖页面。居然直接从页面上把上传那一项去掉了,如图一。嗯~这到也是个临时的解决办法。既然这里不行了,去另外一个上传的地方看看吧!
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_f4c6a1cbe39b71f.png');"src="http://www.hackeroo.com/attachment/5_1_f4c6a1cbe39b71f.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0>
在首页输入用户名密码,自动跳入个人管理页面,如图二。记得这里有一个上传课件的地方也存在漏洞,总不会把这里的上传页面也删除了吧,呵~~
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_6a58604f887e1c8.png');"src="http://www.hackeroo.com/attachment/5_1_6a58604f887e1c8.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 点击发布课件进入上传课件页面,依次填好各栏,点击浏览选中加密过的ASP木马,如图三。同时打开WSockExpert工具准备抓包,当一切准备好后,点击提交。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_04ab7fa97946f5e.png');"src="http://www.hackeroo.com/attachment/5_1_04ab7fa97946f5e.png"onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0>
返回的提示结果竟然是非法操作,如图四。呵呵。看来的确是下了功夫,把ASP等后缀的上传给过滤掉了。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_b090dff5b44ffb7.png');"src="http://www.hackeroo.com/attachment/5_1_b090dff5b44ffb7.png"onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 又试了几个其它的前台上传页面,都不行了。可不能这样放弃,先去他后台看看吧!上次入侵只是简单看了看,没有下载他的数据库,没有他的后台用户,这回要重新想办法了……
注入的突破
上传不行了,我开始尝试常用的SQL注入方式,来取得后台密码吧。网站上有文章发布类的页面很多,我随意找了个链接ID,在后面加个单引号,出现错误页面,如图五。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_9437397a1a6a6a0.png');"src="http://www.hackeroo.com/attachment/5_1_9437397a1a6a6a0.png"onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 根据错误提示,可以看出该程序没有过滤单引号字符,存在注入漏洞;而且数据库采用的是MSSQL。
于是我继续利用这个注入点,在ID后面加上anduser<1,如图六。返回的错误页面轻松地把此程序的数据库用户名“e****t”送给我,不过有点可惜不是SA用户(呵~~有点贪心^_^)。与此类似的方法anddb_name()<1将可以轻松得到所连接的数据库名。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_ce8025434a7cc21.png');"src="http://www.hackeroo.com/attachment/5_1_ce8025434a7cc21.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 下面继续检查一下,是否可以跨库,继续在ID后面加上and(selectcount(*)frommaster.dbo.sysdatabaseswherename>1anddbid=8)<>0,如图七。返回的错误页面又把第八位的数据库名告诉了我。看来跨库也是没有问题的。这里顺便提一下,通过改变dbid=X(X=1,2,3…N)。不过我们通常从数字5或6开始尝试,因为头几位一般为系统用,所以我们从5开始依次循环,就可以得到所有的数据库名
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_09eab976c6bd468.png');"src="http://www.hackeroo.com/attachment/5_1_09eab976c6bd468.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 由于我现在不是主讲SQL注入,就不一一介绍手动注入的过程了。既然身为人类的我们和动物最大的区别就是制造工具和使用工具,那就来发挥我们这一特长吧。合理使用优秀的工具可以达到事半功倍的效果,目前流行的注入工具有很多。这里我以NBSI注入工具为例(黑客X档光盘有收藏,请支持正版!)。
好了,废话不多说,开工吧。输入注入点连接,点击检测。很快就可以得到注入后的数据库信息,如图八。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_1aedeb1c8c797d8.png');"src="http://www.hackeroo.com/attachment/5_1_1aedeb1c8c797d8.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 找到后台登录地址,用得到用户名密码登录,如图九。结果成功进入后台,如图十。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_5ba487a22548de3.png');"src="http://www.hackeroo.com/attachment/5_1_5ba487a22548de3.png"onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0>
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_bb59668c659e26d.png');"src="http://www.hackeroo.com/attachment/5_1_bb59668c659e26d.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 当点击左边的管理模块,发现在我上次入侵后,有其它的人进入过。并且非常BT的把每个模块的内容改为“我要强X漂亮的女老X!”这样的字样,如图十一。唉,我先当当清洁工吧,把这些污浊的字眼,全部从后台清空。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_93dcc992c6236ec.png');"src="http://www.hackeroo.com/attachment/5_1_93dcc992c6236ec.png"onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 做完清洁工作,开始做正事。随意找了个可上传的页面,如图十二,继续上传asp木马测试有没有存在上传漏洞。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_032684d0ab7aa1c.png');"src="http://www.hackeroo.com/attachment/5_1_032684d0ab7aa1c.png"onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 当提交后出现“发布成功”的页面后,如图十三。说明此处没有对上传文件作限制。存在上传漏洞。于是打开抓包工具,居然没有找到上传后的路径。不过木马文件毕竟是传上去了,抓包工具没有找到,就去数据库里找找线索吧。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_201796db8d46ec9.png');"src="http://www.hackeroo.com/attachment/5_1_201796db8d46ec9.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0>
从数据库猜解出的信息里,如图十四。虽然得到了上传的文件名等重要信息。但还是无法查出真实的路径,看来程序员在这方面也是下了一番工夫。于是我利用以往的经验对目录名狂试了N分种后,终于打算放弃了。没必要继续在这里浪费时间了。像这么大的网站,程序应该不是一个程序员在做。不如去其它的后台看看再说。虽然没有成功得手,但这里存在的上传漏洞还是给我比较多的希望的。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_f89e2b1204325a8.png');"src="http://www.hackeroo.com/attachment/5_1_f89e2b1204325a8.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 在另一个User_1的数据库表中得到了所有的会员学校用户信息,如图十五。随意找到一个帐号,成功进入后台,先点开论坛管理看一眼。如图十六。南开大学的地址等信息清楚的发布在论坛的左上部分。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_9f5cebaf89e84eb.png');"src="http://www.hackeroo.com/attachment/5_1_9f5cebaf89e84eb.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0>
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_7ae65e8cbafb689.png');"src="http://www.hackeroo.com/attachment/5_1_7ae65e8cbafb689.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 回到正题,继续检查文件上传漏洞。点击“招生快讯”的链接,继续点击上传文件进入到上传的页面,如图十七。当看到上传页面上说明的限制格式后,心里一凉。莫非已作了限制。报着先试一试再说的想法。上传了一个asp木马。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_aa3d7b70187143d.png');"src="http://www.hackeroo.com/attachment/5_1_aa3d7b70187143d.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> 哈哈,虚惊一场。不仅可以上传,连文件名和文件大小都返回到页面,如图十八。通过抓包工具,很顺利的找出上传的目录http://******/news/user_img/nkdx/2006.asp(*代表网址)。输入马的开门密码。看到了大家熟悉的海阳页面,如图十九。
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_69f55bb502de92c.png');"src="http://www.hackeroo.com/attachment/5_1_69f55bb502de92c.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0>
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_f7b542f60f35f21.png');"src="http://www.hackeroo.com/attachment/5_1_f7b542f60f35f21.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0>
进入后,先随意看了看系统的信息,然后重点看一看网站所在的分区,如图二十。随意新建个文件,然后再删除,如图二十一。看来目录权限没有限制。突然想起这个服务器有个版本很低的FTP。于是打开ServUDaemon.ini文件,随意找了个帐号连接了一下,哈哈,一切顺利,如图二十二。如果有需要以后文件可以直接通过FTP上传下载了
screen.width-461)window.open('http://www.hackeroo.com/attachment/5_1_c9a761c7a4cdfd6.png');"src="http://www.hackeroo.com/attachment/5_1_c9a761c7a4cdfd6.png"width=340onload="if(this.width>screen.width-460)this.width=screen.width-460;"border=0> [attachment=965] [attachment=966]
服务器到这一步,网站的生杀大权又回到我的手上,最近工作也挺忙的。就不在这里玩了,只是感触到一个服务器如果没有一个全面负责的管理人员,真的太危险了。安全应该尽量做在前面,把可以避免的问题让他不要成为问题。而不是出现问题再亡羊补牢。
|
|
| ------------------------------------------------------------------------------------------- |
上一篇:秘密穿过内网防火墙 下一篇:测试的两个JSP环境下的安全漏洞 |
| ------------------------------------------------------------------------------------------- |
|
|
|
 |
|
|