system hacking 16

드림핵 cmd_center 문제 풀이

문제 풀이 환경 : 구름ide1. 문제 파일 다운, 환경 분석문제 파일을 다운 받고 $ chmod +x cmd_center로 실행 권한을 부여했다.environment$ checksec cmd_center[*] '/workspace/C/cmd_center/cmd_center' Arch: amd64-64-little RELRO: Full RELRO Stack: No canary found NX: NX enabled PIE: PIE enabledFull RERLO, NX, PIE가 적용되어 있는 64비트 시스템임을 알 수 있다.2. 코드 분석#include #include #include #include void init() { setvb..

system hacking 2024.07.25

드림핵 sint 문제 풀이

문제 풀이 환경 : 구름ide1. 문제 파일 다운, 환경 분석$ chmod +x sint로 실행 권한을 부여했다.environmentUbuntu 16.04Arch: i386-32-littleRELRO: Partial RELROStack: No canary foundNX: NX enabledPIE: No PIE (0x8048000)문제에 환경이 주어져 있다.32비트 시스템에 NX와 partial RERLO가 적용되어 있다.2. 코드 분석, 취약점 분석#include #include #include #include void alarm_handler(){ puts("TIME OUT"); exit(-1);}void initialize(){ setvbuf(st..

system hacking 2024.07.24

드림핵 tcache_dup2 문제 풀이

문제 풀이 환경:구름ide1. 문제 파일 다운, 환경 분석문제 파일을 다운 받고 $ chmod +x tcache_dup2로 실행 권한을 부여했다.environment$ checksec tcache_dup2[*] '/workspace/1804/tcache_dup2/tcache_dup2' Arch: amd64-64-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: No PIE (0x400000)checksec로 확인해보면 문제에서 주어진 환경과 실제 바이너리 파일의 환경이 다르다.실제로는 64비트 시스템에 NX, canary, partial RELRO가 적용되어 있다.2. ..

system hacking 2024.07.23

드림핵 tcache_dup 문제 풀이

1. 문제 파일 다운, 환경 분석$ chmod +x tcache_dup로 실행 권한을 부여했다.envrionmentUbuntu 18.04Arch: amd64-64-littleRELRO: Partial RELROStack: Canary foundNX: NX enabledPIE: No PIE (0x400000)Partial RELRO, Canary, NX가 적용되어 있음을 알 수 있다.2. 코드 분석// gcc -o tcache_dup tcache_dup.c -no-pie#include #include #include #include char *ptr[10];void alarm_handler() { exit(-1);}void initialize() { setv..

system hacking 2024.07.22

드림핵 basic_exploitation_003 문제풀이

1. 문제 파일 다운, 환경 파악문제 파일을 다운받고 $ chmod +x basic_exploitation_003로 실행 권한을 부여했다.environmentUbuntu 16.04Arch: i386-32-littleRELRO: Partial RELROStack: No canary foundNX: NX enabledPIE: No PIE (0x8048000)문제에 주어진 환경을 보면 NX만 적용되어 있는 32비트 시스템임을 알 수 있다.2. 코드, 취약점 분석#include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1);}void initialize() { setv..

system hacking 2024.07.16

드림핵 basic_exploitation_002 문제 풀이

1. 문제 파일 다운, 환경 확인문제를 다운 받고 $ chmod +x basic_exploitation_002로 파일에 실행 권한을 부여했다.environmentArch: i386-32-littleRELRO: Partial RELROStack: No canary foundNX: NX enabledPIE: No PIE (0x8048000)nx만 적용되어 있는 32비트 시스템이다.2. 코드, 취약점 분석#include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1);}void initialize() { setvbuf(stdin, NULL, _IONBF, 0); ..

system hacking 2024.07.15

드림핵 hook 문제 풀이

문제 풀이 환경 : 구름 ide1. 문제 파일 다운, 환경 분석문제 파일을 다운 받고 $ chmod +x hook로 실행 권한을 부여했다.환경은 문제에 제시되어 있다.environmentUbuntu 16.04Arch: amd64-64-littleRELRO: Full RELROStack: Canary foundNX: NX enabledPIE: No PIE (0x400000)PIE를 제외하고 RELRO, canary, NX가 적용되어 있음을 알 수 있다.2. 코드 분석// gcc -o init_fini_array init_fini_array.c -Wl,-z,norelro#include #include #include #include void alarm_handler() ..

system hacking 2024.07.11

드림핵 oneshot 문제 풀이

문제 풀이 환경 : 구름ide1. 문제 파일 다운, 환경 분석먼저 chmod +x oneshot으로 다운 받은 파일에 실행 권한을 부여해줬다.문제 풀이 환경은 문제에 제시되어 있다.envrionmentUbuntu 16.04Arch: amd64-64-littleRELRO: Partial RELROStack: No canary foundNX: NX enabledPIE: PIE enabledcanary는 적용되어 있지 않고 Partial RELRO, NX, PIE가 적용되어 있음을 알 수 있다.또, 우분투 16.04 환경이었는데 구름 ide에서는 docker file 실행이 안 되기 때문에 설정이 까다로워서로컬에서 시도하지 않고 바로 서버에 익스플로잇을 시도했다.2. 코드..

system hacking 2024.07.09

드림핵 basic_rop_x86 문제 풀이

문제 풀이 환경 : 구름ide1. 환경 파악$ chmod +x basic_rop_x86으로 실행 권한을 부여했다.$ checksec baisc_rop_x86으로 환경을 파악했다. 문제에도 주어져있다.environmentArch: i386-32-littleRELRO: Partial RELROStack: No canary foundNX: NX enabledPIE: No PIE (0x8048000)NX가 적용되어 있는 32비트 시스템임을 알 수 있다.2. 취약점 분석, 익스플로잇 설계#include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1);}void initializ..

system hacking 2024.07.07