1
0
mirror of https://github.com/nganhkhoa/malware.git synced 2024-06-10 21:32:07 +07:00
mether049-malware/malware-analysis_ref_and_memo.md
2020-02-23 02:54:12 +09:00

17 KiB
Raw Blame History

Tools

OS/VM

  • FLARE VM
    FireEye社が提供するマルウェア解析, DFIR, ペネトレーションテストに特化したWindowsベースのディストリビューション
    Practical Malware Analysis Labsが同梱
  • REMnux
    SANSが提供するリバースエンジニアリングマルウェア解析に特化したUbuntuベースのディストリビューション
  • Tsurugi Linux
    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)
megabeets.net
Cutter: Presenting r2ghidra Decompiler,r2con 2019
Ghidra Reversing WannaCry Part 2 - Diving into the malware with #Ghidra,youtube
cheetsheet
x64/x32dbg Snowman
WinDbg
GDB
objdump
Snowman
name plugin price platform remarks
IDA pro Lighthouse
UEFI_RETool
Not free multi
Binary Ninja Lighthouse Not free
Cutter CutterDRcov
Jupyter Plugin for Cutter
x64dbgcutter
etc.
free multi
Ghidra pwndra
ghidra_scripts
OOAnalyzer
free multi
x64/x32dbg DbgChild free windows
WinDbg free windows Kernel mode debugging possible
GDB gdbpeda
pwngdb
free linux
objdump free linux
Snowman

Tracer

  • drltrace
    • DynamoRIO based
    • ライブラリトレーサ(Windows版ltrace)
  • drstrace
    • DynamoRIO based
    • システムコールトレーサ(Windows版strace)
  • memtrace
    • DynamoRIO based
    • メモリトレーサ
  • bbbuf
    • DynamoRIO based
    • べーシックブロックトレーサ
  • API Monitor
    • GUI(Windows)
    • APIコールを監視ツール

Instrumentation

  • drcov
    • DynamoRIO based
    • カバレッジ計測
    • drrun経由で実行
> drrun.exe -t drcov -- [program name] [arguments]
  • Intel PIN

Traffic Analysis tools

Forensic

  • Sysinternals
  • Volatility
    • 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:
    • 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
      
    • Plugins
name default how to use description reference
malfind python vol.py -f zeus.vmem malfind -p 1724
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 - python vol.py malconfscan -f images.mem --profile=Win7SP1x64 マルウェアのコンフィグ情報の抽出cuckooと組み合わせることが可能 wiki
malstrscan - python vol.py malstrscan -a -f images.mem --profile=Win7SP1x64
  • Hexinator
    • バイナリエディタ
    • 各種ファイルタイプの構造が定義されたgrammarと呼ばれるxmlファイルを用いて開いたファイルの構造を認識しファイルヘッダやデータ内の各パラメータをバイナリエディタ上でカラーリングして表示
    • パラメータの値の閲覧,編集も可能
    • freeで多くのgrammerが用意されているがツール自体は試用期間のみ無料
    • ファイルの破損部分を確認する際に有用
    • バイナリの差分の確認も可能

Threat hunting

  • EQL

.NET analysis

  • dnspy
    .NETデコンパイラ,C#やVBで作成された実行ファイルを高精度でデコンパイルする

Utilities

  • PeBear
  • PeStudio
  • ResourceHacker
  • PEiD
  • 010 Editor
  • Process Hacker
    • Mutexの確認が可能
  • 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

  • Process Creattion
  • Registry Operations
  • Threads Operations
  • Virtual Alloc Operations
  • Image Load Operations
  • Kernel Audit APIs usage
  • etc.

Doc Analysis

C2 Analysis

Emotet

  • Emutet
    Emotetのc2通信部分のエミュレータ

Ursnif

Binary Analysis

Unpacking

  • アンパックの流れ
    • OEPの特定し,OEPまで実行
      • pushad命令popad命令に着目。popad命令後のjmpでOEPに遷移する可能性がある(pushadした際のスタックのアドレスにハードウェアブレークポイントを設定することで監視)
      • 動的に生成された領域に着目(領域にアクセスし,実行されるかをメモリブレークポイントを設定することで監視)
      • WinMainCRTStartupWinMainとの類似性からヒューリスティックに判断
      • ツールを利用
    • プロセスメモリのダンプ
      • 基本的にツールを用いる
    • IATの再構築(展開ルーチンのIAT再構築とは別)
      • IATは展開ルーチンでローダによってそのときの実際のAPIのアドレスに書き換えられているためロード前に戻す必要がある
      • PEヘッダはパックされたコードのIATを示しているので新たににインポートセクションを追加しそのセクションを認識するようにPEヘッダを修正する
      • 基本的にツールを用いる

Microsoft Windows Library

  • NTDLL.DLL
    • Windows Native APIを提供
    • Native APIはKERNEL32.DLLによってエクスポートされるKernel APIやbase APIの多くで使用されている
    • Windows applicationから直接的に呼ばれることはほとんどない
    • 公式ではドキュメント化されていないが,こちらからある程度確認可能
  • KERNEL32.DLL
    • メモリ操作入出力プロセスやスレッド管理同期処理を行うWin32 base APIを提供する
  • USER32.DLL
    • GUIなどユーザインターフェース関連のAPIを提供
  • MSVCRT.DLL

Symbolic Execurtion

to do...

Taint Analysis

to do...

Decompiler

to do...

Perspective

  • topdown
    • コードの先頭から解析
  • bottom-up
    • 表層解析で得たキー情報(Win32API,怪しい文字列etc.)の周辺から解析

ref: