よもぎのメモ帳

備忘録的な感じで技術的なことをストックしていきます。

setodaNote CTF Writeup

はじめに

f:id:y0m0g1:20210904210813p:plain

setodaNote CTFが2021/09/04 21:00(JST)までありました。

ctf.setodanote.net

私の結果はこんな感じでした

f:id:y0m0g1:20210904210548p:plain
72nd/592でした

f:id:y0m0g1:20210904210954p:plain
出来不出来の差がひどい

できた範囲でWriteup雑に書いていこうかなと思います。めっちゃムラがある……


Misc Writeup

Welcome

web shellが用意されているので、ログインしてlsしたら welcome.txt が見つかる

  Welcome to the setodaNote CTF!!

  *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  *                                 *
  *   flag{Enjoy_y0ur_time_here!}   *
  *                                 *
  *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  This is the flag.

morse_one

とりあえず解凍

37バイトのテキストファイルが生成

DDDBSDDSBDDDSDBDSBBBSDBBDSDBDDSDSBDDB

モールス信号だった Sがスプリッターぽそう

  • D:Dot
  • B:Bar
  • S:Space

で置き換えてモールス信号

cyberchef

Find_/_Replace({'option':'Regex','string':'S'},' ',true,false,true,false)
Find_/_Replace({'option':'Regex','string':'D'},'.',true,false,true,false)
Find_/_Replace({'option':'Regex','string':'B'},'-',true,false,true,false)
From_Morse_Code('Space','Line feed')

VIBROPLEXになった←これどういう意味かわからない*1

flag{VIBROPLEX}

Hash

❯ Get-FileHash -Algorithm SHA256 .\* | grep AFF0

みたいにすると上から順にpass024.txt,pass034.txt,pass079.txtが当てはまることがわかる

flag{hardest_logic_puzzle}

F

BrainfuckなのでオンラインでDecoderを見つける

FLAG is flag{Don't_Use_the_F-Word!!}

magic_number

File Signatureの話をしている。

1つ目はPNG 2つ目はRAR 3つ目はJPEGJFIFとか

flag{post_rar_light}

Stegano

青空白猫を使って、赤色ビット4、赤色のみ抽出、青色ビット4をしていくと文字が現れる

f:id:y0m0g1:20210904211228p:plainf:id:y0m0g1:20210904211240p:plainf:id:y0m0g1:20210904211253p:plain

flag{Re4l17y_1s_cReA73d_by_7h3_m1nd_rA9}*2

morse_zero

一見するとZしか書かれていないファイルが出てくる

なんか空白があるっぽい?

Hexでみると

e2 80 8c e2 80 8c e2 80 8b e2 80 8b 5a e2 80 8b
5a e2 80 8b e2 80 8c e2 80 8b 5a e2 80 8c e2 80
8c e2 80 8c e2 80 8c e2 80 8c 5a e2 80 8b e2 80
8b e2 80 8c e2 80 8c e2 80 8b e2 80 8c 5a e2 80
8b e2 80 8c e2 80 8c 5a e2 80 8b e2 80 8c e2 80
8c e2 80 8c e2 80 8c 5a e2 80 8c e2 80 8b e2 80
8b 5a e2 80 8c 5a e2 80 8b e2 80 8b e2 80 8b e2
80 8b 5a e2 80 8b e2 80 8b e2 80 8c e2 80 8c e2
80 8b e2 80 8c 5a e2 80 8b e2 80 8b e2 80 8b 5a
e2 80 8b e2 80 8c e2 80 8c e2 80 8b 5a e2 80 8b
e2 80 8c 5a e2 80 8c e2 80 8b e2 80 8c e2 80 8b
5a e2 80 8b
  • 0xe2808b:dot
  • 0xe2808c:bar
  • 0x5a(Z):space

ZER0_W1DTH_SPACE

cyberchef

To_Hex('None',0)
Find_/_Replace({'option':'Regex','string':'5a'},' ',true,false,true,false)
Find_/_Replace({'option':'Regex','string':'e2808b'},'.',true,false,true,false)
Find_/_Replace({'option':'Regex','string':'e2808c'},'-',true,false,true,false)
From_Morse_Code('Space','Line feed')

ransom_note

解凍したら隔離された

bitdifenderのdecryptor試してみてるけど進まない

↑これESETが悪かった、一時無効にしてツール走らせたら一瞬で終わった

flag{unlock1ng_y0ur_d1gital_life_with0ut_paying;)}

Nothing

TabとSpaceで構成されている

Spaceを0、Tabを1にして 終わりにある謎のスペースを一番上に持ってきて、一行おきにASCIIコードに直す

FLAG is flag{And_Then_There_Were_None}.

Find_/_Replace({'option':'Regex','string':' '},'0',true,false,true,false)
Find_/_Replace({'option':'Regex','string':'\\t'},'1',true,false,true,false)
Find_/_Replace({'option':'Regex','string':'\\n1'},'',true,false,true,false)
From_Binary('Line feed',13)

Redacted

Acrobat DCで開いたら黒塗り編集で消せた

或いはオンラインのPDFから画像抽出サービスで

f:id:y0m0g1:20210904213545p:plain

strong_password

John the Ripperのzip2johnで生成されたハッシュがpkzip2にならなくてだめって言われた感じだった オンラインのツールでやったらpkzip2で出てきた

Hashcatにかけるとすぐに出てきた なお、日付と前後の記号の部分は辞書ファイルを作った

./hashcat.exe -a 6 -m 17210 -D 2 hash.txt date.txt -1 '?l?u' '?1?1?1'

$pkzip2$1*1*2*0*55*49*8578f5f9*0*2b*0*55*8578*92c0*598c6b323287ee253bad1378d1f4fe4d91648ea9f1e60fe80374b917e47421b6f3379cf786e9c22453d02e8192c2aecd93122be13b2c348d02c0229c6c8a6b433ac24b17d0e18f215252601daafe595eb6ba28eab3*$/pkzip2$:qYL%20210228!

ということでqYL%20210228!がパスワード

復号して解凍したファイルから出てきたのは

このパスワードが安全なはずがない。

flag{And_n0w_h3re_is_my_s3cre7}

Network Writeup

Host

pcapみたらHostにctf.setodanote.netの名前が

tkys_never_die

パケットバイト列をエクスポートしたらPNGを取り出せた

f:id:y0m0g1:20210904211539p:plain

flag{a_treasure_trove}

echo_request

echoのうち、Dataが1byteのものに絞ると(data.len==1) flag{ICMP_Tunneling_T1095}

stay_in_touch

tcp.stream eq 12でZipファイルが送られていて tcp.stream eq 14でパスワードが送られるPPAP方式

これを解凍すると

This is Flag.

 flag{SoNtOkIhAmOuKaTaHoUmOtSuMuRuNoSa;)}

ちなみにMIMEフォーマットで得られるのが

UEsDBBQAAQAAADBq8FK0Nz5zSgAAAD4AAAATAAAAUmVwb3J0LUFWLVQwMDk3LnR4dAzRMzm6s5vAM3huF0n2GEKFrarxVD3WvzurjKz9sjA7iD6nWis0GBRcIdcyrQkqliocBi2lCUB6J0hRUgHzDVCnVx6LnLS5LenqUEsBAj8AFAABAAAAMGrwUrQ3PnNKAAAAPgAAABMAJAAAAAAAAAAgAAAAAAAAAFJlcG9ydC1BVi1UMDA5Ny50eHQKACAAAAAAAAEAGADNWpx++XnXARJtllL6edcB0TOVfvl51wFQSwUGAAAAAAEAAQBlAAAAewAAAAAA

cyberchefで

From_Base64('A-Za-z0-9+/=',true)
Extract_Files(true,true,true,true,true,true,false,true)
Unzip('Yatagarasu-Takama-Kamuyamato2',false)

yes_you_can

idひとつひとつみると idが244のものが怪しかった

flag{can_bus_hacking}

Digdig

$strings digdig.pcap -n 23 | awk '(NR%4==0){print}'
005aa002735f69735f44414d
005aa00663655f7472795f53
005aa0034d595f464c41477d
005aa0085f746861747d2066
005aa00a6c61677b444e535f
005aa00b5333637572313779
005aa0076f7272795f666f72
005aa00420666c6167206973
005aa0096c61672069732066
005aa00c5f5431303731217d
005aa011797d323232323232
005aa00d20666c6167206973
005aa00f335f6b33795f3135
005aa00e20666c61677b3768
005aa001666c61677b546869
005aa0105f35336375723137
005aa000666c616720697320
005aa00520666c61677b4e69

おそらく005aa0{順番2桁}{asciiコード} sortすると

005aa000666c616720697320
005aa001666c61677b546869
005aa002735f69735f44414d
005aa0034d595f464c41477d
005aa00420666c6167206973
005aa00520666c61677b4e69
005aa00663655f7472795f53
005aa0076f7272795f666f72
005aa0085f746861747d2066
005aa0096c61672069732066
005aa00a6c61677b444e535f
005aa00b5333637572313779
005aa00c5f5431303731217d
005aa00d20666c6167206973
005aa00e20666c61677b3768
005aa00f335f6b33795f3135
005aa0105f35336375723137
005aa011797d323232323232

asciiコードのところを抜き出せば

666c616720697320666c61677b546869735f69735f44414d4d595f464c41477d20666c616720697320666c61677b4e6963655f7472795f536f7272795f666f725f746861747d20666c616720697320666c61677b444e535f53336375723137795f5431303731217d20666c616720697320666c61677b3768335f6b33795f31355f35336375723137797d323232323232

デコードしたら

flag is flag{This_is_DAMMY_FLAG} flag is flag{Nice_try_Sorry_for_that} flag is flag{DNS_S3cur17y_T1071!} flag is flag{7h3_k3y_15_53cur17y}222222

一番それっぽいflag{DNS_S3cur17y_T1071!}

Logger

book.hacktricks.xyz

これがヒットして、frame.len==35 があってそうだからよかった

$ tshark -r logger.pcap -T fields -e usb.capdata | tr -d : > keystrokes.txt
$ cat keystrokes.txt | awk 'NF' > pipe;cat pipe > keystrokes.txt

blog.stayontarget.org

ここにあったやつを使う

One popular bbut unverified explanatin<del>oon for the QWERTY arrangement is that it wwas designed to reduce the likelihood of flag{QWE_keyb0ard_RTY} internal clashhing of typebard<del>s by placing commonly ussed  combinatiioons of letters farther froom each oher inside the machine.<Enter>

tkys_not_enough

青空白猫でファイル抽出したら2つgzipがとれて、片方を解凍すると

I'm going to practice making origami cranes so that I can fold them for you some day, okay?


flag{netw0rk_shell_2000}

がでた


Web Writeup

body

ソース見たら書いてあった

<h3>フラグ形式</h3>
<p>特に指定がない限りフラグは flag{<!-- *** flag{Section_9} *** -->} という形式をとります。</p>
<ul class="actions special">
    <li><a href="#four" class="button scrolly">More</a></li>
</ul>

header

開発者ツールのNetworkでヘッダーを見ると書いてあった

f:id:y0m0g1:20210905030041p:plain

puni-puni

xn--q6jaaaaaa08db0x8nc9t1b8fsviei84atb4i0lc
xn--q6jaaaaa03dpd4mb3jc5rpa0g9jpk07acadc.
xn--q6jylla3va3j6c8138a8eptvb303cxv4ft3o4ue63a
xn--v8ja6aj2a3cri3ag4a2r6cx2a1rkk1272c7j4ajd4bmf0kjhg6rb.
xn--q6j6gav1a0b2e1bh1ac2cl29ad7728kdjen6cz80dju6bqexchl9gel8b.

punycodeですね

ところでFirefoxSafariはIDNホモグラフィック耐性が弱め

フラグは、さん、さん、ピー、ユー、エヌ、ワイ、
シー、オー、ディー、イー、よん、よん、です.
カタカナ表記は半角英小文字に、
ひらがな表記は半角数字にしたものがフラグです.
なお、読点は区切り文字なので取り除いてください.

よって flag{33punycode44}


OSINT Writeup

tkys_with_love

コールサインは船舶に割り当てられているらしいWiki

Bahama c6df6 でググったら出てきた

www.marinetraffic.com

SYMPHONY OF THE SEAS 正式名称が違う……?

ケースセンシティブでSymphony of the Seasにしなきゃいけなかった

Dorks

filetypeしかしらなかった

inurl:login.php でいいんですね

filters_op

from:@cas_nisc since:2017-05-14 until:2017-05-16 で調べる

flag{#WannaCrypt}

Mac

タイトルからMacアドレスかなと

00:03:93 = A
00:01:A9 = B
04:2A:E2 = C

最初のはAppleのベンダー番号かなと思って調べたらビンゴ 2つ目はBMW AGらしい

flag{2C:C2:60_FC:EC:DA_00:02:B3_AC:44:F2_FC:4E:A4}

それぞれ、

flag{O_U_I_Y_A}

tkys_eys_only

画像がちょっと見づらいので赤色だけ抽出

f:id:y0m0g1:20210904211954j:plain

検索のクエリを見ると詳しい座標が見える

これをGoogle mapsにかけると

f:id:y0m0g1:20210904212012p:plain

国連本部のビルがある

flag{United_Nations}

MITRE

T1495T1152T1155T1144 T1130T1518 flag{T1170T1118T1099T1496T1212_T1531T1080T1127T1020T1081T1208_T1112T1098T1199T1159T1183T1220_T1111T1147T1220}

多分Flag is で始まると思う

id technique url
T1495 Firmware Corruption
T1152 Launchctl https://attack.mitre.org/techniques/T1569/001/
T1155 AppleScript https://attack.mitre.org/techniques/T1059/002/
T1144 Gatekeeper Bypass https://attack.mitre.org/techniques/T1553/001/
T1130 Install Root Certificate https://attack.mitre.org/techniques/T1553/004/
T1518 Software Discovery https://attack.mitre.org/techniques/T1518/
T1170 Mshta https://attack.mitre.org/techniques/T1218/005/
T1118 InstallUtil https://attack.mitre.org/techniques/T1218/004/
T1099 Timestomp https://attack.mitre.org/techniques/T1070/006/
T1496 Resource Hijacking https://attack.mitre.org/techniques/T1496/
T1212 Exploitation for Credential Access https://attack.mitre.org/techniques/T1212/
_
T1531 Account Access Removal https://attack.mitre.org/techniques/T1531/
T1080 Taint Shared Content https://attack.mitre.org/techniques/T1080/
T1127 Trusted Developer Utilities Proxy Execution https://attack.mitre.org/techniques/T1127/
T1020 Automated Exfiltration https://attack.mitre.org/techniques/T1020/
T1081 Credentials In Files https://attack.mitre.org/techniques/T1552/001/
T1208 Kerberoasting https://attack.mitre.org/techniques/T1558/003/
_
T1112 Modify Registry https://attack.mitre.org/techniques/T1112/
T1098 Account Manipulation https://attack.mitre.org/techniques/T1098/
T1199 Trusted Relationship https://attack.mitre.org/techniques/T1199/
T1159 Launch Agent https://attack.mitre.org/techniques/T1543/001/
T1183 Image File Execution Options Injection https://attack.mitre.org/techniques/T1546/012/
T1220 XSL Script Processing https://attack.mitre.org/techniques/T1220/
_
T1111 Two-Factor Authentication Interception https://attack.mitre.org/techniques/T1111/
T1147 Hidden Users https://attack.mitre.org/techniques/T1564/002/
T1220 XSL Script Processing https://attack.mitre.org/techniques/T1220/

FLAG IS flag{MITRE_ATTACK_MATLIX_THX}

Ropeway

湖 ロープウェイ 遊園地でググる

浜名湖パルパルがヒットする

pal2.co.jp

湖 ロープウェイでも良かった?

www.kanzanji-ropeway.jp

かんざんじロープウェイ

flag{kanzanji}


Crypto Writeup

base64

base64をデコードするだけ

flag{It's_called_base64!}

rot13

ro13をデコードするだけ

flag{Even_you_Brutus?}

pui_pui

Hexを戻してあげれば

A:Do you know Molcar?

B:Of course! I love the scene where he sinks into the blast furnace while giving the thumbs up.

A:... What?

B:btw, the flag is flag{Have_you_ever_heard_of_Hexdump?}.

tkys_secret_service

問題文

Gur cevgrsgbvh vp Pvhgevyyrq Hhsynmmbpbrq Vhpvezngbvh (PHV) ermbqrhg bh hvhprqreny mlmgrzm nhq vetnhbfngbvhm bm vp cnenzvahg bzcvegnhsr gv prqreny ntrhsbrm nhq snh qbersgyl bzcnsg gur nobybgl vp gur prqreny tvirehzrhg gv massrmmpayyl svhqasg bgm rmmrhgbny zbmmbvhm nhq pahsgbvhm. Gubm caoybsngbvh cevibqrm ntrhsbrm jbgu ersvzzrhqrq mrsaebgl erdaberzrhgm pve cevgrsgbht gur svhpbqrhgbnybgl vp PHV jurh gur bhpvezngbvh bm ermbqrhg bh hvhprqreny mlmgrzm nhq vetnhbfngbvhm; jurh gur hvhprqreny vetnhbfngbvh bm hvg svyyrsgbht ve znbhgnbhbht bhpvezngbvh vh orunyp vp n prqreny ntrhsl ve ambht ve vcrengbht n mlmgrz vh orunyp vp nh ntrhsl; nhq jurer gurer ner hv mcrsbpbs mnprtaneqbht erdaberzrhgm pve cevgrsgbht gur svhpbqrhgbnybgl vp Synt bm pynt{cabcab_sne_vp_zvy} PHV cermseborq ol gur naguvebfbht ynj, ertayngbvh, ve tvirehzrhgjbqr cvybsl pve gur PHV sngrtvel ybmgrq bh gur PHV Ertbmgel. Gur erdaberzrhgm nccyl gv nyy svzcvhrhgm vp hvhprqreny mlmgrzm nhq vetnhbfngbvhm gung cevsrmm, mgver, nhq/ve genhmzbg PHV, ve gung cevibqr cevgrsgbvh pve masu svzcvhrhgm. Gur mrsaebgl erdaberzrhgm ner bhgrhqrq pve amr ol prqreny ntrhsbrm bh svhgensgany irubsyrm ve vgure nterrzrhgm rmgnoybmurq orgjrrh guvmr ntrhsbrm nhq hvhprqreny vetnhbfngbvhm.

をrot13にかけると(GurはTheのRot13)

The priteftoiu ic Ciutrilled Uuflazzocoed Iucirmatoiu (CUI) rezodeut ou uiucederal zyztemz aud irgauosatoiuz oz ic paraminut ompirtaufe ti cederal ageufoez aud fau doreftly ompaft the aboloty ic the cederal giverumeut ti znffezzcnlly fiudnft otz ezzeutoal mozzoiuz aud cnuftoiuz. Thoz pnblofatoiu privodez ageufoez woth refimmeuded zefnroty reqnoremeutz cir priteftoug the fiucodeutoaloty ic CUI wheu the oucirmatoiu oz rezodeut ou uiucederal zyztemz aud irgauosatoiuz; wheu the uiucederal irgauosatoiu oz uit filleftoug ir maoutaououg oucirmatoiu iu behalc ic a cederal ageufy ir nzoug ir iperatoug a zyztem iu behalc ic au ageufy; aud where there are ui zpefocof zacegnardoug reqnoremeutz cir priteftoug the fiucodeutoaloty ic Flag oz clag{pnopno_far_ic_mil} CUI prezfrobed by the anthirosoug law, regnlatoiu, ir giverumeutwode pilofy cir the CUI fategiry lozted ou the CUI Regoztry. The reqnoremeutz apply ti all fimpiueutz ic uiucederal zyztemz aud irgauosatoiuz that prifezz, ztire, aud/ir trauzmot CUI, ir that privode priteftoiu cir znfh fimpiueutz. The zefnroty reqnoremeutz are outeuded cir nze by cederal ageufoez ou fiutraftnal vehoflez ir ither agreemeutz eztablozhed betweeu thize ageufoez aud uiucederal irgauosatoiuz.

Flag oz clag{pnopno_far_ic_mil}aud/irに注目してみると oz->is clag->flag aud/ir->and/or かなと

c<->f u<->n i<->o s<->zの換字で

The protection of Controlled Unclassified Information (CUI) resident in nonfederal systems and organizations is of paramount importance to federal agencies and can directly impact the ability of the federal government to successfully conduct its essential missions and functions. This publication provides agencies with recommended security requirements for protecting the confidentiality of CUI when the information is resident in nonfederal systems and organizations; when the nonfederal organization is not collecting or maintaining information on behalf of a federal agency or using or operating a system on behalf of an agency; and where there are no specific safeguarding requirements for protecting the confidentiality of Flag is flag{puipui_car_of_mol} CUI prescribed by the authorizing law, regulation, or governmentwide policy for the CUI category listed in the CUI Registry. The requirements apply to all components of nonfederal systems and organizations that process, store, and/or transmit CUI, or that provide protection for such components. The security requirements are intended for use by federal agencies in contractual vehicles or other agreements established between those agencies and nonfederal organizations.

cyberchefでは

ROT13(true,true,false,13)
Substitute('cfuniozs','fcnuoisz')

lets_bake

RnJvbV9CYXNlNjQoJ0EtWmEtejAtOSsvPScsdHJ1ZSkN]b2[sRnJvbV9IZXgoJ05vbmUnKQ0=]b2[sRm9yaygnJScsJ18nLGZhbHNlKQ0=]b2[sUkM0KHsnb3B0aW9uJzonVVRGOCcsJ3N0cmluZyc6J2NoZWYnfSwnTGF0aW4xJywnTGF0aW4xJyk=

]b2[s←が区切り文字っぽくなっている

順にBase64をデコードすれば

From_Base64('A-Za-z0-9+/=',true)
From_Hex('None')
Fork('%','_',false)
RC4({'option':'UTF8','string':'chef'},'Latin1','Latin1')

これをCyberchefに読み込ませる

でてきたのは flag{hello_baked_cipher}

vul_rsa_01

nをfactordbにかけると

3058517013146002381763962882964790715736519<43> · 4372642466716249946441875327733923056149624303<46>

というふうに素因数分解できることがわかる

d  4897557609358873156657999039608506066811736904039482454770352974851826510011931551945473
m  46327402297761911070944293204953074319567693047395802794186233938451290661245

平文を16進数に直して文字列にすると flag{weak_rsa_can_be_decrypted!}

vul_rsa_02

ぱっとみeがめちゃくちゃ大きい

Wienner's Attackが使えそう

elliptic-shiho.hatenablog.com

で紹介されていた

github.com

を使えば、

d  19780253153570454414022314122363673676673
m  139798168458800312619727954564053595602272620374704334322644822890230408773803390124016933159608289280352695220195070051973287657162728356081272992926853175686148989

16進数にして 26d79a6fba2741958ce82462855a96ec4dc1623133cfc341579920befc02eb7b9e0a3bbb87200666c61677b3139375f4d69636861656c5f4a5f5769656e65725f3637337d

00以降の部分をASCIIにすると 666c61677b3139375f4d69636861656c5f4a5f5769656e65725f3637337d : flag{197_Michael_J_Wiener_673}


Rev Writeup

helloworld

stringsコマンドで見ると

Nice try, please set some word when you run me.
flag
Good job, but please set 'flag' when you run me.
hint
Nice try ;)
❯ .\helloworld.exe
Nice try, please set some word when you run me.

実行するとこんな感じ

❯ .\helloworld.exe flag
flag{free_fair_and_secure_cyberspace}

elf

$ file elf
elf: data
$ strings elf
XXXX
/lib64/ld-linux-x86-64.so.2
puts
__cxa_finalize

バイナリエディタでみたら先頭4バイトがXXXXになってて、File signitureが壊れているのかなって感じ

7F454C46らしいので書き換える

$ file elf
elf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=4f0f6e7df2d02645bb6387a08a099ddecb22b6f1, for GNU/Linux 3.2.0, stripped

$ ./elf
flag{run_makiba}

passcode

$ file passcode
passcode: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=8be572b7a0563868ee29af143b2df0c7d6b1636d, for GNU/Linux 3.2.0, stripped

$ strings passcode
/lib64/ld-linux-x86-64.so.2
__isoc99_scanf
puts

Enter the passcode:
%255[^
]%*[^
Invalid passcode.
Invalid passcode. Too short.
Invalid passcode. Too long.
20150109
The passcode has been verified.
Flag is : flag{%s}
Invalid passcode. Nice try.
;*3$"
GCC: (Debian 10.2.1-6) 10.2.1 20210110

実行してみると8文字っぽいことがわかって、20150109が8文字なので入力したら通った

$ ./passcode
Enter the passcode: aaaaaaa
Invalid passcode. Too short.
$ ./passcode
Enter the passcode: 20150109
The passcode has been verified.

Flag is : flag{20150109}

Forensics Writeup

paint_flag

隠されているらしいのでとりあえず拡張子をzipに変えて解凍してみたら、 word/media/flag.pngを発見

f:id:y0m0g1:20210904212434p:plain

flag{What_m4tters_is_inside;)}

Mail

ThunderbirdのInportExportToolsでインポートしてあげると、 Sent-1に機密情報を送っているメールが有った

アカリさん

ステラです。

 サーバから依頼のあったファイルを取得しておきました。  メールに添付いたしますので、ご確認ください。

以上です。

ダウンロードしたら f:id:y0m0g1:20210904212511p:plain

flag{You've_clearly_done_a_good_job_there!!}

Deletedfile

mountしたらWord.jpgってでてきたけど何も書いてなかった

0x14000あたりみるとword.jpgとcert.jpgあたり

青空白猫で一発だった……

f:id:y0m0g1:20210904212603j:plain

flag{nosce_te_ipsum}

timeline

stringsをZIPファイルにやると、

(略)
C/Users/
C/Users/stella/
C/Users/stella/AppData/
C/Users/stella/AppData/Local/
C/Users/stella/AppData/Local/ConnectedDevicesPlatform/
C/Users/stella/AppData/Local/ConnectedDevicesPlatform/L.stella/
Su<w
Rzw}j
C/Users/stella/AppData/Local/ConnectedDevicesPlatform/L.stella/ActivitiesCache.db
Tu<w
C/Users/stella/AppData/Local/ConnectedDevicesPlatform/L.stella/ActivitiesCache.db-shm
C/Users/stella/AppData/Local/ConnectedDevicesPlatform/L.stella/ActivitiesCache.db-wal

普通に解凍するとAppDataが表示されないのでエクスプローラーのアドレスバーに直接入力して表示した

ActivitiesCache.dbはSQLiteのViewerで見えるらしい

blog.group-ib.com

みてみるとEdgeとNotepadのエントリがある

f:id:y0m0g1:20210904212639p:plain

これあってるのかな……?

flag{Th3_Fu7Ure_1s_N0w}

browser_db

さっきと同じViewerでみたらなんかあった

f:id:y0m0g1:20210904212657p:plain

MFT

MFT2CsvというGithubにあったツールでCSVにして、ファイルサイズで検索すると1エントリヒットした

ファイル名はkimitsu.zip

flag{kimitsu.zip}

tkys_another_day

バイナリエディタで見てみたら最後の方に Software APNG Assembler 2.91 という文字があったので調べると、アニメーションPNGを制作するらしい Firefoxで再生できるらしいけどなんもわからん

Webアプリで変換みたいなのがあって、各フレームごとに出すと

f:id:y0m0g1:20210904212717p:plainf:id:y0m0g1:20210904212728p:plainf:id:y0m0g1:20210904212723p:plainf:id:y0m0g1:20210904212720p:plainf:id:y0m0g1:20210904212725p:plain

flag{a_fake_illness_is_the_most_serious_disease_f5ab7}

CSIRT_asks_you_01

EventID=4625がLogon(失敗)でEventID=4624がLogon(成功) ログオンタイプが3のときにネットワーク経由

イベントIDで絞り込んで目grepした

flag{20210719_050921_4624}

unallocated_space

青空白猫でファイル抽出したらmp4ファイルが3つ出てくる、これらは全部内容同じ?

再生したらペイントの動画が……

f:id:y0m0g1:20210904212917p:plain

flag{file_carving_gogo}

CSIRT_asks_you_02

とりあえず前の問題のログを見てみる

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Microsoft-Windows-Security-Auditing" Guid="{54849625-5478-4994-a5ba-3e3b0328c30d}" /> 
  <EventID>4624</EventID> 
  <Version>2</Version> 
  <Level>0</Level> 
  <Task>12544</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x8020000000000000</Keywords> 
  <TimeCreated SystemTime="2021-07-18T20:09:21.9048458Z" /> 
  <EventRecordID>11874</EventRecordID> 
  <Correlation ActivityID="{38c95613-7bec-0001-4956-c938ec7bd701}" /> 
  <Execution ProcessID="604" ThreadID="4852" /> 
  <Channel>Security</Channel> 
  <Computer>stella-pc</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data Name="SubjectUserSid">S-1-0-0</Data> 
  <Data Name="SubjectUserName">-</Data> 
  <Data Name="SubjectDomainName">-</Data> 
  <Data Name="SubjectLogonId">0x0</Data> 
  <Data Name="TargetUserSid">S-1-5-21-3590118637-3649102893-3870174881-1002</Data> 
  <Data Name="TargetUserName">test</Data> 
  <Data Name="TargetDomainName">STELLA-PC</Data> 
  <Data Name="TargetLogonId">0x76ba89</Data> 
  <Data Name="LogonType">3</Data> 
  <Data Name="LogonProcessName">NtLmSsp</Data> 
  <Data Name="AuthenticationPackageName">NTLM</Data> 
  <Data Name="WorkstationName">lizardface</Data> 
  <Data Name="LogonGuid">{00000000-0000-0000-0000-000000000000}</Data> 
  <Data Name="TransmittedServices">-</Data> 
  <Data Name="LmPackageName">NTLM V2</Data> 
  <Data Name="KeyLength">128</Data> 
  <Data Name="ProcessId">0x0</Data> 
  <Data Name="ProcessName">-</Data> 
  <Data Name="IpAddress">192.168.224.120</Data> 
  <Data Name="IpPort">0</Data> 
  <Data Name="ImpersonationLevel">%%1833</Data> 
  <Data Name="RestrictedAdminMode">-</Data> 
  <Data Name="TargetOutboundUserName">-</Data> 
  <Data Name="TargetOutboundDomainName">-</Data> 
  <Data Name="VirtualAccount">%%1843</Data> 
  <Data Name="TargetLinkedLogonId">0x0</Data> 
  <Data Name="ElevatedToken">%%1843</Data> 
  </EventData>
  </Event>

SAM\SAM\Domains\Account\Users\Names\testをみると0x3EAがRIDみたい

Mimikatzで読んでみると

RID  : 000003ea (1002)
User : test
  Hash NTLM: 3c99b8901b00758369f18b9df72012c8

Supplemental Credentials:
* Primary:NTLM-Strong-NTOWF *
    Random Value : b78f688eb504f9296edf06a455b5e602

* Primary:Kerberos-Newer-Keys *
    Default Salt : DESKTOP-O4DN20Ttest
    Default Iterations : 4096
    Credentials
      aes256_hmac       (4096) : af0ca858bda2d0332abccce6098362098d125c8533ac7f79ced9ada64aaf0826
      aes128_hmac       (4096) : b7a4eb1224c5e4fbaaf96aac8326ae4e
      des_cbc_md5       (4096) : 316897ae3434c8fe
    OldCredentials
      aes256_hmac       (4096) : af0ca858bda2d0332abccce6098362098d125c8533ac7f79ced9ada64aaf0826
      aes128_hmac       (4096) : b7a4eb1224c5e4fbaaf96aac8326ae4e
      des_cbc_md5       (4096) : 316897ae3434c8fe

* Packages *
    NTLM-Strong-NTOWF

* Primary:Kerberos *
    Default Salt : DESKTOP-O4DN20Ttest
    Credentials
      des_cbc_md5       : 316897ae3434c8fe
    OldCredentials
      des_cbc_md5       : 316897ae3434c8fe

crackstationに問い合わせるとtesttestのNTLMハッシュであることがわかった

flag{test_testtest}

参考: shinobistyle.hatenablog.com


Programming Writeup

zzzippp

flag1000.zipを回答するとflag999.zipがでてくる

import os
import zipfile
this_dir = os.path.dirname(os.path.abspath(__file__))

for i in reversed(range(1,1001)):
    zipfilename = "flag" + str(i) + ".zip"
    print("extract zipfile:{} ...".format(zipfilename))
    with zipfile.ZipFile(os.path.join(this_dir, zipfilename)) as existing_zip:
        existing_zip.extractall(this_dir)

flag.txtがでてきて

flag{loop-zip-1989-zip-loop}

echo_me

試しにやると

$ nc 10.1.1.10 12020
==========
echo me: 13817520
==========
13817520
Correct!

==========
echo me: 39193241
==========
39193241
Correct!

==========
echo me: 21172923
==========

Incorrect! Nice try! 
nc = Netcat('10.1.1.10', 12020)

while True:
    a = nc.read_until('\n') #==========
    print(a)
    q = nc.read_until('\n') #echo me: 13817520
    _ = nc.read_until('\n') #==========
    nc.write((q[9:17]+'\n').encode('utf-8'))
    r = nc.read_until('\n') #Correct!
    if r == "Correct!\n":
        _ = nc.read_until('\n') #\n
        continue
    elif "Incorrect!" in r:
        print("ERR!: {}".format(r))
        break
    else:
        break

だいたいこんな感じで組んで flag{Hellow_yamabiko_Yoo-hoo!}

EZZZIPPP

試しに解凍すると、さっきの問題+pass.txtが毎回出てくる感じ

import os
import zipfile
this_dir = os.path.dirname(os.path.abspath(__file__))
passfilename = os.path.join(this_dir, "pass.txt") 

for i in reversed(range(1,1001)):
    zipfilename = "flag" + str(i) + ".zip"
    with open(passfilename) as f:
        password = f.readline().strip('\n')
    print("extract zipfile:{} with password:{}...".format(zipfilename, password))
    with zipfile.ZipFile(os.path.join(this_dir, zipfilename)) as existing_zip:
        existing_zip.extractall(this_dir, pwd=password.encode('utf-8'))

flag{bdf574f15645df736df13daef06128b8}

deep_thought

試しにやると

$ nc 10.1.1.10 12010
[ Q1 ]
2 + 5
7
Correct!

[ Q2 ]
5 + 2
7
Correct!

[ Q3 ]
4 + 7
11
Correct!

[ Q4 ]
6 - 12
3
Incorrect! Nice try!
def solve(s):
    sp = s.split(' ')
    op1 = sp[0]
    op2 = sp[2]
    opc = sp[1]
    if '+' in opc:
        ans = int(op1) + int (op2)
    elif '-' in opc:
        ans = int(op1) - int (op2)
    return str(ans)

nc = Netcat('10.1.1.10', 12010)

while True:
    a = nc.read_until('\n') 
    if len(a) < 2: #\n
        continue
    elif 'flag' in a:
        print(a)
        break
    elif '[ Q' in a: #[ Qxx ]
        continue
    elif ('+' in a) or ('-' in a):
        ans = solve(a)
        nc.write((ans+'\n').encode('utf-8'))
    elif 'Correct' in a:
        continue
    else:
        print(a)
        break

nc.close()

flag{__42__}


終わりに

雑なWriteupになってしまいました。気が向いたら直していくかもしれない。

OSINTがあんまりできなかったのと、WebとPwnが本当にできなかったので要勉強です……

楽しかったので、このレベル感のCTFもっとあったらいいなぁ。

*1:モールス信号を送る機械のブランドらしい

*2:rA9ってデトロイトじゃん!?