LoginSignup
0
0

More than 3 years have passed since last update.

picoCTF2021 Writeup

Posted at

解いた問題のwriteupを書きます。

Obedient Cat(5pt)

flag ファイルが配られる。file flag でファイルの種類を調べる。
flag: ASCII text
textファイルなので cat flag する。

Mod 26(10pt)

問題文にROT13って書いてあるじゃん...
ROT13でdecodeする。

information(10pt)

ヒントを見ると、Look at the details of the file だそうです。多分exiftoolだろう
License:cGljb0NURnt0aGVfbTN0YWRhdGFfMXNfbW9kaWZpZWR9
base64でdecryptする。

Nice netcat...(15pt)

ncに接続。
112 105 99 111 67 84 70 123 103 48 48 100 95 107 49 116 116 121 33 95 110 49 99 51 95 107 49 116 116 121 33 95 102 50 100 55 99 97 102 97 125 10
ASCIIでdecryptする。

Stonks(20pt)

明らかに詐称なんだが...
ncに
%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x
を投げるとそれっぽいHexが返ってくる。

GET aHEAD(20pt)

curl -I -sS [url]
をするとヘッダ情報がもらえる。

Matryoshka doll(30pt)

Wait, you can hide files inside files? But how do you find them?
だそうです。binwalkを何回かするとflagがもらえた。

Magikarp Ground Mission(30pt)

sshする。
[n]of3.flag.txtinstructions-to-[n]of3.txt がある。
指示に従うとflagが完成。

Wireshark doo dooo do doo... (50pt)

HTTPでファイルをエクスポートしたら、%2f ファイルが手に入る。開くと
Gur synt vf cvpbPGS{c33xno00_1_f33_h_qrnqorrs}
ROT13でdecryptする。

What's your input?(50pt)

python input 脆弱性 とかでググると
このサイト が見つかる。どうやら、python2では、inputされた文字列をpythonのコードの一部として認識するらしい。以下ソースコード。

in.py
#!/usr/bin/python2 -u
import random

cities = open("./city_names.txt").readlines()
city = random.choice(cities).rstrip()
year = 2018

print("What's your favorite number?")
res = None
while not res:
    try:
        res = input("Number? ")
        print("You said: {}".format(res))
    except:
        res = None

if res != year:
    print("Okay...")
else:
    print("I agree!")

print("What's the best city to visit?")
res = None
while not res:
    try:
        res = input("City? ")
        print("You said: {}".format(res))
    except:
        res = None

if res == city:
    print("I agree!")
    flag = open("./flag").read()
    print(flag)
else:
    print("Thanks for your input!")

ncにつないで一回目は2018と入力。2回目はcityと入力する。

Scavenger Hunt(50pt)

flagが5つに分割されていろんなところに散らばってる。
・part1
HTMLのソースコード

・part2
CSSのソースコード

・part3
[url]/robots.txt

・part4
[url]/.htaccess

・part5
[url]/.DS_Store

MacroHard WeakEdge(60pt)

Who are you?(60pt)

GIFが煽りプレイをしてくる。リクエストヘッダ情報を偽装(?)する。curlを使った。
・part1
Only people who use the official PicoBrowser are allowed on this site!
User-Agentを変える
-A "picobrowser"

・part2
I don't trust users visiting from another site.
Refererを変える。
-H "Referer:http://mercury.picoctf.net:36622/"

・part3
Sorry, this site only worked in 2018.
日付を変える。
-H "Date: Mon, 1 Jan 2018 07:28:00 GMT"

・part4
I don't trust users who can be tracked.
DNT(don't track)
-H "DNT: 0"

・part5
This website is only for people from Sweden.
発信元のIPアドレスを変える。
-H "X-Forwarded-For: 85.228.41.27"
ここから一気に難易度あがるな...

・part6
You're in Sweden but you don't speak Swedish?
どんだけセキュリティ厳重なんだよ...
-H "Accept-Language: sv"

この問題を解くうえでこちらのサイトがわかりやすかったです。

Trivial Flag Transfer Protocol(90pt)

TFTPでエクスポート。txtファイル、3枚の写真、planの3種類が落ちる。txtファイルを開くと、
GSGCQBRFAGRAPELCGBHEGENSSVPFBJRZHFGQVFTHVFRBHESYNTGENAFSRE.SVTHERBHGNJNLGBUVQRGURSYNTNAQVJVYYPURPXONPXSBEGURCYNA

Vigenere暗号でdecryptすると
TFTPDOESNTENCRYPTOURTRAFFICSOWEMUSTDISGUISEOURFLAGTRANSFER.FIGUREOUTAWAYTOHIDETHEFLAGANDIWILLCHECKBACKFORTHEPLAN

次にplanを見てみると
VHFRQGURCEBTENZNAQUVQVGJVGU-QHRQVYVTRAPR.PURPXBHGGURCUBGBF

同じくvigenereでdecryptすると
IUSEDTHEPROGRAMANDHIDITWITH-DUEDILIGENCE.CHECKOUTTHEPHOTOS
3枚目の画像をsteghideでextractする。この時のpasswordは、"DUEDILIGENCE"となる。

Wireshark twoo twooo two twoo...(100pt)

DNSの中でいくつか違うIPとやり取りしている通信があったので、それらのサブドメインを連結してbase64でdecrypt

Disk, disk, sleuth!(110pt)

これは逆詐称。20点でもいいぐらい。
配られるファイルを解凍する。
gzip -d dds1-alpine.flag.img.gz
strings dds1-alpine.flag.img | grep pico

Disk, disk, sleuth! II(130pt)

autopsyでイメージファイルを開く。問題文に
All we know is the file with the flag is named `down-at-the-bottom.txt`
と書いてあるので、autopsyでそいつを探す。

Super Serial(130pt)

[url]/..%2f/flag
で通った。想定解はわからない。

Milkslap(200pt)

画像をダウンロードして、zstegする。

Very very very Hidden(300pt)

HTTPでエクスポートすると、2枚の画像ファイルが落ちる。
これ を使って隠されたpowershellを探すとflagが見つかる。

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