overthewire vortex level 0

July 25th, 2010 by webstersprodigy

SPOILER. These games are awesome. Find them at http://www.overthewire.org.

#!/usr/bin/python

#edited so it doesn't quite work...

import socket
import struct

HOST='host'
PORT=1111
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST,PORT))

blob = ""
#no idea why 2 packets... but seems to be consistent
for i in range (0,2):
  data = s.recv(2048)
  blob = blob + data

print "DATA: ", data
print len(blob)
#blob should be 4 unsigned ints
intdata = struct.unpack("IIII", blob)
total=0
for i in intdata:
  total += i

myblob = struct.pack("I", total)
s.send(myblob)

pw = s.recv(1024)
print pw
s.close()

Tags: ,

Leave a Reply


No computers were harmed in the 0.183 seconds it took to produce this page.