Day 2 — 數位鑑識 (Digital Forensics)

重點整理

主題核心概念重要工具/技術備註
數位鑑識辨識未知檔案格式、提取隱藏資訊、檢視 metadata、分析網路封包 (.pcap)file, strings, grep, Wireshark, binwalk, exiftool起手式三連擊:file → strings → grep

起手式流程

1. file mystery          → 確認真實格式(不信副檔名)
2. strings mystery       → 抽取所有明文字串
3. strings mystery | grep "FLAG{"   → 過濾出 Flag

# 圖片 metadata
exiftool image.jpg

# 檔案內嵌偵測與提取
binwalk -e suspicious.jpg

# 封包分析
wireshark traffic.pcap  → Filter: http → Follow TCP Stream

工具對照表

工具用途
file辨識真實檔案格式(Magic Bytes)
strings抽取二進位檔中的明文字串
grep過濾關鍵字
binwalk偵測並提取內嵌在檔案中的隱藏檔
exiftool讀取圖片/檔案的 metadata
Wireshark開啟 .pcap,分析 HTTP/TCP 流量

學習建議

  • 練習平台:picoCTF Forensics 題區、Wireshark Learn
  • 產出:寫下「拿到未知檔案的起手三連擊筆記」

模擬比賽題目

一、選擇題(單選)

1. 拿到無副檔名的 mystery 檔案,第一步?

  • A) strings
  • B) file
  • C) cat
  • D) grep

2. 從二進位檔快速抽取所有明文字串?

  • A) xxd
  • B) base64
  • C) strings
  • D) find

3. 開啟 .pcap 檔案追蹤 TCP/HTTP 流量最常用的工具?

  • A) Burp Suite
  • B) Wireshark ✅
  • C) CyberChef
  • D) Ghidra

4. 懷疑圖片內嵌壓縮檔,最適合的工具?

  • A) binwalk
  • B) exiftool
  • C) nc
  • D) curl

5. strings data.bin | grep FLAG{ 中,grep FLAG{ 的作用?

  • A) 將字串加密成 FLAG 格式
  • B) 存入名為 FLAG 的資料夾
  • C) 過濾只印出包含 FLAG{ 的行 ✅
  • D) 刪除包含 FLAG 的內容

二、CTF 實作題

Challenge 1:偽裝的圖片 (Magic Bytes)

clue.jpg 圖片檢視器無法開啟。用起手式指令確認真實格式,讀取即得 Flag。

file clue.jpg
strings clue.jpg | grep FLAG

Flag 格式FLAG{file_command_is_magic}


Challenge 2:大海撈針 (String Extraction)

50MB 的 memory.dump,用兩個基礎指令找出 Flag。

strings memory.dump | grep "FLAG{"

Flag 格式FLAG{grep_is_your_best_friend}


Challenge 3:網路的竊聽者 (Packet Analysis)

開啟 traffic.pcapng,過濾 HTTP,追蹤可疑 POST 請求的 TCP Stream,Flag 在表單參數中。

Wireshark Filter: http.request.method == "POST"
右鍵 → Follow → TCP Stream

Flag 格式FLAG{wireshark_http_stream_catch}

Built with LogoFlowershow