Nets

solutions to the net levels of protostar

heap0

http://exploit-exercises.com/protostar/net0

import socket, re, struct

HOST = '127.0.0.1'
PORT = 2999
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))

# get the welcome message
data = s.recv(1024)

# extract the number an convert it
number = re.findall(r'\'[0-9]*\'',data)[0][1:-1:]
number_int = int(number)
number_pack = struct.pack('l',number_int)

# just some nice prints
print number
print number_int
print number_pack

# send the number back to the server
s.sendall(number_pack)

# check the answer
data = s.recv(1024)
print data
s.close()
project/exploits/nets.txt · Zuletzt geändert: 2012/05/25 14:46 von 89.204.153.113