레벨 해킹

 2839, 1/142 회원가입  로그인  
   dlddu
   gdb가 동작하지않습니다.

http://www.hackerschool.org/HS_Boards/zboard.php?AllArticle=true&no=3226 [복사]


[level11@ftz level11]$ ls -al
합계 96
drwxr-xr-x    4 root     level11      4096  3월 19  2003 .
drwxr-xr-x   44 root     root         4096  1월 15  2009 ..
-rw-r--r--    1 root     level11       245  1월 25  1999 .Xdefaults
-rw-------    1 root     root           40  3월 19  2003 .bash_history
-rw-r--r--    1 root     level11        24  2월 24  2002 .bash_logout
-rw-r--r--    1 root     level11       224  2월 24  2002 .bash_profile
-rw-r--r--    1 root     level11       151  2월 24  2002 .bashrc
-rw-r--r--    1 root     level11       400  1월 25  1999 .cshrc
-rw-r--r--    1 root     level11      4742  1월 25  1999 .emacs
-r--r--r--    1 root     level11       319  1월 25  1999 .gtkrc
-rw-r--r--    1 root     level11       100  1월 25  1999 .gvimrc
-rw-r--r--    1 root     level11       226  1월 25  1999 .muttrc
-rw-r--r--    1 root     level11       367  1월 25  1999 .profile
-rw-r--r--    1 root     root            1  5월  7  2002 .viminfo
-rw-r--r--    1 root     level11      4145  1월 25  1999 .vimrc
-rwsr-x---    1 level12  level11     13733  3월  8  2003 attackme
-rw-r-----    1 root     level11       168  3월  8  2003 hint
drwxr-xr-x    2 root     level11      4096  2월 24  2002 public_html
drwxrwxr-x    2 root     level11      4096  7월 30 02:40 tmp
[level11@ftz level11]$ gdb -d attackme
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu".
warning: /home/level11/attackme is not a directory.

(gdb) disass attackme
No symbol table is loaded.  Use the "file" command.
(gdb) disass /home/level11/attackme
A parse error in expression, near `/home/level11/attackme'.
(gdb) q
[level11@ftz level11]$ gdb -disass attackme
gdb: 인식할 수 없는 옵션 `-disass'
Use `gdb --help' for a complete list of options.
[level11@ftz level11]$ gdb disass attackme
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...disass: 그런 파일이나 디렉
토리가 없음.

"/home/level11/attackme" is not a core dump: File format not recognized
(gdb) q
[level11@ftz level11]$ gdb d attackme
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...d: 그런 파일이나 디렉토리가
없음.

"/home/level11/attackme" is not a core dump: File format not recognized
(gdb) q
[level11@ftz level11]$ gdb -d attackme
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu".
warning: /home/level11/attackme is not a directory.

(gdb) q
[level11@ftz level11]$ gdb -d ./attackme
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu".
warning: /home/level11/./attackme is not a directory.

(gdb) q
[level11@ftz level11]$ gdb disass ./attackme
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...disass: 그런 파일이나 디렉
토리가 없음.

"/home/level11/./attackme" is not a core dump: File format not recognized
(gdb) q
[level11@ftz level11]$ gdb disass /home/level11/attackme
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...disass: 그런 파일이나 디렉
토리가 없음.

"/home/level11/attackme" is not a core dump: File format not recognized
(gdb) Quit
[level11@ftz level11]$



분명히 저번엔 동작한것같은데.. 혹시 제가 사용을 잘못한걸까여?

잘못했다면 간단한 gdb사용법예제좀 써주시면 감사합니다.

  Hit : 6928     Date : 2011/08/05 04:53



    
늅늅 gdb -q 를 잘못적으신거같네요
.. 아닌가요.. ㅋㅋ
2011/08/05  
$Zero gdb로 파일을 여시고 disass attackme가 아니라 디스어셈블할 위치를 지정하셔야 합니다.

C언어로 작성된 코드라면 main함수가 존재할테니

disass main 이라고 쳐주셔야 합니다.

그럼 main함수의 흐름을 디스어셈블해서 보여주고 나머지 함수도 위와같은 방법으로 디스어셈블 할 수 있답니다.
2011/08/05  
늅늅 아항! ㅋㅋ 잘못봤었네요 2011/08/05  
dlddu $Zero // 그럼 전부 디어셈블 하려면 어떻게 해야되나여? 2011/08/05  
늅늅 C언어로 만들어진 프로그램이니 main함수를 디스어셈블하시면 됩니다~ 2011/08/05