yoyoyoyoyoy
git-svn-id: file:///home/svn/incoming/trunk@2580 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
8f430b85fa
commit
b5bd0b22aa
|
@ -16,10 +16,7 @@ class Msf::Module::Target
|
|||
def self.from_a(ary)
|
||||
return nil if (ary.length < 2)
|
||||
|
||||
t = self.new(ary.shift, ary.shift)
|
||||
t.opts = ary
|
||||
|
||||
return t
|
||||
self.new(ary.shift, ary.shift)
|
||||
end
|
||||
|
||||
#
|
||||
|
@ -29,13 +26,27 @@ class Msf::Module::Target
|
|||
Rex::Transformer.transform(src, Array, [ self, String ], 'Target')
|
||||
end
|
||||
|
||||
def initialize(name, platforms, *opts)
|
||||
#
|
||||
# Init it up!
|
||||
#
|
||||
def initialize(name, opts)
|
||||
opts = {} if (!opts)
|
||||
|
||||
self.name = name
|
||||
self.platforms = Msf::Module::PlatformList.from_a(platforms)
|
||||
self.platforms = Msf::Module::PlatformList.from_a(opts['Platform'])
|
||||
self.ret = opts['Ret']
|
||||
self.opts = opts
|
||||
end
|
||||
|
||||
#
|
||||
# Index the options directly
|
||||
#
|
||||
def [](key)
|
||||
opts[key]
|
||||
end
|
||||
|
||||
attr_accessor :name, :platforms, :opts
|
||||
attr_accessor :ret
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -9,12 +9,16 @@ module Msf
|
|||
|
||||
class Module::Target::UnitTest < Test::Unit::TestCase
|
||||
def test_target
|
||||
t = Target.from_a([ 'Universal', 'winxpsp0', 0x12345678 ])
|
||||
t = Target.from_a(['Universal', {
|
||||
'Platform' => 'winxpsp0',
|
||||
'Ret' => 0x12345678
|
||||
}])
|
||||
|
||||
assert_equal('Universal', t.name)
|
||||
assert_equal(true, t.platforms.supports?(Msf::Module::PlatformList.transform('winxpsp0')))
|
||||
assert_equal(false, t.platforms.supports?(Msf::Module::PlatformList.transform('winxpsp1')))
|
||||
assert_equal(0x12345678, t.opts[0])
|
||||
assert_equal(0x12345678, t['Ret'])
|
||||
assert_equal(0x12345678, t.ret)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -30,16 +30,20 @@ class Exploit::Remote::MSRPC_DCOM_MS03_026 < Msf::Exploit::Remote
|
|||
# Target 0: Universal
|
||||
[
|
||||
'Windows NT SP3-6a/2000/XP/2003 Universal',
|
||||
# [ 'winnt', 'win2000', 'winxp', 'win2003' ],
|
||||
[ ],
|
||||
0x74ff16f3, # Windows NT 4.0 SP3/4 (pop pop ret) rnr20.dll
|
||||
0x776a240d, # Windows NT 4.0 SP5 (eax) ws2help.dll
|
||||
0x77f33723, # Windows NT 4.0 SP6a (esp)
|
||||
0x7ffde0eb, # Windows 2000 writable address + jmp+0xe0
|
||||
0x0018759f, # Windows 2000 Universal (ebx)
|
||||
0x01001c59, # Windows XP | XP SP0/SP1 (pop/pop/ret)
|
||||
0x001b0b0b, # Windows 2003 call near [ebp+0x30] (unicode.nls)
|
||||
]
|
||||
{
|
||||
'Platform' => 'win',
|
||||
'Rets' =>
|
||||
[
|
||||
0x74ff16f3, # Windows NT 4.0 SP3/4 (pop pop ret) rnr20.dll
|
||||
0x776a240d, # Windows NT 4.0 SP5 (eax) ws2help.dll
|
||||
0x77f33723, # Windows NT 4.0 SP6a (esp)
|
||||
0x7ffde0eb, # Windows 2000 writable address + jmp+0xe0
|
||||
0x0018759f, # Windows 2000 Universal (ebx)
|
||||
0x01001c59, # Windows XP | XP SP0/SP1 (pop/pop/ret)
|
||||
0x001b0b0b, # Windows 2003 call near [ebp+0x30] (unicode.nls)
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
'DefaultTarget' => 0)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue