ã¡ã¢ãªãã³ãã«ã¤ãã¦ã®ã¾ã¨ã
ãã®ã¨ã³ããªã§ç´¹ä»ããã³ãã³ãã®ä¸é¨ã¯é«ç¢ºçã§OSãã¯ã©ãã·ã¥ãã¾ãï¼è¡ãéã¯èªå·±è²¬ä»»ã§ãé¡ããã¾ãï¼
ãã«ã¦ã§ã¢è§£æã«ä½¿ãããã¡ã¢ãªãã³ãã¯ã©ã®ããã«ä½æãããã®ãã調ã¹ãã¡ã¢ãæ¸ãæ®ãï¼
çµè«ã¨ãã¦ï¼Windowsã¯ããæ¹ãå¤ã(è¨å®ãããã£ã¦ããOSãã¯ã©ãã·ã¥ãããï¼ãã¼ãã¼ããã¹ã¤ããããå²ãè¾¼ã¿ããããï¼ãã¼ã«ã使ã)ï¼Linuxã¯grub(RHELã®ã¿)ã®è¨å®ããããï¼ãã¼ã«ã使ããã¨ã§åå¾ã§ããï¼macã«ã¤ãã¦ã¯ã»ã¨ãã©èª¿ã¹ã¦ããªããï¼ä¸é¨ãã¼ã«ã¯å¯¾å¿ãã¦ããï¼ãããã®æ¹æ³ã§ãOSãã¯ã©ãã·ã¥ããæã¨åçã®å½±é¿ãããï¼
注æç¹ã¨ãã¦ã¯ã¡ã¢ãªãã³ããã¼ã«ã¨ãã¦å
¬éããã¦ããããã°ã©ã ã®ä¸é¨ã«ç¾å¨ã¯ä½¿ããªããããªãã®ããã£ãï¼èª¿ã¹ãã ãã§ããæ°ãå°½ããã®ã§ï¼å
·ä½çãªä½¿ãæ¹ã¾ã§ã¯ç¶²ç¾
ã§ãã¦ããªãï¼
çå
ãè¿å¹´ã®ãã«ã¦ã§ã¢ã¯ç©çã¡ã¢ãªã«ã®ã¿åå¨ãï¼é»æºãåããã¨ä¸ç·ã«æ¬ä½ãæ¶ãã¦ãã¾ãã¿ã¤ããããï¼é«åº¦ãªãã®ã«ãªãã¨ï¼ããã«å ãã¦èªèº«ãunlink
ãï¼ããã»ã¹ä¸è¦§ããé ããå ´åãããã¨èãããã¨ããã(å°éã§ã¯ãªãããï¼è©³ããã¯ããããªã)ï¼
ãã®å ´åï¼è§£æã«ã¯ææããPCããããã¯ã¼ã¯ããéé¢ããå¾ããã«é»æºãåããã«ç©çã¡ã¢ãªã®å
¨å
容ããã³ãããå¿
è¦ãããï¼
ããã«ã¤ãã¦ï¼ä»¥ä¸ã®ç¹ãçåã«æãï¼èª¿ã¹ã¦ã¿ããã¨ã«ããï¼
- ä¸ä½ã©ããã£ã¦ãã³ããåå¾ããã®ãï¼
- OSãã¯ã©ãã·ã¥ããæã«ãã³ã(Linuxã§ã¯ã³ã¢ãã¡ã¤ã«)ãä½æããããï¼æ®æ®µä»äºãã¦ããOSãåããªãã®ã«ï¼èª°ããã³ããä½æãã¦ããã®ãï¼
ã¡ã¢ãªãã³ãã«ã¤ãã¦
種é¡
- æå°ã¡ã¢ãªãã³ã
ãæéè¦ãªæ å ±ã®ã¿ä¿å(Stopã¡ãã»ã¼ã¸ã»ãã©ã¡ã¼ã¿ï¼åæ¢ããã¹ã¬ããã®ã«ã¼ãã«ã¢ã¼ãå¼ã³åºãã®å±¥æ´ãªã©)ï¼é害çºçæã«å®è¡ããã¦ããã¹ã¬ãããç´æ¥ã®åå ã§ãªãã¨ã©ã¼ã¯çºè¦ã§ããªããã¨ãããï¼ - ã«ã¼ãã«ã¡ã¢ãªãã³ã
ãã«ã¼ãã«ã¡ã¢ãªã®ã¿ã®è¨é²ï¼ã¦ã¼ã¶ããã»ã¹ã®æ å ±ã¯è¨é²ããªãããï¼ã«ã¼ãã«ã§é害ãèµ·ãã£ã¦ããªãæã¯åå ã究æã§ããªãï¼ - å®å
¨ã¡ã¢ãªãã³ã
ãã·ã¹ãã ã¡ã¢ãªã®å ¨å 容ãè¨é²ï¼ã¡ã¢ãªãã³ããåããªãï¼ãããæ¨å¥¨ããã¦ããï¼å½ç¶ãªããï¼ã¡ã¢ãªãµã¤ãºä»¥ä¸ã®å¤§ãã(ã¡ã¢ãªãµã¤ãº+å種æ å ±)ã«ãªãããï¼ã¹ãã¬ã¼ã¸ã®ç©ºãã«æ³¨æï¼
ä»åã¯å®å ¨ã¡ã¢ãªãã³ãã®åå¾ã«çç®ããï¼
ãã©ã¼ããã
ã¡ã¢ãªãã³ãã®ãã©ã¼ãããã¯ä»¥ä¸ã®éãï¼æããä»ã«ããããï¼ããã§ã¯è§£æãã¼ã«volatility
ã§ãµãã¼ããã¦ãããã®ãæããï¼
- 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 (Linux Memory Extractor) format
- Mach-O file format
- QEMU virtual machine dumps
- Firewire
- HPAK (FDPro)
Windows
詳ãããµã¤ããå¤æ°ããããï¼ããã§ã¯ç°¡åã«æ¸ãï¼è©³ãããã¨ã¯åèãµã¤ãã確èªãããã¨ï¼
ã©ã®æ¹æ³ã§ããã«ã¼ã¹ã¯ãªã¼ã³ãçºçããããï¼å®é¨ããã¨ãã¯éè¦ãªãã¼ã¿ã®ã»ã¼ãã¯å¿
è¦ï¼
Windows(7ãæ³å®)
- åºæ¬çãªæ¹æ³
ã»OSã¯ã©ãã·ã¥æã«ä½æãããããã«ãã
ã»æåã«ããä½æ
ã> NMIã«ããä½æ(ãã¼ãã¼ããªã©ãå ¨ã使ããªãæã®æçµæ段)
ã> ãã¼ãã¼ãã«ããä½æ
詳ããã¯åèãµã¤ããèªãã¨ãããï¼åºæ¬çãªæ¹æ³ãç°¡åã«æ¸ãæ®ãã¦ããï¼
1ï¼ ã¹ã¿ã¼ããã¯ãªãã¯
2ï¼ ãã³ã³ãã¥ã¼ã¿ãã§å³ã¯ãªãã¯ã, ãããããã£ããé¸æ
3ï¼ ãã·ã¹ãã ã®ããããã£ãã¦ã£ã³ãã¦ã®è©³ç´°è¨å®ã¿ãã®ä¸çªä¸ã®ãèµ·åã¨å復ãé
ç®ã®ãè¨å®ããã¯ãªãã¯
4ï¼ ãèµ·åã¨å復ãã¦ã£ã³ãã¦ã®ããããã°æ
å ±ã®æ¸ãè¾¼ã¿ãã§ãããããã¦ã³ã¡ãã¥ã¼ãããå®å
¨ã¡ã¢ãªãã³ãããé¸æãï¼OKãã¯ãªãã¯
5ï¼ åèµ·å
ä¿åå
ã¯ããããã°æ
å ±ã®æ¸ãè¾¼ã¿ãã«ããããã³ããã¡ã¤ã«ãã§æå®ãããã¨ãã§ããï¼ããã©ã«ãã¯%SystemRoot%MEMORY.DMP
ã«ä¿åãããï¼
詳ããã¯
技術/Windows/メモリダンプ取得方法メモ - Glamenv-Septzen.net
https://blogs.technet.microsoft.com/askcorejp/2014/08/10/339/
ãåç
§ï¼
åè
ã¯XPãªã©ã«ã使ããæ¹æ³ãæ¸ãã¦ããï¼å¾è
ã®Microsoftãµãã¼ãã¯2014å¹´ã®è¨äºã§ããããï¼Windows8.1(2013)ã¾ã§æå¹ã ã¨æãï¼ã©ã¡ããå¤ãã®ããæ¹ãæ¸ãã¦ããï¼
æåã«ãè¿°ã¹ããï¼ã©ã¡ãã«ãããã«ã¼ã¹ã¯ãªã¼ã³ã«ãªããã¨ã¯ç¢ºå®ãªã®ã§ï¼ãã¼ã¿ã®ä¿åã¯éè¦ï¼
Linux
å®è£
ã§/dev/mem
, /dev/kmem
ããèªã¿ã ãã¦ããããã°ã©ã ã¯ã«ã¼ãã«ã®2.6ç³»ã¾ã§ã§ããåä½ãä¿è¨¼ããã¦ããªãï¼ãã以éã¯/dev/(k)mem
ã§ã¢ã¯ã»ã¹ã§ããã¢ãã¬ã¹ãå¶éããã¦ããï¼
2.6ç³»ã¨ããåºåãã§åä½ãä¿è¨¼ããã¦ããã®ã¯ï¼2003å¹´ã«2.6ãã3.0ã¸ã«ã¼ãã«ã®ã¡ã¸ã£ã¼ãã¼ã¸ã§ã³ã¢ããããã£ãããã®ããã ï¼
ãSecurity/Features - Ubuntu Wikiãã«ã¯ï¼Ubuntuã®ç¹è²ãæ¸ãã¦ããï¼ããã«/dev/mem protection
ã¨ããé
ç®ãããï¼
ç¾å¨ã®Ubuntuã§ã¯/dev/(k)mem
ããã®å®å
¨ã¡ã¢ãªãã³ãåå¾ã¯æãç¡ãããã ï¼
ãã®æ©æ§ãé©ç¨ãããã®ã¯Blackhat2009ã®çºè¡¨(https://www.blackhat.com/presentations/bh-europe-09/Lineberry/BlackHat-Europe-2009-Lineberry-code-injection-via-dev-mem.pdf)ã«ããããã«ï¼ç©çã¡ã¢ãªã«ã¢ã¯ã»ã¹ã§ãããªãæ¸ãæããã§ããããªã£ã¦ãã¨ã®ããã ï¼
/dev/(k)mem
ã使ã£ã¦ãããã¼ã«ç¾¤(ãå©ç¨ã¯è¨ç»çã«ã»ã»ã»)
å®é¨ããç°å¢ã¯4.5ç³»ã ãï¼ä½¿ããã³ã«OSãã¯ã©ãã·ã¥ããï¼ããã¤ãã®ååããã£ã¨å¿ããªãï¼
$ uname -r 4.5.0-1-ARCH
memdump
source: memdump 1.01-6, memdump_8c-source.html
$ sudo pacman -S memdump
ã§ã¤ã³ã¹ãã¼ã«ã§ãããã¤ï¼
$ sudo memdump-kernel > test.dmp
ã§ã¡ã¢ãªãã³ããä½æã§ããï¼
ããç¨åº¦ãã³ãã§ããã¨ããã§ã¯ã©ãã·ã¥ããï¼OSã®å®è¡ãã¦ããã³ã¼ãé¨ã®ã³ãã¼ã§ç«¶åããªãããèµ·ãã¦ããã®ããªã»ã»ã»
draugr
Google Code Archive - Long-term storage for Google Code Project Hosting.
pythonã§å®è£
ããã¦ããï¼ä»¥ä¸ï¼
使ããããªãã¤
/proc/kcore
ããæ
å ±ãåå¾ãããï¼ã«ã¼ãã«ã®æ©è½ã使ãã¿ã¤ãã主æµã«ãªã£ã¦ããããã ï¼/proc/kcore
ã«ã¯ã¡ã¢ãªæ
å ±ãELFå½¢å¼ã§ä¿åããã¦ããï¼64bitOSã®å ´åï¼ããã®ãµã¤ãºã
$ ls -hl /proc/kcore -r-------- 1 root root 128T Apr 22 23:11 /proc/kcore
ã¨é常ã«å¤§ããï¼ããã¯64bitã§åãæ±ããæ大ãµã¤ãºãæãã¦ãããããï¼ããããã©ããã£ã¦åå¾ããã®ããã¾ã ããã£ã¨ãã¦ããï¼æ
å ±åéä¸ï¼
以ä¸ã®ãã¼ã«ç¾¤ã¯èª¿ã¹ãã ãã§ããæ°ãå°½ãã¦ï¼å®éã«è©¦ãã¦ããªãããï¼åããã¥ã¡ã³ããããèªãã§æ¬²ããï¼
LiME(Linux Memory Extractor)
https://github.com/504ensicsLabs/LiME
volatility
ã§æ¨å¥¨ããã¦ããã¡ã¢ãªãã³ãä½æãã¼ã«ï¼
Linuxã®ã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ã¨ãã¦å®è£
ããã¦ããï¼
ãããã¯ã¼ã¯è¶ãã«ãã³ããä½æãããã¨ãå¯è½ãªããã ï¼åããã¹ãä¸ã§ãã³ããä½æããã¨ãã¯localhost
ã¨ããã ãï¼
Pmem
Rekall Memory Forensic Framework
ãã³ã解æãã¼ã«rekall
ãæä¾ããã¡ã¢ãªãã³ããã¼ã«ï¼Linux, Windows, Macãã¹ã¦ã§ä½¿ããã§ããåè
ï¼
ã¢ã¸ã¥ã¼ã«ã¨ãã¦ãã¼ããããã¨ã§ä½¿ããããã ï¼
Grub(RedHatç³»ã®ã¿)
grub.conf
ã«
crashkernel=auto
ãæ¸ãã¨è¯ããããï¼
kcore
, crach
, yum install kexec-tools
ã§æ¤ç´¢ï¼
ãã®ä»
memfetch
[lcamtuf.coredump.cx]
/proc/<pid>/maps
ããæ
å ±ãåå¾ãã¦ããï¼ã¡ã¢ãªå
¨ä½ã¨ããããã¯ããã»ã¹ãã¨ã®ã¡ã¢ãªãåå¾ã§ããï¼
GDBãªãï¼
$ gdb (gdb) attach <pid> (gdb) gcore <output>.dmp (gdb) detach (gdb) quit
ã§åããããªãã¨ãã§ãããï¼gdbã³ãã³ãã§å¾ãããã®ã¯ã³ã¢ãã¡ã¤ã«ã§ELFå½¢å¼ï¼
ä»®æ³ãã·ã³
Qemu, Xenï¼VMwareï¼Virtualboxãªã©ï¼ä»®æ³ãã·ã³ä¸ãªãå®å ¨ãªã¡ã¢ãªãã³ããåå¾ãããã¨ãã§ãããã楽ã£ã¦ã©ã£ãã«æ¸ãã¦ãã£ãï¼
ã¡ã¢ãªãã³ã解æãã¼ã«
ç¾å¨ç°¡åã«ä½¿ããããªãã¼ã«ã¯ä»¥ä¸ã®éãï¼
volatility
The Volatility Foundation - Open Source Memory Forensics
Blackhat2007ã§çºè¡¨ããããã¼ã«ï¼ãã³ã解æã§ä¸è½ããï¼
å
¬å¼ãµã¤ãã«ã¯æããã使ããã¦ãããã¼ã«ã¨æ¸ãã¦ããï¼æ¬å½ãã©ããã¯ç¥ããªãï¼ãããå
¥ãã¦ããã°å°ããã¨ã¯ãªãããã ï¼
ã¡ã¢ãªãã³ãåå¾æ©è½æä¾ãã¦ããªãããï¼LiME
ã使ã£ã¦ããã¨å
¬å¼ã®ããã¥ã¡ã³ãã«æ¸ãã¦ããï¼ãããï¼ã½ã¼ã¹ã®ä¸ã«getkcore.c
ã¨ãããããã°ã©ã ããã£ããããï¼ããã¯/dev/kcore
ããèªã¿åºãåç´ãªããã°ã©ã ãªã®ã§ï¼åãããï¼æä¾ãã¦ãããããªããã¨ããããã³ãã¯ç½®ãã¦ããï¼
rakall
Rekall Memory Forensic Framework
åè¿°ã®volatility
ããç¬ç«ããããã¸ã§ã¯ãï¼
ããã¯ã¡ã¢ãªãã³ãåå¾æ©è½ãæä¾ãã¦ããï¼Pmemã¯ããã¤ãæä¾ããæ©è½ã®ä¸ã¤ï¼
ç¹å¾´ã¯ã¡ã¢ãªãã³ãã«é¢ãããã¨ãå
¨ã¦è¡ãããã¨ï¼
ãã©ã°ã¤ã³ã§æ©è½æ¡å¼µã容æã«è¡ããæè»ä»æ§ã ãï¼ããæ
ãã©ã°ã¤ã³ãå¤ãããã®ãæ©ã¿ãããï¼
å½ç¶ãªããï¼ã½ã¼ã¹ã³ã¼ãã¯volatility
ã¨ãã¶ã£ã¦ããç®æãå¤ãï¼
çµããã«
æ§ã
ãªããã°ã©ã ãä¹±ç«ãã¦ãã¦ï¼æ··æ²ã¨ãã¦ãããã¨ãããã£ãï¼
ãã³ããä½æãã¦ããã®ã¯ï¼ã«ã¼ãã«ã£ã½ãï¼
ã¡ã¢ãªãã³ãé¢ä¿ã®ããã°ã©ã ãçµãã¨ãã«ã¯ã«ã¼ãã«ã«ã¤ãã¦èª¿æ»ããã°ããã¡ããä½ãåºã¦ãããï¼ããæ°ãåºããå®éã«ãã³ããä½æãã¦ï¼è§£æã¾ã§ãã£ã¦ã¿ããï¼Pmem
ã§ãã³ãåå¾ãã¦ï¼volatility
ã§è§£æãªãã¦ã²ããããã®ãä¸èãï¼
/proc/kcore
ã®ä½¿ãæ¹ãï¼å®è£
ã®ãã£ã¨æ·±ãã¨ããã§ã®åå¾æ¹æ³ã«ã¤ãã¦ã¯ã¾ã 調ã¹å°½ããã¦ããªãï¼ãã®çåã解æ¶ããæ¥ãæ¥ãããããæ°ãåºãã¾ã§å¿ããªãããã«ãããï¼
rekall
ã®tools/linux/lmap/log
ãtools/osx/MacPmem/Common/logging.cpp
ã«ã¯ã¨ã©ã¼ã¬ãã«ã«ãããã°ã®åºåãå®è£
ããã¦ããï¼èãããã¨ã¯ãã£ããï¼å®éã«è¦ãã®ã¯åãã¦ã§æåããï¼ä»å¾ã®å®è£
ã§ä½¿ã£ã¦ã¿ããï¼
åèãµã¤ã
/dev/kcoreã大ããããçç±: /proc/kcore is 131072.0 GB / Newbie Corner / Arch Linux Forums
Linuxã¡ã¢ãªãã³ãä½æ: Linuxでのメモリダンプの取得 - higefoxの公開メモ
ã¡ã¢ãªãã³ãã®ç¨®é¡ï¼åå¾ã»å§ç¸®: 完全メモリダンプを設定する方法
MSã«ããã¡ã¢ãªãã³ãã®ä½ææå¼:メモリ ダンプ ファイルを生成する方法について | Ask CORE
ãã³ãåå¾ãã¼ã«ä¸è¦§: Top 8 Tools For Linux / Unix Memory Forensics Analysis