Module: Msf::Exploit::Omelet

Defined in:
lib/msf/core/exploit/omelet.rb

Overview

This mixin provides an interface to generating eggs-to-omelet hunters for win/x86 platforms using the Rex::Exploitation::Omelet class.

written by corelanc0d3r <peter.ve [at] corelan.be>

Instance Method Summary collapse

Instance Method Details

#generate_omelet(payload, badchars = nil, opts = {}) ⇒ Object

Generates an omelet hunter stub and eggs



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/msf/core/exploit/omelet.rb', line 28

def generate_omelet(payload, badchars = nil, opts = {})
  # 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

  # If we found a platform list, then take the first platform
  los   = los.names[0] if (los.kind_of?(Msf::Module::PlatformList))

  # Use the first architecture if one was specified
  larch = larch[0] if (larch.kind_of?(Array))

  if los.nil?
    raise RuntimeError, "No platform restrictions were specified -- cannot select omelet hunter"
  end

  badchars ||= payload_badchars

  omelet   = Rex::Exploitation::Omelet.new(los, larch)
  scrambledeggs = omelet.generate(payload, badchars, opts)

  if (scrambledeggs.nil?)
    print_error("The omelet hunter could not be generated")
    raise ArgumentError
  end

  return scrambledeggs
end

#initialize(info = {}) ⇒ Object

Creates an instance of an exploit that uses an Omelet overwrite.



20
21
22
# File 'lib/msf/core/exploit/omelet.rb', line 20

def initialize(info = {})
  super
end