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?

Redaction gone wrong picoCTF (Writeup)

0
Posted at

【picoCTF】[Redaction gone wrong] Writeup

問題概要

  • Category: Forensics

Description:

Now you DON’T see me.
This report has some critical data in it, some of which have been redacted correctly, while some were not. Can you find an important key that was not redacted properly?

日本語訳:

今は私が見えませんね。このレポートには重要なデータが含まれており、適切に墨消しされているものもあれば、そうでないものもあります。適切に墨消しされなかった重要なキーを見つけることができますか?


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

1. ファイルの確認と初期調査

まずは配布されたPDFファイル(Financial_Report_for_ABC_Labs.pdf)の構造やメタデータを確認します。exiftoolコマンドを使用して情報を覗いてみます。

exiftool Financial_Report_for_ABC_Labs.pdf

出力結果の中に Profile Date Time : 1998:02:09 06:49:00 や「RGB」といったカラープロファイルに関する情報が含まれており、一見すると高度なステガノグラフィのようにも思えます。また、ファイルの更新日時は以下のようになっていました。

Modify Date                     : 2021:07:17 21:44:49+02:00

確かに編集された形跡があります。
次に、定番のバイナリ内文字列検索として grep コマンドを試します。

grep -a "picoCTF{" Financial_Report_for_ABC_Labs.pdf

しかし、結果は何も出力されませんでした。これはPDF内部のテキストデータが、ファイルサイズ削減のためにFlateDecode(Zlibアルゴリズム)などで圧縮されて保持されているため、生のバイナリデータに対して平文検索をかけてもヒットしないためです。

2. 不完全な墨消し(Fake Redaction)の看破

ここで問題のタイトル「Redaction gone wrong(失敗した墨消し)」に立ち返ります。
PDFにおける専用の墨消し機能を使わず、単に「テキストの上に黒い四角形の図形を被せただけ」という、不完全な墨消しの可能性を疑います。
この場合、PDFの構造上は元のテキストデータがそのまま残っているため、GUIのPDFビューア上で直接テキストを選択してコピーする物理的な力技が有効に働きます。

3. テキストの抽出とフラグの獲得

PDFファイルをブラウザや適当なPDFビューアで開きます。
画面上のテキストをすべて選択し(Ctrl + A)、コピー(Ctrl + C)して、メモ帳やテキストエディタに貼り付けます(Ctrl + V)。


抽出されたテキスト:

```text
Financial Report for ABC Labs, Kigali, Rwanda for the year 2021.  
Breakdown - Just painted over in MS word.  
Cost Benefit Analysis 
Credit Debit 
This is not the flag, keep looking 
Expenses from the    
picoCTF{C4n_Y0u_S33_m3_fully} 
Redacted document.  

黒塗りの下に隠されていたテキストが抽出されました。抽出テキスト内にある「Just painted over in MS word.(Wordで上から黒塗りしただけ)」という出題者からの種明かしと共に、フラグが確認できました。

Flag:
picoCTF{C4n_Y0u_S33_m3_fully}


お疲れさまでした!

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?