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/egghunter.rb
Views: 11784
# -*- coding: binary -*-12require 'rex/exploitation/egghunter'34module Msf56###7#8# This mixin provides an interface to generating egghunters for various9# platforms using the Rex::Exploitation::Egghunter class.10#11# Originally written by skape12# BadChar support added by David Rude13# Updated to take the payload and options by Joshua J. Drake14#15###16module Exploit::Egghunter1718#19# Creates an instance of an exploit that uses an Egghunter overwrite.20#21def initialize(info = {})22super23end242526#27# Generates an egghunter stub based on the current target's architecture28# and operating system.29#30def generate_egghunter(payload, badchars = nil, opts = {})31# Prefer the target's platform/architecture information, but use32# the module's if no target specific information exists33los = target_platform34larch = target_arch || ARCH_X863536# If we found a platform list, then take the first platform37los = los.names[0] if (los.kind_of?(Msf::Module::PlatformList))3839# Use the first architecture if one was specified40larch = larch[0] if (larch.kind_of?(Array))4142if los.nil?43raise RuntimeError, "No platform restrictions were specified -- cannot select egghunter"44end4546badchars ||= payload_badchars4748egg = Rex::Exploitation::Egghunter.new(los, larch)49bunny = egg.generate(payload, payload_badchars, opts)5051if (bunny.nil?)52print_error("The egghunter could not be generated")53raise ArgumentError54end5556return bunny57end5859#60# Set the wfs_delay setting for all exploits using the Egghunter61#62def wfs_delay633064end6566end6768end697071