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?

[picoCTF] ping-cmdの解法(Writeup)

0
Posted at

1. はじめに

  • picoCTFの「ping-cmd」を解いた際の備忘録です。
  • CTF初心者の方や、プログラムの指示をどう読み解くか迷っている方の参考になれば幸いです。

2. 問題の概要

  • ジャンル: General Skills
  • 難易度: EASY
  • 説明:
    Can you conjure the right bytes? The program's source code can be downloaded here.
    Additional details will be available after launching your challenge instance.
    サーバーに秘密を明かさせることはできますか?Google DNSにpingを送信できるようですが、入力内容を少し工夫したらどうなるでしょうか?
    チャレンジインスタンスを起動すると、詳細情報が表示されます。
  • 概要: ダウンロード可能な app.py が配布されており、そこから正しい入力を推測する問題です

3. 解法のプロセス

① ソースコードの確認

配布された app.py を開き、中身を確認します。

# app.py の重要そうな部分(抜粋)
print('Send me ASCII DECIMAL 101, 101, 101, side-by-side, no space.')

② ヒントの解読 (ASCII変換)

「ASCII DECIMAL 101を、スペースなしで3つ並べて送れ」という指示を読み解きます。

  • 101 (10進数) は、ASCIIコード表で見ると文字の 'e' です
  • つまり、入力すべき文字列は eee であることが分かります

③ 実装とフラグ奪取

WSLから、提供された nc (Netcat) コマンドを使って接続しました。

  1. ターミナルで nc [ホスト名] [ポート番号] を実行。
  2. 指示が表示されるので、eee と入力して Enter。
  3. フラグが表示される!

4. まとめ

ASCIIコードの「10進数(Decimal)」と「文字」の対応を知っているとスムーズに解けます。

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?