1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-12 11:52:01 +01:00
git-svn-id: file:///home/svn/framework3/trunk@4435 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
Matt Miller 2007-02-18 12:08:11 +00:00
parent 8a70cb35ca
commit d4a739f85a

View File

@ -23,13 +23,19 @@ module Exploit::Egghunter
# and operating system.
#
def generate_egghunter
os = target['Platform']
arch = target.arch
# Prefer the target's platform/architecture information, but use
# the module's if no target specific information exists
los = target_platform
larch = target_arch || ARCH_X86
arch ||= ARCH_X86
os ||= 'win'
# If we found a platform list, then take the first platform
los = los.names[0] if (los.kind_of?(Msf::Module::PlatformList))
if los.nil?
raise RuntimeError, "No platform restrictions were specified -- cannot select egghunter"
end
egg = Rex::Exploitation::Egghunter.new(os, arch)
egg = Rex::Exploitation::Egghunter.new(los, larch)
bunny = egg.generate(payload_badchars)
if (bunny.nil?)