Path: blob/master/modules/auxiliary/gather/citrix_published_applications.rb
19813 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Udp78def initialize(info = {})9super(10update_info(11info,12'Name' => 'Citrix MetaFrame ICA Published Applications Scanner',13'Description' => %q{14This module attempts to query Citrix Metaframe ICA server to obtain15a published list of applications.16},17'Author' => [ 'aushack' ],18'References' => [19[ 'URL', 'http://www.securiteam.com/exploits/5CP0B1F80S.html' ],20],21'Notes' => {22'Reliability' => UNKNOWN_RELIABILITY,23'Stability' => UNKNOWN_STABILITY,24'SideEffects' => UNKNOWN_SIDE_EFFECTS25}26)27)2829register_options(30[31Opt::RPORT(1604),32]33)34end3536def autofilter37false38end3940def run41connect_udp4243print_status("Attempting to contact Citrix ICA service...")4445client_connect =46"\x20\x00\x01\x30\x02\xfd\xa8\xe3\x00\x00\x00\x00\x00\x00\x00\x00" +47"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"4849# Server hello response50server_response =51"\x30\x00\x02\x31\x02\xfd\xa8\xe3\x02\x00\x06\x44"5253udp_sock.put(client_connect)54res = udp_sock.get(3)5556if (res[0, server_response.length] == server_response)57print_status("Citrix MetaFrame ICA server detected. Requesting Published Applications list...")5859find_published =60"\x2a\x00\x01\x32\x02\xfd\xa8\xe3\x00\x00\x00\x00\x00\x00\x00\x00" +61"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x21\x00\x02\x00" +62"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"63server_list_pre =64"\xea\x00\x04\x33\x02\xfd\xa8\xe3\x02\x00\x06\x44\xac\x1f\x03\x1f" +65"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00" +66"\x0b\x00\x28\x00\x00\x00\x00\x00"6768udp_sock.put(find_published)69res = udp_sock.get(3)7071if (res.index(server_list_pre) == 0) # good packet, with following data72print_status("Citrix Applications Reported:\r\n" + res[server_list_pre.length, res.length].gsub("\x00", "\r\n"))73end74else75print_error("Citrix did not report any Published Applications. Try the brute force module instead.")76end7778disconnect_udp79end80end818283