# Tools - DFIRやマルウェア解析,OSINT,その他の多数のツールに関するデータベース
[DFIR TRAINING(TOOLS)](https://www.dfir.training/dfirtools/advanced-search) - infographicsやツールのチートシート
[DFIR TRAINING(RESOUCES-Downloads-Infographics & Cheet Sheets)](https://www.dfir.training/resources/downloads/cheatsheets-infographics) ### OS/VM - [FLARE VM](https://github.com/fireeye/flare-vm)
FireEye社が提供するマルウェア解析, DFIR, ペネトレーションテストに特化したWindowsベースのディストリビューション
Practical Malware Analysis Labsが同梱
- [REMnux](https://remnux.org/)
SANSが提供するリバースエンジニアリング,マルウェア解析に特化したUbuntuベースのディストリビューション
- [Tsurugi Linux](https://tsurugi-linux.org/index.php)
DFIR,マルウェア解析,OSINTに特化したUbuntuベースのディストリビューション
### Static Analysis and Debug tools ※空欄は調査中(更新予定) |name|disassembler|decompiler|debugger|reference| |:-|:-|:-|:-|:-| |IDA pro|〇|〇(Not free)|〇|||||| |Binary Ninja|〇|||||||| |Cutter|〇|r2dec,r2ghidra|native
gdb
windbg
etc.|[INTRO TO CUTTER FOR MALWARE ANALYSIS(2019-03)](https://malwology.com/2019/03/14/intro-to-cutter-for-malware-analysis/)
[megabeets.net](https://www.megabeets.net/?s=cutter)
[Cutter: Presenting r2ghidra Decompiler,r2con 2019](https://www.youtube.com/watch?v=eHtMiezr7l8&list=LLTk6-mAiILdt3V27uab14LA&index=8&t=0s)||||| |Ghidra|〇|〇||[Reversing WannaCry Part 2 - Diving into the malware with #Ghidra,youtube](https://www.youtube.com/watch?v=Q90uZS3taG0)
[cheetsheet](https://www.oldergeeks.com/downloads/file.php?id=2767)||||| |x64/x32dbg|〇|Snowman|〇|||||| |WinDbg|〇||〇|||||| |GDB|〇||〇|||||| |objdump|〇||| |Snowman||〇||||||| |name|plugin|price|platform|remarks| |:-|:-|:-|:-|:-| |IDA pro|[Lighthouse](https://github.com/gaasedelen/lighthouse)
[UEFI_RETool](https://github.com/yeggor/UEFI_RETool/tree/master/ida_plugin)|Not free|multi|||||| |Binary Ninja|[Lighthouse](https://github.com/gaasedelen/lighthouse)|Not free||||||| |Cutter|[CutterDRcov](https://github.com/oddcoder/CutterDRcov)
[Jupyter Plugin for Cutter](https://github.com/radareorg/cutter-jupyter)
[x64dbgcutter](https://github.com/yossizap/x64dbgcutter)
[etc.](https://github.com/radareorg/cutter-plugins)|free|multi|||||| |Ghidra|[pwndra](https://github.com/0xb0bb/pwndra)
[ghidra_scripts](https://github.com/alephsecurity/general-research-tools/tree/master/ghidra_scripts)
[OOAnalyzer](https://insights.sei.cmu.edu/sei_blog/2019/07/using-ooanalyzer-to-reverse-engineer-object-oriented-code-with-ghidra.html)|free|multi|||||| |x64/x32dbg|[DbgChild](https://github.com/David-Reguera-Garcia-Dreg/DbgChild)|free|windows|||||| |WinDbg||free|windows|Kernel mode debugging possible||||| |GDB|gdbpeda
pwngdb|free|linux|||||| |objdump||free|linux|| |Snowman||||||||| ### Tracer - [drltrace](https://github.com/DynamoRIO/drmemory/tree/master/drltrace) - [DynamoRIO](https://github.com/DynamoRIO/dynamorio) based - ライブラリトレーサ(Windows版ltrace) - [drstrace](http://drmemory.org/strace_for_windows.html) - DynamoRIO based - システムコールトレーサ(Windows版strace) - [memtrace](https://github.com/DynamoRIO/dynamorio/blob/master/api/samples/memtrace_simple.c) - DynamoRIO based - メモリトレーサ - [bbbuf](https://github.com/DynamoRIO/dynamorio/blob/master/api/samples/bbbuf.c) - DynamoRIO based - べーシックブロックトレーサ - [API Monitor](http://www.rohitab.com/apimonitor) - GUI(Windows) - APIコールを監視ツール ### Instrumentation - [drcov](http://dynamorio.org/docs/page_drcov.html) - DynamoRIO based - カバレッジ計測 - drrun経由で実行 ``` > drrun.exe -t drcov -- [program name] [arguments] ``` - Intel PIN ### Traffic Analysis tools - Wireshark - ref: - [Wireshark Tutorial,Unit42(2019)](https://unit42.paloaltonetworks.com/tag/tutorial/) - tcpdump - scapy - [Fiddle](https://www.telerik.com/fiddler) - Web Proxy debugger - [EKFiddle](https://github.com/malwareinfosec/EKFiddle) - ref: - [Malicious Traffic Analysis with EKFiddle(2019-03)](https://drive.google.com/file/d/1VhZyCiHgtDwcCh7cpVWMCTi9B_Nj66AC/view) - Burp Suite - Fake-net NG - INetSim - Noriben ### Forensic - Sysinternals - [**Volatility**](https://github.com/mether049/malware/edit/master/malware-analysis_ref_and_memo.md) - DFIRやマルウェア解析に焦点を当てたメモリダンプ調査フレームワーク - プラグインが充実している - プロファイルの指定が必要である(メモリダンプがどのシステム(OS,データ構造,シンボル)で使用したものなのかを識別するため) - Volatility 3からは不要とのこと - 対応しているメモリダンプのフォーマット > - Raw linear sample (dd) > - Hibernation file (from Windows 7 and earlier) > - Crash dump file > - VirtualBox ELF64 core dump > - VMware saved state and snapshot files > - EWF format (E01) > - LiME format > - Mach-O file format > - QEMU virtual machine dumps > - Firewire > - HPAK (FDPro) - **ref:** - [cheet sheet](https://github.com/volatilityfoundation/volatility/raw/gh-pages/docs/VolatilityCheatSheet.pdf) - [cheet sheet(sans)](https://digital-forensics.sans.org/media/volatility-memory-forensics-cheat-sheet.pdf) - [Command Reference](https://github.com/volatilityfoundation/volatility/wiki/Command-Reference) - [First steps to volatile memory analysis](https://medium.com/@zemelusa/first-steps-to-volatile-memory-analysis-dcbd4d2d56a1) - [Volatility, my own cheatsheet (Part 1): Image Identification](https://www.andreafortuna.org/2017/06/25/volatility-my-own-cheatsheet-part-1-image-identification/) - Virtual Box上のゲストOSからメモリダンプ(VirtualBox ELF64 core dump)を取得する方法 - VBoxManageを利用してホストOSからゲストOSを起動する(VBoXManageで起動しないと原因は分からないがメモリダンプの取得でうまくいかなかった) ``` > .\VBoxManage.exe list vms # Virtual Boxで作成済みのゲストの名前とuuidの一覧を取得 > .\VBoxManage.exe startvm "guest name or uuid" #起動 ``` - VboxManageでメモリダンプ(VirtualBox ELF64 core dump)を取得する ``` > .\VBoxmMnage.exe debugvm "guest name or uuid" dumpvmcore --filename output.dmp ``` - この他に,[vboxdump.py](https://www.virtualbox.org/ticket/10222)というメモリダンプ作成用のpythonスクリプトもある - ref: - [How to extract a RAM dump from a running VirtualBox machine](https://www.andreafortuna.org/2017/06/23/how-to-extract-a-ram-dump-from-a-running-virtualbox-machine/) - Plugins |name|default|how to use|description|reference| |:-|:-|:-|:-|:-| |malfind|〇| python vol.py -f zeus.vmem malfind -p 1724||| |[hollowfind](https://github.com/monnappa22/HollowFind)|-|python vol.py -f infected.vmem --profile=Win7SP0x86 hollowfind||| |yarascan|〇| python vol.py -f zeus.vmem yarascan --yara-file=/path/to/rules.yar||| |[malconfscan](https://github.com/JPCERTCC/MalConfScan)|-|python vol.py malconfscan -f images.mem --profile=Win7SP1x64|マルウェアのコンフィグ情報の抽出,cuckooと組み合わせることが可能|[wiki](https://github.com/JPCERTCC/MalConfScan/wiki)| |[malstrscan](https://github.com/JPCERTCC/MalConfScan)|-|python vol.py malstrscan -a -f images.mem --profile=Win7SP1x64||| - [Hexinator](https://hexinator.com/) - バイナリエディタ - 各種ファイルタイプの構造が定義されたgrammarと呼ばれるxmlファイルを用いて,開いたファイルの構造を認識し,ファイルヘッダやデータ内の各パラメータをバイナリエディタ上でカラーリングして表示 - パラメータの値の閲覧,編集も可能 - freeで多くのgrammerが用意されているが,ツール自体は試用期間のみ無料 - ファイルの破損部分を確認する際に有用 - バイナリの差分の確認も可能 ### Threat hunting - EQL ### .NET analysis - [dnspy](https://github.com/0xd4d/dnSpy)
.NETデコンパイラ,C#やVBで作成された実行ファイルを高精度でデコンパイルする ### Utilities - PeBear - PeStudio - ResourceHacker - PEiD - 010 Editor - Process Hacker - RegShot - RegistryChangesView - CyberChef - wql - wqlで子プロセスの検索 ``` $procs=Start-Process "programname.exe" -PassThru echo $procs.Id $queryNameVersion="SELECT * FROM Win32_Process WHERE ParentProcessId=" + $procs.Id $child_process=Get-WmiObject -Query $queryNameVersion echo $child_process ``` ### Online Sandbox |name|site|remarks| |:-|:-|:-| |AMAaaS|https://amaaas.com/|apk only| |ANYRUN|https://app.any.run/#register|| |Intezer Analyze|https://analyze.intezer.com/#/|| |IRIS-H|https://iris-h.services/pages/dashboard|maldoc only| |CAPE Sandbox|https://cape.contextis.com/|| |Joe Sandbox Cloud|https://www.joesandbox.com/|| |cuckoo|https://cuckoo.cert.ee/|| |cuckoo|https://sandbox.pikker.ee/|| |Hybrid Analysis|https://www.hybrid-analysis.com/?lang=ja|| |ViCheck|https://www.vicheck.ca/submitfile.php|| |Triage|https://tria.ge/|| |Yomi Sandbox|https://yomi.yoroi.company/upload|| |UnpacMe|https://www.unpac.me/#/|online unpacker,beta| ### Unpacker/Decryptor/Decoder/Extractor/Memory Scanner - [TAFOF-Unpacker](https://github.com/Tera0017/TAFOF-Unpacker)
攻撃者グループTA505が利用するマルウェア(GetandGoDll, Silence, TinyMet, Azorult, KBMiner, etc.)の静的アンパッカー
- [Trickbot artifact decrypter](https://github.com/snemes/malware-analysis/tree/master/trickbot)
Trickbotのartifactを取得するためのdecrypter
- [VolatilityBot](https://github.com/mkorman90/VolatilityBot)
マルウェアサンプルやメモリダンプの自動分析(コードインジェクションの抽出,プロセスダンプ,yaraスキャン,文字列の抽出)
- [Loki - Simple IOC Scanner](https://github.com/Neo23x0/Loki)
IoCスキャナー(パス・ファイル名の正規表現マッチ,ファイルとプロセスメモリのyaraスキャン,hashマッチ,c2 IoCスキャン,PE-Sieve)
- [flare-floss](https://github.com/fireeye/flare-floss)
FireEye Labsの静的解析分析技術を利用して,難読化された文字列を自動的に検知,抽出,デコード
- [PE-Sieve](https://github.com/hasherezade/pe-sieve)
Process Hollowing,Injectionされた特定のプロセスをダンプ
- [HollowsHunter](https://github.com/hasherezade/hollows_hunter)
PE-Sieveを使用してシステム全体をスキャン
- [strings2](http://split-code.com/strings2.html)
ファイルやプロセスメモリ内の文字列の抽出
- [mnemosyne](https://github.com/nccgroup/mnemosyne)
文字列,正規表現でプロセスメモリをスキャン
- **ref:**
- [Memory Scraping for Fun & Profit - Matt Lewis, NCC Group at CRESTCon & IIP Congress,youtube](https://www.youtube.com/watch?v=5HdYcE-woDc) - [Memhunter](https://github.com/marcosd4h/memhunter)
Injecition/Hollowingされたプロセスの自動検出
- **ref:**
- [Memhunter (Memory resident malware hunting at scale)](https://docs.google.com/presentation/d/1hgx2FTNIkry9Nt8LOJVz_rHNhcGfJChxZVGckv7VI8E/edit#slide=id.g5712e7065f_1_1)
- [Reflective DLL Injection Detection through Memhunte,youtube](https://www.youtube.com/watch?v=t_fR1sCENkc)
- [Process Hollowing Injection Detection through Memhunter,youtube](https://www.youtube.com/watch?v=QxCguP76uyg)
- メモリダンプが不要で,感染環境でメモリスキャンを行う - メモリスキャンのヒューリスティックトリガーにETWデータを利用している - ETWのSuspicious Eventsとして以下を定義 > - Process Creattion
> - Registry Operations
> - Threads Operations
> - Virtual Alloc Operations
> - Image Load Operations
> - Kernel Audit APIs usage
> - etc.
- [Bisonal Analysis Utils](https://www.nttsecurity.com/docs/librariesprovider3/resources/Japan/bisonal-utils) - Bisonalに含まれる文字列のデコード,通信の復号,yaraルール # Doc Analysis - VBA マクロの解析についての資料
[Advanced VBA Macros Attack&Defence,BHEU2019](https://www.decalage.info/files/eu-19-Lagadec-Advanced-VBA-Macros-Attack-And-Defence.pdf)
- [rtfobj](https://github.com/decalage2/oletools/wiki/rtfobj)
RTFファイルからOLEパッケージオブジェクトを検出し、埋め込みファイルを抽出
# C2 Analysis ### Emotet - [Emutet](https://github.com/d00rt/emotet_network_protocol)
Emotetのc2通信部分のエミュレータ
### Ursnif - Ursnif(version 2)のc2通信の仕組みと復号ツールについて
[Writing Malware Traffic Decrypters for ISFB/Ursnif](https://labs.sentinelone.com/writing-malware-traffic-decrypters-for-isfb-ursnif/) # Binary Analysis ### Unpacking - アンパックの流れ - OEPの特定し,OEPまで実行 - pushad命令,popad命令に着目。popad命令後のjmpでOEPに遷移する可能性がある(pushadした際のスタックのアドレスにハードウェアブレークポイントを設定することで監視) - 動的に生成された領域に着目(領域にアクセスし,実行されるかをメモリブレークポイントを設定することで監視) - WinMainCRTStarup,WinMainや関数のプロローグとの類似性からヒューリスティックに判断 - ツールを利用 - プロセスメモリのダンプ - 基本的にツールを用いる - IATの再構築(展開ルーチンのIAT再構築とは別) - IATは展開ルーチンでローダによってそのときの実際のAPIのアドレスに書き換えられているため,ロード前に戻す必要がある - PEヘッダはパックされたコードのIATを示しているので,新たににインポートセクションを追加し,そのセクションを認識するようにPEヘッダを修正する - 基本的にツールを用いる ### Symbolic Execurtion to do... ### Taint Analysis to do... ### Decompiler to do... ### Perspective - topdown - コードの先頭から解析 - bottom-up - 表層解析で得たキー情報(Win32API,怪しい文字列,etc.)の周辺から解析 ### ref: - Intel系アーキテクチャSoftware Developer向けのマニュアル
[Intel® 64 and IA-32 Architectures Software Developer Manuals](https://software.intel.com/en-us/articles/intel-sdm)
- PEファイルのフォーマットについて
[Inside Windows An In-Depth Look into the Win32 Portable Executable File Format, Part 1(2002)](http://bytepointer.com/resources/pietrek_in_depth_look_into_pe_format_pt1.htm)
[Peering Inside the PE: A Tour of the Win32 Portable Executable File Format(1994)](http://bytepointer.com/resources/pietrek_peering_inside_pe.htm)
- Windows APIに関するMSの公式ドキュメント [Windows API Index](https://docs.microsoft.com/en-us/windows/win32/apiindex/windows-api-list)