#!/usr/bin/python
# net3 is close source challenge, so - just reverse engineer this.
from socket import *
from sys import argv

PORT = 2996
def main(host):
	solution = "\x17\x05net3\x00\x0dawesomesauce\x00\x09password\x00"
	s = socket()
	s.connect((host,PORT))
	s.settimeout(5)
	print "Connected to host.."

	s.send("\x00" + chr(len(solution)))
	s.send(solution)
	print "recv data.."
	d = s.recv(1024) 
	print d



if __name__ == '__main__':
	if len(argv) > 1:
		main(argv[1])
	else:
		print "usage : %s <ip addr>" % argv[0]
