0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Flag in Flame (Writeup)

0
Posted at

【picoCTF】[Flag in Flame] Writeup

問題概要

  • Category: Forensics

Description:

The SOC team discovered a suspiciously large log file after a recent breach. When they opened it, they found an enormous block of encoded text instead of typical logs. Could there be something hidden within? Your mission is to inspect the resulting file and reveal the real purpose of it. The team is relying on your skills to uncover any concealed information within this unusual log.
Download the encoded data here: Logs Data. Be prepared—the file is large, and examining it thoroughly is crucial .

日本語訳:

SOCチームは、最近の侵害事件を受けて、不審なほど巨大なログファイルを発見しました。ファイルを開いてみると、通常のログではなく、膨大な量の暗号化されたテキストが並んでいました。その中に何かが隠されているのでしょうか?あなたの任務は、このファイルを調査し、その真の目的を解明することです。チームは、この異例のログに隠された情報を暴くために、あなたのスキルを頼りにしています。
暗号化されたデータはこちらからダウンロードしてください:Logs Data。
ファイルは容量が大きいため、入念に調査することが不可欠です。


解法のプロセス(アプローチ)

1. ファイルの確認とBase64デコード

まずはダウンロードしたファイル(logs.txt)の中身を見てみます。
image.png

大文字・小文字のアルファベットと数字が規則性なく並んでいる文字の傾向から、Base64でエンコードされたデータであると推測できます。
まずはターミナルでBase64としてデコード(復号)し、別のファイルに書き出してみましょう。

base64 -d logs.txt > logs_base64.txt

2. ファイルの種類の特定(fileコマンド)

logs.txt をBase64でデコードし、logs_base64.txt というファイルに保存しました。
しかし、このままでは元々どんな種類のファイルだったのか(テキストなのか、画像なのか、実行ファイルなのか)が分かりません。

そこで、Linuxの file コマンドを使ってファイルの種類を特定します。

file logs_base64.txt

実行結果:

logs_base64.txt: PNG image data, 896 x 1152, 8-bit/color RGB, non-interlaced

出力結果から、このファイルはテキストではなく PNG画像 であることが判明しました!

3. 画像内の文字列の解析とフラグの獲得

ファイルがPNG画像だとわかったので、ファイルの拡張子を .png に変更して(またはそのまま画像ビューアで)開いてみます。

a.png

画像の下部に、怪しげな文字列が書かれているのを発見しました。

7069636F4354467B666F72656E736963735F616E616C797369735F69735F616D617A696E675F61633165333538347D

数字(0-9)と大文字のアルファベット(A-F)のみで構成されていることから、これは 16進数(Hex) だと推測できます。

この文字列をコピーし、CyberChef に貼り付けて 「From Hex」 レシピでデコードしてみます。

image.png

無事に意味のある文字列として復元され、フラグが見つかりました!

Flag:
picoCTF{forensics_analysis_is_amazing_ac1e3584}


お疲れさまでした!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?