Challenge: head-dump
Category:
Web Exploitation
Difficulty:
Easy
Description:
Welcome to the challenge! In this challenge, you will explore a web application and find an endpoint that exposes a file containing a hidden flag.
The application is a simple blog website where you can read articles about various topics, including an article about API Documentation. Your goal is to explore the application and find the endpoint that generates files holding the server’s memory, where a secret flag is hidden.
解題思路整理
Step 1: 分析題目內容
從描述中提到:
The application is a simple blog website… Your goal is to find the endpoint that generates files holding the server’s memory, where a secret flag is hidden.
endpoint
:API 的端點,代表可能存在可互動的資料輸出功能。
generates files holding the server’s memory
:表示可能會有記憶體快照(heap dump)這類的檔案產生。
flag is hidden
:flag 會藏在這些檔案內,不會直接在頁面上顯示。
結論:
我們應該找尋網站中與
API 文件
或
系統診斷 / 偵錯工具
相關的頁面或功能。
Step 2: 探索網站
進入提供的網站後,會發現是一個部落格介面。在其中一篇文章中發現了「API Documentation」的連結,我們點擊進去。
點擊進去的畫面會是這樣
Step 3: 使用診斷工具產生記憶體快照
在 API 文件頁中,我們找到一個名為
Diagnosing the memory allocation
的功能。
點擊
「執行」
後,網站會生成一個檔案供下載。
📸 範例畫面:
下載後會得到一個名為:
heapdump-1753261619373.heapsnapshot
的檔案。
Step 4: 解析 heap dump 檔案找 flag
方法一:使用 Linux
strings
+
grep
指令
這類
.heapsnapshot
檔案為二進位格式,但裡面可能含有可讀文字,我們可以用
strings
指令提取可見字串,再搭配
grep
過濾出含有
picoCTF
的行:
1 | 1 |
1 | strings heapdump-1753261619373.heapsnapshot | grep picoCTF |
方法二:使用文字編輯器直接搜尋
在圖形化介面下,也可以使用文字編輯器打開檔案(例如 VS Code / Sublime / Notepad++),然後按下:
Ctrl + F
搜尋關鍵字 picoCTF,即可快速找到 flag!
🎯 Flag
🟢
成功取得 Flag!
picoCTF{Pat!3nt_15_Th3_K3y_f1179e46}
🎉
恭喜你完成這題!繼續加油解鎖更多挑戰吧 💪