Guest User

Untitled

a guest
Dec 10th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. # s3my0n
  4.  
  5. import socket, sys, struct
  6.  
  7. host = socket.gethostbyname("vortex.labs.overthewire.org")
  8. port = 5842
  9.  
  10. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  11.  
  12. s.connect((host, port))
  13.  
  14. sum = 0
  15. for i in xrange(4):
  16.     data = s.recv(4)
  17.     sum += struct.unpack('<I',data)[0]
  18.  
  19. packed = struct.pack("<I", sum)
  20. s.send(packed)
  21. print s.recv(1024)
  22. s.close()
Add Comment
Please, Sign In to add comment