Changed up the way mixins are handled, all exploits just require 'msf/core' and

all current mixins will be loaded. Egghunter was moved to a mixin and generates
based on target arch and platform.


git-svn-id: file:///home/svn/incoming/trunk@3111 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2005-11-26 00:04:26 +00:00
parent c22ba98ad6
commit fb8b56f55f
20 changed files with 57 additions and 42 deletions

View File

@ -7,23 +7,6 @@
module Msf
#
# Architecture constants
#
ARCH_ANY = '_any_'
ARCH_X86 = 'x86'
ARCH_MIPS = 'mips'
ARCH_PPC = 'ppc'
ARCH_SPARC = 'sparc'
ARCH_TYPES =
[
ARCH_X86,
ARCH_MIPS,
ARCH_PPC,
ARCH_SPARC
]
ARCH_ALL = ARCH_TYPES
#
# Module types
#

View File

@ -193,11 +193,24 @@ class Exploit < Msf::Module
end
require 'msf/core/exploit/brute'
require 'msf/core/exploit/tcp'
require 'msf/core/exploit/dcerpc'
require 'msf/core/exploit/smb'
#
# All exploit mixins should be added to the list below
#
# Behavior
require 'msf/core/exploit/brute'
# Payload
require 'msf/core/exploit/egghunter'
require 'msf/core/exploit/seh'
# Protocol
require 'msf/core/exploit/tcp'
require 'msf/core/exploit/smb'
require 'msf/core/exploit/ftp'
require 'msf/core/exploit/http'
require 'msf/core/exploit/dcerpc'
#
# Creates an instance of the exploit module. Mad skillz.
#

View File

@ -10,6 +10,9 @@ module Rex
###
module Arch
#
# Architecture classes
#
require 'rex/arch/x86'
require 'rex/arch/sparc'

View File

@ -60,3 +60,19 @@ LEV_2 = 2
LEV_3 = 3
#
# Architecture constants
#
ARCH_ANY = '_any_'
ARCH_X86 = 'x86'
ARCH_MIPS = 'mips'
ARCH_PPC = 'ppc'
ARCH_SPARC = 'sparc'
ARCH_TYPES =
[
ARCH_X86,
ARCH_MIPS,
ARCH_PPC,
ARCH_SPARC
]
ARCH_ALL = ARCH_TYPES

View File

@ -1,4 +1,5 @@
require 'rex/text'
require 'rex/arch'
module Rex
module Exploitation
@ -23,7 +24,7 @@ class Egghunter
Alias = "win"
module X86
Alias = "x86"
Alias = ARCH_X86
#
# The egg hunter stub for win/x86.

View File

@ -16,7 +16,7 @@ class Rex::Exploitation::Egghunter::UnitTest < Test::Unit::TestCase
r = Klass.new('win')
assert_nil(r.generate)
r = Klass.new('win', 'x86')
r = Klass.new('win', Rex::Arch::ARCH_X86)
assert_not_nil(r.generate)
assert_not_nil(r.generate[0])
assert_not_nil(r.generate[1])

View File

@ -1,3 +1,4 @@
require 'msf/core'
module Msf

View File

@ -1,4 +1,4 @@
require 'msf/core/exploit/ftp'
require 'msf/core'
module Msf

View File

@ -1,5 +1,4 @@
require 'msf/core/exploit/seh'
require 'msf/core/exploit/http'
require 'msf/core'
module Msf

View File

@ -1,4 +1,4 @@
require 'msf/core/exploit/ftp'
require 'msf/core'
module Msf

View File

@ -1,4 +1,4 @@
require 'msf/core/exploit/ftp'
require 'msf/core'
module Msf

View File

@ -1,4 +1,3 @@
require 'msf/core'
module Msf

View File

@ -1,4 +1,4 @@
require 'msf/core/exploit/ftp'
require 'msf/core'
module Msf

View File

@ -1,4 +1,4 @@
require 'msf/core/exploit/ftp'
require 'msf/core'
module Msf

View File

@ -1,4 +1,4 @@
require 'msf/core/exploit/ftp'
require 'msf/core'
module Msf

View File

@ -1,10 +1,11 @@
require 'msf/core/exploit/ftp'
require 'msf/core'
module Msf
class Exploits::Windows::Ftp::ServUMDTMOverflow < Msf::Exploit::Remote
include Exploit::Remote::Ftp
include Exploit::Remote::Egghunter
def initialize(info = {})
super(update_info(info,
@ -126,6 +127,8 @@ class Exploits::Windows::Ftp::ServUMDTMOverflow < Msf::Exploit::Remote
end
def exploit
p generate_egghunter
connect_login
print_status("Trying target #{target.name}...")

View File

@ -1,4 +1,4 @@
require 'msf/core/exploit/ftp'
require 'msf/core'
module Msf

View File

@ -1,4 +1,4 @@
require 'msf/core/exploit/ftp'
require 'msf/core'
module Msf

View File

@ -1,4 +1,4 @@
require 'msf/core/exploit/ftp'
require 'msf/core'
module Msf

View File

@ -1,14 +1,11 @@
require 'rex/exploitation/egghunter'
require 'msf/core/exploit/http'
require 'msf/core'
module Msf
class Exploits::Windows::MS03_020_Ie_ObjectType < Msf::Exploit::Remote
#
# This module acts as an HTTP server
#
include Exploit::Remote::HttpServer
include Exploit::Remote::Egghunter
def initialize(info = {})
super(update_info(info,
@ -78,7 +75,7 @@ class Exploits::Windows::MS03_020_Ie_ObjectType < Msf::Exploit::Remote
# Pack the values
ret = [ ret ].pack('V')
clean = [ clean ].pack('V')
hunter = Rex::Exploitation::Egghunter.new('win', 'x86').generate(payload_badchars)
hunter = generate_egghunter()
egg = hunter[1]
# Now, build out the HTTP response payload