--help 쳐보면

많이 쓰는 옵션은

-D 옵션 -X 옵션 등이 있다



Usage: objdump <option(s)> <file(s)>

 Display information from object <file(s)>.

 At least one of the following switches must be given:

  -a, --archive-headers    Display archive header information

  -f, --file-headers       Display the contents of the overall file header

  -p, --private-headers    Display object format specific file header contents

  -P, --private=OPT,OPT... Display object format specific contents

  -h, --[section-]headers  Display the contents of the section headers

  -x, --all-headers        Display the contents of all headers

  -d, --disassemble        Display assembler contents of executable sections

  -D, --disassemble-all    Display assembler contents of all sections

  -S, --source             Intermix source code with disassembly

  -s, --full-contents      Display the full contents of all sections requested

  -g, --debugging          Display debug information in object file

  -e, --debugging-tags     Display debug information using ctags style

  -G, --stabs              Display (in raw form) any STABS info in the file

  -W[lLiaprmfFsoRt] or

  --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,

          =frames-interp,=str,=loc,=Ranges,=pubtypes,

          =gdb_index,=trace_info,=trace_abbrev,=trace_aranges]

                           Display DWARF info in the file

  -t, --syms               Display the contents of the symbol table(s)

  -T, --dynamic-syms       Display the contents of the dynamic symbol table

  -r, --reloc              Display the relocation entries in the file

  -R, --dynamic-reloc      Display the dynamic relocation entries in the file

  @<file>                  Read options from <file>

  -v, --version            Display this program's version number

  -i, --info               List object formats and architectures supported

  -H, --help               Display this information


 The following switches are optional:

  -b, --target=BFDNAME           Specify the target object format as BFDNAME

  -m, --architecture=MACHINE     Specify the target architecture as MACHINE

  -j, --section=NAME             Only display information for section NAME

  -M, --disassembler-options=OPT Pass text OPT on to the disassembler

  -EB --endian=big               Assume big endian format when disassembling

  -EL --endian=little            Assume little endian format when disassembling

      --file-start-context       Include context from start of file (with -S)

  -I, --include=DIR              Add DIR to search list for source files

  -l, --line-numbers             Include line numbers and filenames in output

  -F, --file-offsets             Include file offsets when displaying information

  -C, --demangle[=STYLE]         Decode mangled/processed symbol names

                                  The STYLE, if specified, can be `auto', `gnu',

                                  `lucid', `arm', `hp', `edg', `gnu-v3', `java'

                                  or `gnat'

  -w, --wide                     Format output for more than 80 columns

  -z, --disassemble-zeroes       Do not skip blocks of zeroes when disassembling

      --start-address=ADDR       Only process data whose address is >= ADDR

      --stop-address=ADDR        Only process data whose address is <= ADDR

      --prefix-addresses         Print complete address alongside disassembly

      --[no-]show-raw-insn       Display hex alongside symbolic disassembly

      --insn-width=WIDTH         Display WIDTH bytes on a single line for -d

      --adjust-vma=OFFSET        Add OFFSET to all displayed section addresses

      --special-syms             Include special symbols in symbol dumps

      --prefix=PREFIX            Add PREFIX to absolute paths for -S

      --prefix-strip=LEVEL       Strip initial directory names for -S

      --dwarf-depth=N        Do not display DIEs at depth N or greater

      --dwarf-start=N        Display DIEs starting with N, at the same depth

                             or deeper



'시스템 > 리눅스 기본' 카테고리의 다른 글

glibc 소스코드  (0) 2016.12.27
백그라운드 실행 명령어  (0) 2016.10.20
라이브러리 참조순서  (0) 2016.10.15
알아두면 좋은 명령어 모음  (0) 2016.10.13
gdb layout  (0) 2016.10.13

root-me.org system writeup.docx


  1. #include <stdio.h>
  2. #include <unistd.h>
  3.  
  4. int main(int argc, char *argv[]){
  5. FILE *secret = fopen("/challenge/app-systeme/ch5/.passwd", "rt");
  6. char buffer[32];
  7. fgets(buffer, sizeof(buffer), secret);
  8. printf(argv[1]);
  9. fclose(secret);
  10. return 0;
  11. }


버퍼에 패스워드가 저장되므로
argv에 %8x를 넣어줘서 패스워드값ㅇ르 읽어오면된다



수상하게 긴 놈이 보인다

앞에는 0804b008인 쓸데없는 쓰레기값일 확률이 높으므로 그 뒤에 부터 봐보면


이거는 비밀번호 쳐보니까 안되더라


ㅇ왜냐하면

리틀에디안으로 저장되있어서 그렇다

4글자씩 거꾸로 읽어줘야한다

Dpa9d6)(Epam

이 답





solution에 들어가 다른사람 풀이를 보니 파이썬으로 코딩해놨따

  1. binary5@challenge02:~$ echo -e $(./binary5 $(ruby -e 'print "%08x"*150') | sed -r '
  2. # little-endian architecture, reorder bytes
  3. s/(..)(..)(..)(..)/\4\3\2\1/g
  4. # preceed every byte by \\x so it will be
  5. # interpreted by echo -e
  6. s/(..)/\\x&/g
  7. ' ) | grep -Pazo '[[:print:]]{13}\n'
  8. Dpa9d6)(Epamd


파이썬 정규식을 공부해봐야겠다


lob1~20writeup.pdf


 

gate부터 death_knight까지!


쪼끔 대충쓴거는 인정..ㅠ 

'war game > hackerschool lob' 카테고리의 다른 글

hackerschool lob 이미지파일 링크!  (0) 2016.10.14

https://www.exploit-db.com/exploits/25497/ 


IPADDR이랑

PORT정의해서 쓰면됨

'시스템 > 시스템 해킹' 카테고리의 다른 글

gdb peda 설치방법  (0) 2016.11.21
tip 정리  (0) 2016.11.18
버퍼오버플로우 문서  (0) 2016.10.13
환경변수에 쉘코드 넣기(에그쉘 정리)  (0) 2016.10.12
ROP exploit  (0) 2016.09.29

DYNAMIC_SECTION의 NEED가 설정된 라이브러리

LD_LIBRARY_PATH

/etc/ld.so.conf(동적로더 공유라이브러리를 로드하고 참조함수 확인)

/lib, /usr/lib와 같은 표준 라이브러리 경로


따라서 LD_LIBRARY_PATH를 이용해서 표준 라이브러리 함수들을 후킹할 수 있음



<혹시 궁금한 사람을 위한 참고(내가 헷갈렸음)>

헤더와 라이브러리

1. 라이브러리와 헤더는 엄연히 다릅니다. 라이브러리는 기계어로 번역된 바이너리이며, 헤더는 컴파일러가 컴파일하기전.. 그러니까 프로그래머가 알아먹을 수 있고 c/c++의 문법에 맞게 작성되어있는 선언들의 집합입니다.

라이브러리를 사용하기 위해서는 해당 라이브러리의 헤더파일이 있어야합니다. 그래야지만 링커가 알아먹을수 있는 심볼네임을 컴파일러가 만들어내기 때문입니다.

컴파일러가 이런 헤더파일을 가지고 심볼네임을 만들어서 오브젝트 파일에 넣어주면 링커가 해당 심볼네임을 가지고 라이브러리를 뒤져서 링크를 하게 됩니다.

헤더가 여러개 모이는게 라이브러리가 아닙니다. 라이브러리는 컴파일된 바이너리이므로 소스파일의 컴파일된 산물인 오브젝트(리눅스의 경우에는 .o , 윈도우의 경우에는 .obj)파일을 여러개 모아놓은게 라이브러리입니다.

라이브러리의 확장자는 리눅스의 경우에는 .a, 윈도우의 경우에는 .lib입니다.

2. 제가 리눅스를 많이 안써봐서 말씀하신 위치 이외에 라이브러리와 헤더가 들어가는지는 모르겠습니다. (물론 나열하신 위치 말고도 다른 위치를 컴파일러 옵션으로 지정이 가능합니다.)
다만 나열하신 위치에 들어있는 파일들이 라이브러리와 헤더들입니다..

3. visual c보다는 visual c++이라고 하셔야 맞을거 같습니다.. 물론 6.0, .net 2003 .net 2003, .net2005과 같이 여러버전이 존재합니다.

4. 일반적으로 표준 c라이브러리는 대부분의 c컴파일러가 지원합니다. 표준 함수를 알고 계시면 대부분의 컴파일러에서 동일하게 소스를 바꾸지 않고 컴파일이 가능합니다.

5. 컴파일러와 라이브러리는 별개입니다. 컴파일러를 설치하면 들어있는 표준 c라이브러리도 사실 없어도 프로그램이 컴파일되는데는 문제가 없습니다. 대신 직접 모든걸 다 해줘야하는게 문제입니다. c언어의 시작 함수가 main이지만 실제로는 이 main함수를 호출하기전에 해주는 것이 많습니다. 그런걸 직접 일일이 만들어줘야하는 것이죠..

그리고 라이브러리는 c표준 라이브러리 뿐만 아니라 누구든지 라이브러리로 구성하면 그게 다 라이브러리입니다.

https://kldp.org/node/84138


*깨알 팁 : 라이브러리 주소는 어떤 바이너리든 동일하다고 한다

'시스템 > 리눅스 기본' 카테고리의 다른 글

백그라운드 실행 명령어  (0) 2016.10.20
objdump 사용법  (0) 2016.10.18
알아두면 좋은 명령어 모음  (0) 2016.10.13
gdb layout  (0) 2016.10.13
find 명령어 정리  (0) 2016.09.30

디버깅관련


실행압축(-)

http://www.hackerschool.org/HS_Boards/data/Lib_system/20041109135245_NCSC_TR04025_malcode_analysis.pdf


소프트웨어 암호해제(_)

http://www.hackerschool.org/HS_Boards/data/Lib_system/kurt.txt


아이다 5.x메뉴얼(_)

http://www.hackerschool.org/HS_Boards/data/Lib_system/[AsmLove]IDA_5.x_Manual_07.02.pdf


후킹(_)

http://www.hackerschool.org/HS_Boards/data/Lib_system/[PowerHacker]Art_of_Hooking_2th_Edition.pdf


인텔문서



system hacking

leak

https://media.blackhat.com/bh-us-12/Briefings/Serna/BH_US_12_Serna_Leak_Era_Slides.pdf



bypass aslr

https://www.blackhat.com/presentations/bh-europe-09/Fritsch/Blackhat-Europe-2009-Fritsch-Bypassing-aslr-slides.pdf 



heap spray

http://agz.es/Reverse-Engineering/Buffer-Overflow/Heap%20Spray%20%5Bforce%5D.pdf



Reusing F Reusing Dynamic Linker For Exploitation

http://blackcon.tistory.com/attachment/cfile3.uf@25402048547742A0239402.pdf


window bof

http://research.hackerschool.org/data/WBOF/WBF.htm


bindshellcode

https://codinguy.net/2013/05/15/tcp-bind-shellcode/



SEH구조와 SEH overwrite

http://chfhrqnfrhc.tistory.com/entry/SEH-Structured-Exception-Handling-2-%EA%B6%81%EA%B8%88%ED%96%88%EB%8D%98-%EB%B6%80%EB%B6%84


+ Recent posts