[web] cigarette
GET /をすると以下のような応答が帰ってきて、フラグが含まれている
HTTP/1.1 200 OK
Date: Wed, 10 Aug 2022 16:14:28 GMT
Server: Apache/2.4.25 (Debian)
X-Powered-By: PHP/5.6.40
Key: T3N4CI0US{bc298e7_daf7_b2d4b347f67_c_56e9d_de34152_9ad99b1_7eb78}
Content-Length: 44
Connection: close
Content-Type: text/html; charset=UTF-8
Flag is not here!
<!-- It's not here! :) -->
[web] Rosin
GET /index.php?url=???とリダイレクトされる。
色々やっていたらfile:///flag/flag.txtでフラグが出てきた。非想定解かも。
GET /index.php?url=file%3a%2f%2f%2fflag%2fflag.txtすると
T3N4CI0US{aa84_c1372_0a89de3c3_f0_1316340332a_2a055c065}
[web] world
GET /で以下のように言われる。
HTTP/1.0 200 OK Content-Type: text/html; charset=utf-8 Content-Length: 22 Server: Werkzeug/1.0.1 Python/2.7.18 Date: Wed, 10 Aug 2022 12:22:00 GMT Welcome To Find Secret
guessして、GET /secretとするとTell me your secret.I will encrypt it so others can't seeと言われる。
さらにguessしてGET /secret?secret=sssadfsadfでなんかエラーが出る。
if(secret==None):
return 'Tell me your secret.I will encrypt it so others can\'t see'
rc=rc4_Modified.RC4("HereIsTreasure")
deS=rc.do_crypt(secret)
a=render_template_string(safe(deS))
if 'ciscn' in a.lower():
return 'flag detected!'
return a
かなりいい感じに色々出てきた。
HereIsTreasureを鍵にしてRC4で暗号化して、render_template_stringに投げている。
あとは、render_template_stringなのでRC4暗号化後にSSTIとして動くようにすればいい。
方針は間違ってないと思うがいまいち刺さらない。
RC4暗号化に失敗した場合に、暗号化部分のライブラリのソースコードも一部見ることができた。
/app/rc4_Modified.pyというファイル名みたいで全文が無いか検索してみると、
rc4加密&ssti注入&CISCN,Double Secret_牛客博客
まんまじゃないか?
答えのpayloadを試すとフラグが得られる。
[web] viska
サーバが落ちているのか一生つながらなかった…