2005-07-10 09:42:49 +00:00
|
|
|
require 'msf/base'
|
|
|
|
|
|
|
|
module Msf
|
|
|
|
module Simple
|
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# Nop
|
|
|
|
# ---
|
|
|
|
#
|
|
|
|
# Simple nop wrapper class for performing generation.
|
|
|
|
#
|
|
|
|
###
|
2005-07-14 06:34:58 +00:00
|
|
|
module Nop
|
2005-07-10 09:42:49 +00:00
|
|
|
|
2005-07-15 22:30:04 +00:00
|
|
|
include Module
|
|
|
|
|
2005-07-10 09:42:49 +00:00
|
|
|
#
|
|
|
|
# Generate a nop sled, optionally with a few parameters.
|
|
|
|
#
|
|
|
|
# opts can have any of the standard nop generate sled options
|
|
|
|
# as well as:
|
|
|
|
#
|
|
|
|
# Format => The format to represent the data as: ruby, perl, c, raw
|
|
|
|
#
|
2005-07-14 06:34:58 +00:00
|
|
|
def self.generate_simple(nop, length, opts)
|
2005-07-10 09:42:49 +00:00
|
|
|
# Generate the nop sled using the options supplied
|
|
|
|
buf = nop.generate_sled(length, opts)
|
|
|
|
|
|
|
|
# Serialize the generated payload to some sort of format
|
|
|
|
return Buffer.transform(buf, opts['Format'] || 'raw')
|
|
|
|
end
|
|
|
|
|
2005-07-14 06:34:58 +00:00
|
|
|
#
|
|
|
|
# Calls the class method
|
|
|
|
#
|
|
|
|
def generate_simple(length, opts)
|
|
|
|
Msf::Simple::Nop.generate_simple(self, length, opts)
|
|
|
|
end
|
|
|
|
|
2005-07-10 09:42:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|