-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevelx17.py
More file actions
35 lines (27 loc) · 794 Bytes
/
Levelx17.py
File metadata and controls
35 lines (27 loc) · 794 Bytes
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
31
32
33
34
35
from pwn import *
import base64
from PIL import Image
import io
HOST = "temperance.hackmyvm.eu"
PORT = 9988
context.proxy = (socks.SOCKS5, "localhost", 7891)
s = remote(HOST, PORT)
log.success("Receiving Introduction")
data_introduction = s.recv(1024)
print(data_introduction)
# send level information
s.send(b"levelx17")
log.success("Receiving Challenge")
data_chall = s.recv(1024)
print(data_chall)
data_chall = base64.b64decode(data_chall.decode())
data_chall_img = io.BytesIO(data_chall)
data_chall_img = Image.open(data_chall_img)
data_chall = str(data_chall_img.getpixel((0, 0))[3]).encode()
print(data_chall)
log.success("Sending Challenge")
s.send(data_chall)
# Receive the flag / Recibe la flag.
log.success("Receiving Flag")
data_flag = s.recv(1024)
print(data_flag.decode())