Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/msf/core/exploit/omelet.rb
Views: 11784
# -*- coding: binary -*-12require 'rex/exploitation/omelet'34module Msf56###7#8# This mixin provides an interface to generating eggs-to-omelet hunters for win/x869# platforms using the Rex::Exploitation::Omelet class.10#11# written by corelanc0d3r <peter.ve [at] corelan.be>12#13###14module Exploit::Omelet1516#17# Creates an instance of an exploit that uses an Omelet overwrite.18#19def initialize(info = {})20super21end222324#25# Generates an omelet hunter stub and eggs26#27def generate_omelet(payload, badchars = nil, opts = {})28# Prefer the target's platform/architecture information, but use29# the module's if no target specific information exists30los = target_platform31larch = target_arch || ARCH_X863233# If we found a platform list, then take the first platform34los = los.names[0] if (los.kind_of?(Msf::Module::PlatformList))3536# Use the first architecture if one was specified37larch = larch[0] if (larch.kind_of?(Array))3839if los.nil?40raise RuntimeError, "No platform restrictions were specified -- cannot select omelet hunter"41end4243badchars ||= payload_badchars4445omelet = Rex::Exploitation::Omelet.new(los, larch)46scrambledeggs = omelet.generate(payload, badchars, opts)4748if (scrambledeggs.nil?)49print_error("The omelet hunter could not be generated")50raise ArgumentError51end5253return scrambledeggs54end5556end5758end596061