checkin
#*ctf2019
23:24 チャンネルに入りました23:24 *xxxxxx join #*ctf2019 (~xxxxxx@yyy.zzz)23:24 *topic : welcome to *CTF2019, here is first flag *CTF{welcome} :P
フラグは、
*CTF{welcome}
#*ctf2019
23:24 チャンネルに入りました23:24 *xxxxxx join #*ctf2019 (~xxxxxx@yyy.zzz)23:24 *topic : welcome to *CTF2019, here is first flag *CTF{welcome} :P
*CTF{welcome}
Bad JS
100
There is a bad JS which hides flag inside. Capture it.
MD5ハッシュ値を求めます。Flag is: MD5(127.0.0.1)
f528764d624db129b32c21fbca0cb8d6
UUTCTF{f528764d624db129b32c21fbca0cb8d6}
Break the RSA
50
Flag is the decryption of the following:
PublicKey= (114869651319530967114595389434126892905129957446815070167640244711056341561089,113)
CipherText=102692755691755898230412269602025019920938225158332080093559205660414585058354
def exgcd(m, n):if n>0:y,x,d = exgcd(n, m%n)return x, y-m/n*x, delse:return 1, 0, mn = 114869651319530967114595389434126892905129957446815070167640244711056341561089e = 113c = 102692755691755898230412269602025019920938225158332080093559205660414585058354p = 338924256021210389725168429375903627261q = 338924256021210389725168429375903627349d = exgcd(e, (p-1)*(q-1))[0] % ((p-1)*(q-1))s = pow(c, d, n)h = format(s, 'x')f = ''for i in range(0, len(h), 2):f += chr(int(h[i:i+2], 16))print(f)
UUTCTF{easy sH0Rt RSA!!!}
Again Find the Flag
100
Run, enter correct password and capture the flag.
Flag is MD5 of the correct password:
UUTCTF{MD5(Correct Password)}
以下の箇所で入力文字列の長さが19文字であることをチェックしています。$ objdump -s -D -M intel chal_re_med.so >aaa.txt
772: 48 c7 c1 ff ff ff ff mov rcx,0xffffffffffffffff779: f2 ae repnz scas al,BYTE PTR es:[rdi]77b: b8 00 00 00 00 mov eax,0x0780: 48 83 f9 eb cmp rcx,0xffffffffffffffeb #19文字784: 74 23 je 7a9
7c1: 80 3c 32 5f cmp BYTE PTR [rdx+rsi*1],0x5f #4文字目、9文字目、14文字目_以下の箇所で0文字目、5文字目、10文字目、15文字目が9以下であることをチェックしています。7c5: 0f 85 31 02 00 00 jne 9fc
7da: 80 f9 09 cmp cl,0x97dd: 0f 87 23 02 00 00 ja a06 #0文字目、5文字目、10文字目、15文字目9より大きいNG
7f4: 80 f9 09 cmp cl,0x97f7: 76 ea jbe 7e3 #1~3、6~8、11~13、16~18文字目9以下OK
以下の箇所で、同様に、(10文字目+11文字目+12文字目+13文字目)÷3の商と(0文字目+1文字目+2文字目+3文字目)が一致することをチェックしています。984: ba 56 55 55 55 mov edx,0x55555556989: 89 c8 mov eax,ecx #eax=0文字目+1文字目+2文字目+3文字目+5文字目+6文字目+7文字目+8文字目+10文字目+11文字目+12文字目+13文字目98b: f7 ea imul edx #eax=eax×edx、edxは桁あふれ98d: c1 f9 1f sar ecx,0x1f #右31ビットシフト、ecx=0990: 29 ca sub edx,ecx992: b8 00 00 00 00 mov eax,0x0997: 41 39 d0 cmp r8d,edx99a: 0f 85 e6 fd ff ff jne 786 #15文字目+16文字目+17文字目+18文字目とedxが一致しないとNG
以下の箇所で、(0文字目+1文字目+2文字目+3文字目)と(5文字目+6文字目+7文字目+8文字目)が一致しないことをチェックしています。9a0: ba 56 55 55 55 mov edx,0x555555569a5: 89 f0 mov eax,esi #eax=10文字目+11文字目+12文字目+13文字目9a7: f7 ea imul edx #eax=eax×edx、edxは桁あふれ9a9: c1 fe 1f sar esi,0x1f #右31ビットシフト9ac: 29 f2 sub edx,esi9ae: 44 39 da cmp edx,r11d9b1: 75 05 jne 9b8 #edxと0文字目+1文字目+2文字目+3文字目が一致しないとNG
9b3: 45 39 eb cmp r11d,r13d9b6: 75 0a jne 9c2 #0文字目+1文字目+2文字目+3文字目と5文字目+6文字目+7文字目+8文字目が一致しなければOK
9c2: 48 8d 74 24 30 lea rsi,[rsp+0x30] #10文字目9c7: 48 8d 7c 24 10 lea rdi,[rsp+0x10] #0文字目9cc: e8 49 fd ff ff call 71a <sameAtIndex>
9e0: 48 8d 74 24 40 lea rsi,[rsp+0x40] #15文字目9e5: 48 8d 7c 24 20 lea rdi,[rsp+0x20] #5文字目9ea: e8 2b fd ff ff call 71a <sameAtIndex>
合っているようなのでmd5ハッシュ値を求めてsubmitしますがフラグではないようです。$ ./chal_re_med.so 1234_5678_6789_4567You entered it right! Congratulations
他にもいくらでも条件を満たす入力値があります。UUTCTF{26973e24d232cc103a9e778554193cb3}
$ ./chal_re_med.so 2341_5678_6789_4567You entered it right! Congratulations$ ./chal_re_med.so 3333_6666_9999_5577You entered it right! Congratulations
Find The Password
25
Run the application and find the password.
.NetアプリケーションなのでILSpyで逆コンパイルします。Form2のリソースのPictureBox1.Imageの画像データにフラグが記載されています。$ file FindThePassword.exeFindThePassword.exe: PE32 executable (GUI) Intel 80386 Mono/.Net assembly, for MS Windows
UUTCTF{6DEE35B953027DEBE077E05BBE7E488F8AB335C4}
Web WarmUp
10
Literally, find the flag!
UUTCTF{P0SCon: Welcome to UUTCTF! Happy hacking ;)}です。
Layers
50
Layers are here.
フラグは、$ strings Layers.jpg | grep uutctf" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c067 79.157747, 2015/03/30-23:40:42 "> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmp:CreatorTool="Adobe Photoshop CC 2015 (Windows)" xmp:CreateDate="2019-04-24T19:13:26+04:30" xmp:MetadataDate="2019-04-24T19:13:26+04:30" xmp:ModifyDate="2019-04-24T19:13:26+04:30" xmpMM:InstanceID="xmp.iid:6e14b5a5-6194-4e4a-b78e-f71bbb92395f" xmpMM:DocumentID="adobe:docid:photoshop:39915134-669f-11e9-8555-e8884e2d43b9" xmpMM:OriginalDocumentID="xmp.did:e3606230-6b16-8a49-975e-c9718a22e944" photoshop:ColorMode="3" photoshop:ICCProfile="sRGB IEC61966-2.1" dc:format="image/jpeg"> <xmpMM:History> <rdf:Seq> <rdf:li stEvt:action="created" stEvt:instanceID="xmp.iid:e3606230-6b16-8a49-975e-c9718a22e944" stEvt:when="2019-04-24T19:13:26+04:30" stEvt:softwareAgent="Adobe Photoshop CC 2015 (Windows)"/> <rdf:li stEvt:action="saved" stEvt:instanceID="xmp.iid:6e14b5a5-6194-4e4a-b78e-f71bbb92395f" stEvt:when="2019-04-24T19:13:26+04:30" stEvt:softwareAgent="Adobe Photoshop CC 2015 (Windows)" stEvt:changed="/"/> </rdf:Seq> </xmpMM:History> <photoshop:TextLayers> <rdf:Bag> <rdf:li photoshop:LayerName="uutctf{can_you_see_me}" photoshop:LayerText="uutctf{can_you_see_me}"/> </rdf:Bag>
uutctf{can_you_see_me}です。
The Puzzle
75
Solve the puzzle!
from PIL import Image, ImageSequencefrom pyzbar.pyzbar import decodeim = Image.open('1.png')data = decode(im)print(data[0][0].decode('utf-8', 'ignore'))
Base64でデコードします。$ python aaa.pyVVVUQ1RGe21kNShJX2wwVjNfcEw0eTFOZ19QdVp6MWVTKX0=
フラグは、$ python aaa.py | base64 -dUUTCTF{md5(I_l0V3_pL4y1Ng_PuZz1eS)}
です。UUTCTF{9ad589e4c948c9ecd46bf2c55c3049b5}
Solve the Crypto
25
Solve this Crypto and find the flag.
opensslコマンドで復号します。$ python RsaCtfTool.py --publickey pub.key --private > priv.key
$ openssl rsautl -decrypt -in enc.message -inkey priv.keySGllcl9pc3RfZGVpbmVfRmxhZ2dl
$ openssl rsautl -decrypt -in enc.message -inkey priv.key | base64 -dHier_ist_deine_Flagge
UUTCTF{Hier_ist_deine_Flagge}
ダウンロードしたファイルをobjdumpコマンドで逆アセンブルします。One Bite
Rev60465Whenever I have friends over, I love to brag about things that I can eat in a single bite. Can you give this program a tasty flag that fits the bill?
/problems/2019/one_bite
入力文字列を1文字ずつ0x3cとXORを取っています。その値と文字列比較しています。$ objdump -s -D -M intel one_bite >aaa.txt
4006fa: 83 f0 3c xor eax,0x3c #(略)400723: 48 c7 45 b8 20 08 40 mov QWORD PTR [rbp-0x48],0x400820 #]_HZGUcHTURWcUQc[SUR[cHSc^YcOU_WA40072a: 0040072b: 48 8b 55 b8 mov rdx,QWORD PTR [rbp-0x48]40072f: 48 8d 45 c0 lea rax,[rbp-0x40]400733: 48 89 d6 mov rsi,rdx400736: 48 89 c7 mov rdi,rax400739: e8 52 fe ff ff call 400590 <strcmp@plt>
s = ']_HZGUcHTURWcUQc[SUR[cHSc^YcOU_WA'key = 0x3cflag = ''for c in s:flag += chr(ord(c) ^ key)print(flag)
です。actf{i_think_im_going_to_be_sick}