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/modules/payloads/singles/generic/custom.rb
Views: 11766
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##456module MetasploitModule78CachedSize = 0910include Msf::Payload::Single11include Msf::Payload::Generic1213def initialize(info = {})14super(merge_info(info,15'Name' => 'Custom Payload',16'Description' => 'Use custom string or file as payload. Set either PAYLOADFILE or17PAYLOADSTR.',18'Author' => 'scriptjunkie <scriptjunkie[at]scriptjunkie.us>',19'License' => MSF_LICENSE,20'Payload' =>21{22'Payload' => "" # not really23}24))2526# Register options27register_options(28[29OptString.new('PAYLOADFILE', [ false, "The file to read the payload from" ] ),30OptString.new('PAYLOADSTR', [ false, "The string to use as a payload" ] )31])32end3334#35# Construct the payload36#37def generate(_opts = {})38if datastore['ARCH']39self.arch = actual_arch40end4142if datastore['PAYLOADSTR']43datastore['PAYLOADSTR']44elsif datastore['PAYLOADFILE']45File.binread(datastore['PAYLOADFILE'])46else47''48end49end5051# Only accept the "none" encoder52def compatible_encoders53encoders = super()54encoders2 = []55encoders.each do |encname, encmod|56encoders2 << [encname, encmod] if encname.include? 'none'57end5859return encoders260end61end626364