Lab2
This commit is contained in:
20
pa/lab2/chall_pwntools_sockets.py
Normal file
20
pa/lab2/chall_pwntools_sockets.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from pwn import *
|
||||
|
||||
HOST = "mustard.stt.rnl.tecnico.ulisboa.pt"
|
||||
PORT = 25055
|
||||
|
||||
conn = remote(HOST, PORT)
|
||||
line = conn.recvline_contains(b"until").decode('utf-8')
|
||||
|
||||
target = line[54:-1]
|
||||
current = "0"
|
||||
print("Target:", target)
|
||||
|
||||
while target != current:
|
||||
conn.send(b"MORE\n")
|
||||
new = conn.recvline_contains(b"Here you have").decode('utf-8')[15:]
|
||||
current = str(int(current) + int(new))
|
||||
print("New:", new, "Current:", current)
|
||||
|
||||
conn.send(b"FINISH\n")
|
||||
print(conn.recvall().decode('utf-8'))
|
||||
Reference in New Issue
Block a user