1
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?

More than 1 year has passed since last update.

[picoCTF] Operation Orchid Write Up

Posted at

picoCTF Forensics Operation Orchid

400点問題が解けてうれしかったので書きます。

復元

disk imageファイルが配られるので復元してみます。

gzip -d disk.flag.img.gz

Autopsyでデータの閲覧

autopsyで見てみると、File TypesにPlain textがありました。
怪しいので見てみるとflag.txtが!

しかし、vol_vol4/root/flag.txtは削除されています。
加えて、searchでpicoやCTFで調べたり、バイナリファイルを見てみてもそれらしいものはなかったので別の方法を試します。

image.png

binwalkで抽出

binwalk -e disk.flag.img

先ほどのrootが怪しいので、ディレクトリを見てみます。

cd _disk.flag.img.extracted/ext-root-0/root
ls -la
結果
flat.txt.enc
.ash_history

なにやら暗号化されたtxt.encがありました。おそらくこのファイルがフラグでしょう。
また、隠しファイルで.ash_historyがあります。

.ash_historyをcatして中身を見ます。

ash_history
touch flag.txt
nano flag.txt
apk get nano
apk --help
apk add nano
nano flag.txt
openssl
openssl aes256 -salt -in flag.txt -out flag.txt.enc -k unbreakablepassword1234567
shred -u flag.txt
ls -al

どのアルゴリズムで、どのキーで暗号化されているかがわかりました。

復号

どうやらこのファイルのようですね。
opensslで復号します。こちらの記事が参考になりました。

openssl aes256 -e -in flag.txt.enc -out output.txt -pass pass:unbreakablepassword1234567

*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
bad decrypt
4047394FD17F0000:error:1C800064:Provider routines:ossl_cipher_unpadblock:bad decrypt:../providers/implementations/ciphers/ciphercommon_block.c:124:

WARNINGが出ていますがいったん無視で

cat output.txt

picoCTF{h4un71ng_p457_0a710765}

フラグが取得できました!!

1
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
1
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?