rop

System Hacking Advanced

[dreamhack] basic_rop_x86

문제풀이└─# checksec basic_rop_x86[*] '/root/dream/rop32/basic_rop_x86' Arch: i386-32-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000)NX가 적용됐다. 메모리 공간에서 쉘코드를 실행하는 방식의 접근은 힘들어보인다. #include #include #include #include int main(int argc, char *argv[]) { char buf[0x40] = {}; initialize(); read(0, buf, 0x400); write(1..

System Hacking Advanced

[dreamhack] rop

ROP(Return Oriented Programming) ROP(Return Oriented Programming)ROP(Return Oriented Programming)ROP는 ASLR과 같은 메모리 보호기법을 우회하기 위한 공격기법으로 return이 포함된 코드 조각들인 가젯들을 이용해 system(“/bin/bash”)를 실행하는 프로그램을 해커가 임의keyme2003.tistory.com └─# checksec rop[*] '/root/dream/rop/rop' Arch: amd64-64-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: No PIE (0x40..

System Hacking Advanced

[dreamhack] Return to Library

문제분석#include #include const char* binsh = "/bin/sh";int main() { char buf[0x30]; setvbuf(stdin, 0, _IONBF, 0); setvbuf(stdout, 0, _IONBF, 0); // Add system function to plt's entry system("echo 'system@plt"); // Leak canary printf("[1] Leak Canary\n"); printf("Buf: "); read(0, buf, 0x100); printf("Buf: %s\n", buf); // Overwrite return address printf("[2] Overwrite return address\n"); ..

System Hacking Advanced

[dreamhack] basic_rop_x64

문제분석int main(int argc, char *argv[]) { char buf[0x40] = {}; initialize(); read(0, buf, 0x400); write(1, buf, sizeof(buf)); return 0;}○ 코드 분석buf[0x40] 선언read(0, buf, 0x400)buf에 0x400 크기 입력write(1, buf, sizeof(buf))buf 출력ROP 체인을 구성해서 system("/bin/sh")를 실행하는 것이 목표다. 필자는 풀이 과정에서 __libc_csu_init() 가젯을 활용할 예정이다. __libc_csu_init()에 대해서 공부하고자 해당 개념을 이용한 풀이를 작성했다. ○ JIT-ROP__libc_csu_init(..

keyme
'rop' 태그의 글 목록