Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/usr/bin/python
  2.  
  3. from socket import *
  4. from struct import *
  5. import struct
  6.  
  7. bit = struct.calcsize("P") * 8
  8.  
  9. if (bit ==32):
  10.     porta=24000
  11. else:
  12.     porta=24001
  13.  
  14. s = socket(AF_INET, SOCK_STREAM)
  15. s.connect(('semtex.labs.overthewire.org', porta))
  16.  
  17.  
  18. f=open('file','wb')
  19. i=1
  20. while 1:
  21.     a = s.recv(1)
  22.     if (i%2 == 0):
  23.         i += 1
  24.     else:
  25.         if not a:
  26.             break;
  27.         else:
  28.             i += 1
  29.             f.write(a)
  30. f.close()
  31. print i
  32. s.close()