handle Ruby 2.4 Fixnum/Bignum -> Integer deprecations
parent
68816f6c5e
commit
f69b4a330e
|
@ -1128,11 +1128,11 @@ class EncodedData
|
|||
((val + len - 1) / len).to_i * len
|
||||
end
|
||||
|
||||
# concatenation of another +EncodedData+ (or nil/Fixnum/anything supporting String#<<)
|
||||
# concatenation of another +EncodedData+ (or nil/Integer/anything supporting String#<<)
|
||||
def <<(other)
|
||||
case other
|
||||
when nil
|
||||
when ::Fixnum
|
||||
when ::Integer
|
||||
fill
|
||||
@data = @data.to_str if not @data.kind_of? String
|
||||
@data << other
|
||||
|
|
|
@ -33,7 +33,7 @@ module Metasploit
|
|||
attr_accessor :john_path
|
||||
|
||||
# @!attribute max_runtime
|
||||
# @return [Fixnum] An optional maximum duration of the cracking attempt in seconds
|
||||
# @return [Integer] An optional maximum duration of the cracking attempt in seconds
|
||||
attr_accessor :max_runtime
|
||||
|
||||
# @!attribute pot
|
||||
|
|
|
@ -19,7 +19,7 @@ module Metasploit
|
|||
# @return [Object] The framework module caller, if availale
|
||||
attr_accessor :framework_module
|
||||
# @!attribute connection_timeout
|
||||
# @return [Fixnum] The timeout in seconds for a single SSH connection
|
||||
# @return [Integer] The timeout in seconds for a single SSH connection
|
||||
attr_accessor :connection_timeout
|
||||
# @!attribute cred_details
|
||||
# @return [CredentialCollection] Collection of Credential objects
|
||||
|
@ -28,13 +28,13 @@ module Metasploit
|
|||
# @return [String] The IP address or hostname to connect to
|
||||
attr_accessor :host
|
||||
# @!attribute port
|
||||
# @return [Fixnum] The port to connect to
|
||||
# @return [Integer] The port to connect to
|
||||
attr_accessor :port
|
||||
# @!attribute host
|
||||
# @return [String] The local host for outgoing connections
|
||||
attr_accessor :local_host
|
||||
# @!attribute port
|
||||
# @return [Fixnum] The local port for outgoing connections
|
||||
# @return [Integer] The local port for outgoing connections
|
||||
attr_accessor :local_port
|
||||
# @!attribute proxies
|
||||
# @return [String] The proxy directive to use for the socket
|
||||
|
@ -43,7 +43,7 @@ module Metasploit
|
|||
# @return [Boolean] Whether the scanner should stop when it has found one working Credential
|
||||
attr_accessor :stop_on_success
|
||||
# @!attribute bruteforce_speed
|
||||
# @return [Fixnum] The desired speed, with 5 being 'fast' and 0 being 'slow.'
|
||||
# @return [Integer] The desired speed, with 5 being 'fast' and 0 being 'slow.'
|
||||
attr_accessor :bruteforce_speed
|
||||
|
||||
validates :connection_timeout,
|
||||
|
@ -115,7 +115,7 @@ module Metasploit
|
|||
# overridden, the override should probably do something sensible
|
||||
# with {#bruteforce_speed}
|
||||
#
|
||||
# @return [Fixnum] a number of seconds to sleep between attempts
|
||||
# @return [Integer] a number of seconds to sleep between attempts
|
||||
def sleep_time
|
||||
case bruteforce_speed
|
||||
when 0; 60 * 5
|
||||
|
@ -129,7 +129,7 @@ module Metasploit
|
|||
|
||||
# A threadsafe sleep method
|
||||
#
|
||||
# @param time [Fixnum] number of seconds (can be a Float), defaults
|
||||
# @param time [Integer] number of seconds (can be a Float), defaults
|
||||
# to {#sleep_time}
|
||||
#
|
||||
# @return [void]
|
||||
|
|
|
@ -21,7 +21,7 @@ module Metasploit
|
|||
REALM_KEY = nil
|
||||
|
||||
# @!attribute ftp_timeout
|
||||
# @return [Fixnum] The timeout in seconds to wait for a response to an FTP command
|
||||
# @return [Integer] The timeout in seconds to wait for a response to an FTP command
|
||||
attr_accessor :ftp_timeout
|
||||
|
||||
validates :ftp_timeout,
|
||||
|
|
|
@ -46,11 +46,11 @@ module Metasploit
|
|||
attr_accessor :evade_uri_full_url
|
||||
|
||||
# @!attribute evade_pad_method_uri_count
|
||||
# @return [Fixnum] How many whitespace characters to use between the method and uri
|
||||
# @return [Integer] How many whitespace characters to use between the method and uri
|
||||
attr_accessor :evade_pad_method_uri_count
|
||||
|
||||
# @!attribute evade_pad_uri_version_count
|
||||
# @return [Fixnum] How many whitespace characters to use between the uri and version
|
||||
# @return [Integer] How many whitespace characters to use between the uri and version
|
||||
attr_accessor :evade_pad_uri_version_count
|
||||
|
||||
# @!attribute evade_pad_method_uri_type
|
||||
|
@ -98,7 +98,7 @@ module Metasploit
|
|||
attr_accessor :evade_pad_fake_headers
|
||||
|
||||
# @!attribute evade_pad_fake_headers_count
|
||||
# @return [Fixnum] How many fake headers to insert into the HTTP request
|
||||
# @return [Integer] How many fake headers to insert into the HTTP request
|
||||
attr_accessor :evade_pad_fake_headers_count
|
||||
|
||||
# @!attribute evade_pad_get_params
|
||||
|
@ -106,7 +106,7 @@ module Metasploit
|
|||
attr_accessor :evade_pad_get_params
|
||||
|
||||
# @!attribute evade_pad_get_params_count
|
||||
# @return [Fixnum] How many fake query string variables to insert into the request
|
||||
# @return [Integer] How many fake query string variables to insert into the request
|
||||
attr_accessor :evade_pad_get_params_count
|
||||
|
||||
# @!attribute evade_pad_post_params
|
||||
|
@ -114,7 +114,7 @@ module Metasploit
|
|||
attr_accessor :evade_pad_post_params
|
||||
|
||||
# @!attribute evade_pad_post_params_count
|
||||
# @return [Fixnum] How many fake post variables to insert into the request
|
||||
# @return [Integer] How many fake post variables to insert into the request
|
||||
attr_accessor :evade_pad_post_params_count
|
||||
|
||||
# @!attribute evade_uri_fake_end
|
||||
|
@ -207,7 +207,7 @@ module Metasploit
|
|||
#
|
||||
# @param [Hash] opts native support includes the following (also see Rex::Proto::Http::Request#request_cgi)
|
||||
# @option opts [String] 'host' The remote host
|
||||
# @option opts [Fixnum] 'port' The remote port
|
||||
# @option opts [Integer] 'port' The remote port
|
||||
# @option opts [Boolean] 'ssl' The SSL setting, TrueClass or FalseClass
|
||||
# @option opts [String] 'proxies' The proxies setting
|
||||
# @option opts [Credential] 'credential' A credential object
|
||||
|
|
|
@ -18,7 +18,7 @@ module Metasploit
|
|||
# @return [String] the addess of the target host for this result
|
||||
attr_accessor :host
|
||||
# @!attribute port
|
||||
# @return [Fixnum] the port number of the service for this result
|
||||
# @return [Integer] the port number of the service for this result
|
||||
attr_accessor :port
|
||||
# @!attribute proof
|
||||
# @return [#to_s] the proof of the login's success or failure
|
||||
|
|
|
@ -31,7 +31,7 @@ module Metasploit
|
|||
attr_accessor :version
|
||||
|
||||
# The number of logins to try in each batch
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :queue_size
|
||||
|
||||
validates :version,
|
||||
|
|
|
@ -24,13 +24,13 @@ module Metasploit
|
|||
# @!attribute verbosity
|
||||
# The timeout to wait for the telnet banner.
|
||||
#
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :banner_timeout
|
||||
|
||||
# @!attribute verbosity
|
||||
# The timeout to wait for the response from a telnet command.
|
||||
#
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :telnet_timeout
|
||||
|
||||
# @!attribute verbosity
|
||||
|
|
|
@ -12,11 +12,11 @@ module Metasploit
|
|||
attr_accessor :passwords
|
||||
|
||||
# @!attribute chunk_size, limits number of passwords per XML request
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :chunk_size
|
||||
|
||||
# @!attribute block_wait, time to wait if got blocked by the target
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :block_wait
|
||||
|
||||
# @!attribute base_uri
|
||||
|
|
|
@ -30,11 +30,11 @@ module Metasploit
|
|||
attr_accessor :lm_hash
|
||||
#@return [Array<String>] The LM hashes for previous passwords, up to 24
|
||||
attr_accessor :lm_history
|
||||
#@return [Fixnum] The count of historical LM hashes
|
||||
#@return [Integer] The count of historical LM hashes
|
||||
attr_accessor :lm_history_count
|
||||
#@return [Boolean] If the AD account is locked
|
||||
attr_accessor :locked
|
||||
#@return [Fixnum] The number of times this account has logged in
|
||||
#@return [Integer] The number of times this account has logged in
|
||||
attr_accessor :logon_count
|
||||
#@return [String] Human Readable Date for the last time the account logged in
|
||||
attr_accessor :logon_date
|
||||
|
@ -50,13 +50,13 @@ module Metasploit
|
|||
attr_accessor :nt_hash
|
||||
#@return [Array<String>] The NT hashes for previous passwords, up to 24
|
||||
attr_accessor :nt_history
|
||||
#@return [Fixnum] The count of historical NT hashes
|
||||
#@return [Integer] The count of historical NT hashes
|
||||
attr_accessor :nt_history_count
|
||||
#@return [String] Human Readable Date for the last password change
|
||||
attr_accessor :pass_date
|
||||
#@return [String] Human Readable Time for the last password change
|
||||
attr_accessor :pass_time
|
||||
#@return [Fixnum] The Relative ID of the account
|
||||
#@return [Integer] The Relative ID of the account
|
||||
attr_accessor :rid
|
||||
#@return [String] Byte String for the Account's SID
|
||||
attr_accessor :sid
|
||||
|
|
|
@ -43,10 +43,10 @@ module Metasploit
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
# @!attribute max_send_size
|
||||
# @return [Fixnum] The max size of the data to encapsulate in a single packet
|
||||
# @return [Integer] The max size of the data to encapsulate in a single packet
|
||||
attr_accessor :max_send_size
|
||||
# @!attribute send_delay
|
||||
# @return [Fixnum] The delay between sending packets
|
||||
# @return [Integer] The delay between sending packets
|
||||
attr_accessor :send_delay
|
||||
|
||||
included do
|
||||
|
|
|
@ -21,7 +21,7 @@ module Auxiliary::Fuzzer
|
|||
# Will return or yield numbers based on the presence of a block.
|
||||
#
|
||||
# @return [Array<Array>] Returns an array of arrays of numbers if there is no block given
|
||||
# @yield [Array<Fixnum>] Yields an array of numbers if there is a block given
|
||||
# @yield [Array<Integer>] Yields an array of numbers if there is a block given
|
||||
# @see #fuzzer_number_power2
|
||||
|
||||
def fuzz_numbers
|
||||
|
@ -51,7 +51,7 @@ module Auxiliary::Fuzzer
|
|||
# Modifies each byte of the string from beginning to end, packing each element as an 8 bit character.
|
||||
#
|
||||
# @param str [String] The string the mutation will be based on.
|
||||
# @param max [Fixnum, NilClass] Max string size.
|
||||
# @param max [Integer, NilClass] Max string size.
|
||||
# @return [Array] Returns an array of an array of strings
|
||||
# @see #fuzzer_string_format
|
||||
|
||||
|
@ -71,7 +71,7 @@ module Auxiliary::Fuzzer
|
|||
# Modifies each byte of the string from beginning to end, packing each element as an 8 bit character.
|
||||
#
|
||||
# @param str [String] The string the mutation will be based on.
|
||||
# @param max [Fixnum, NilClass] Max string size.
|
||||
# @param max [Integer, NilClass] Max string size.
|
||||
# @return [Array] Returns an array of an array of strings
|
||||
# @see fuzzer_string_format
|
||||
|
||||
|
@ -150,7 +150,7 @@ module Auxiliary::Fuzzer
|
|||
# Generates a fuzz string If no block is set, it will retrive characters from the
|
||||
# FuzzChar datastore option.
|
||||
#
|
||||
# @param len [Fixnum] String size.
|
||||
# @param len [Integer] String size.
|
||||
# @return [String] Returns a string of size 1024 * 512 specified by the user
|
||||
|
||||
def fuzzer_gen_string(len)
|
||||
|
|
|
@ -181,7 +181,7 @@ end
|
|||
# and combinations thereof.
|
||||
def nmap_validate_rports
|
||||
# If there's an RPORT specified, use that instead.
|
||||
if datastore['RPORT'] && (datastore['RPORT'].kind_of?(Fixnum) || !datastore['RPORT'].empty?)
|
||||
if datastore['RPORT'] && (datastore['RPORT'].kind_of?(Integer) || !datastore['RPORT'].empty?)
|
||||
return true
|
||||
end
|
||||
if rports.nil? || rports.empty?
|
||||
|
|
|
@ -70,7 +70,7 @@ module Auxiliary::Report
|
|||
# This method safely get the workspace ID. It handles if the db is not active
|
||||
#
|
||||
# @return [NilClass] if there is no DB connection
|
||||
# @return [Fixnum] the ID of the current Mdm::Workspace
|
||||
# @return [Integer] the ID of the current Mdm::Workspace
|
||||
def myworkspace_id
|
||||
if framework.db.active
|
||||
myworkspace.id
|
||||
|
@ -170,7 +170,7 @@ module Auxiliary::Report
|
|||
#
|
||||
# @param opts [Hash] the option hash
|
||||
# @option opts [String] :host the address of the host (also takes a Mdm::Host)
|
||||
# @option opts [Fixnum] :port the port of the connected service
|
||||
# @option opts [Integer] :port the port of the connected service
|
||||
# @option opts [Mdm::Service] :service an optional Service object to build the cred for
|
||||
# @option opts [String] :type What type of private credential this is (e.g. "password", "hash", "ssh_key")
|
||||
# @option opts [String] :proto Which transport protocol the service uses
|
||||
|
|
|
@ -171,7 +171,7 @@ class Export
|
|||
case obj
|
||||
when String
|
||||
obj.strip
|
||||
when TrueClass, FalseClass, Float, Fixnum, Bignum, Time
|
||||
when TrueClass, FalseClass, Float, Integer, Time
|
||||
obj.to_s.strip
|
||||
when BigDecimal
|
||||
obj.to_s("F")
|
||||
|
|
|
@ -35,7 +35,7 @@ module Msf::DBManager::IPAddress
|
|||
else
|
||||
raise ArgumentError, "Invalid IP address: #{ip.inspect}"
|
||||
end
|
||||
when Fixnum
|
||||
when Integer
|
||||
if (0..2**32-1).include? ip
|
||||
ip_x = Rex::Socket.addr_itoa(ip)
|
||||
ip_i = ip
|
||||
|
|
|
@ -282,7 +282,7 @@ module Msf
|
|||
# Returns the selected payload's LPORT.
|
||||
#
|
||||
# @param platform [Symbol]
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
def get_selected_payload_lport(platform)
|
||||
datastore["PAYLOAD_#{platform.to_s.upcase}_LPORT"]
|
||||
end
|
||||
|
@ -353,7 +353,7 @@ module Msf
|
|||
|
||||
# Returns the human-readable version of the rank.
|
||||
#
|
||||
# @param rank [Fixnum]
|
||||
# @param rank [Integer]
|
||||
# @return [String]
|
||||
def parse_rank(rank)
|
||||
RankingName[rank].to_s.capitalize
|
||||
|
@ -716,7 +716,7 @@ module Msf
|
|||
|
||||
# Returns a number of sessions obtained by BAP's payload handlers.
|
||||
#
|
||||
# @return [Fixnum] A session count.
|
||||
# @return [Integer] A session count.
|
||||
def session_count
|
||||
total = 0
|
||||
|
||||
|
|
|
@ -10,10 +10,10 @@ module Msf
|
|||
module Builder
|
||||
# Builds a RMI header stream
|
||||
#
|
||||
# @param opts [Hash{Symbol => <String, Fixnum>}]
|
||||
# @param opts [Hash{Symbol => <String, Integer>}]
|
||||
# @option opts [String] :signature
|
||||
# @option opts [Fixnum] :version
|
||||
# @option opts [Fixnum] :protocol
|
||||
# @option opts [Integer] :version
|
||||
# @option opts [Integer] :protocol
|
||||
# @return [Rex::Proto::Rmi::Model::OutputHeader]
|
||||
def build_header(opts = {})
|
||||
signature = opts[:signature] || Rex::Proto::Rmi::Model::SIGNATURE
|
||||
|
@ -30,16 +30,16 @@ module Msf
|
|||
|
||||
# Builds a RMI call stream
|
||||
#
|
||||
# @param opts [Hash{Symbol => <Fixnum, Array>}]
|
||||
# @option opts [Fixnum] :message_id
|
||||
# @option opts [Fixnum] :object_number Random to identify the object.
|
||||
# @option opts [Fixnum] :uid_number Identifies the VM where the object was generated.
|
||||
# @option opts [Fixnum] :uid_time Time where the object was generated.
|
||||
# @option opts [Fixnum] :uid_count Identifies different instance of the same object generated from the same VM
|
||||
# @param opts [Hash{Symbol => <Integer, Array>}]
|
||||
# @option opts [Integer] :message_id
|
||||
# @option opts [Integer] :object_number Random to identify the object.
|
||||
# @option opts [Integer] :uid_number Identifies the VM where the object was generated.
|
||||
# @option opts [Integer] :uid_time Time where the object was generated.
|
||||
# @option opts [Integer] :uid_count Identifies different instance of the same object generated from the same VM
|
||||
# at the same time.
|
||||
# @option opts [Fixnum] :operation On JDK 1.1 stub protocol the operation index in the interface. On JDK 1.2
|
||||
# @option opts [Integer] :operation On JDK 1.1 stub protocol the operation index in the interface. On JDK 1.2
|
||||
# it is -1.
|
||||
# @option opts [Fixnum] :hash On JDK 1.1 stub protocol the stub's interface hash. On JDK1.2 is a hash
|
||||
# @option opts [Integer] :hash On JDK 1.1 stub protocol the stub's interface hash. On JDK1.2 is a hash
|
||||
# representing the method to call.
|
||||
# @option opts [Array] :arguments
|
||||
# @return [Rex::Proto::Rmi::Model::Call]
|
||||
|
@ -77,8 +77,8 @@ module Msf
|
|||
|
||||
# Builds a RMI dgc ack stream
|
||||
#
|
||||
# @param opts [Hash{Symbol => <Fixnum, String>}]
|
||||
# @option opts [Fixnum] :stream_id
|
||||
# @param opts [Hash{Symbol => <Integer, String>}]
|
||||
# @option opts [Integer] :stream_id
|
||||
# @option opts [String] :unique_identifier
|
||||
# @return [Rex::Proto::Rmi::Model::DgcAck]
|
||||
def build_dgc_ack(opts = {})
|
||||
|
|
|
@ -32,7 +32,7 @@ module Msf
|
|||
|
||||
# Returns the timeout to wait for data between read iterations
|
||||
#
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
def read_loop_timeout
|
||||
datastore['RmiReadLoopTimeout'] || 1
|
||||
end
|
||||
|
@ -46,7 +46,7 @@ module Msf
|
|||
|
||||
# Returns the target port
|
||||
#
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
def rport
|
||||
datastore['RPORT']
|
||||
end
|
||||
|
@ -56,7 +56,7 @@ module Msf
|
|||
#
|
||||
# @param opts [Hash]
|
||||
# @option opts [Rex::Socket::Tcp] :sock
|
||||
# @return [Fixnum] the number of bytes sent
|
||||
# @return [Integer] the number of bytes sent
|
||||
# @see Msf::Rmi::Client::Streams#build_header
|
||||
def send_header(opts = {})
|
||||
nsock = opts[:sock] || sock
|
||||
|
@ -69,7 +69,7 @@ module Msf
|
|||
# @param opts [Hash]
|
||||
# @option opts [Rex::Socket::Tcp] :sock
|
||||
# @option opts [Rex::Proto::Rmi::Model::Call] :call
|
||||
# @return [Fixnum] the number of bytes sent
|
||||
# @return [Integer] the number of bytes sent
|
||||
# @see Msf::Rmi::Client::Streams#build_call
|
||||
def send_call(opts = {})
|
||||
nsock = opts[:sock] || sock
|
||||
|
@ -81,7 +81,7 @@ module Msf
|
|||
#
|
||||
# @param opts [Hash]
|
||||
# @option opts [Rex::Socket::Tcp] :sock
|
||||
# @return [Fixnum] the number of bytes sent
|
||||
# @return [Integer] the number of bytes sent
|
||||
# @see Msf::Rmi::Client::Streams#build_dgc_ack
|
||||
def send_dgc_ack(opts = {})
|
||||
nsock = opts[:sock] || sock
|
||||
|
|
|
@ -91,7 +91,7 @@ module Msf
|
|||
# Calculates the hash to make RMI calls for the
|
||||
# java/rmi/registry/RegistryImpl_Stub interface
|
||||
#
|
||||
# @return [Fixnum] The interface's hash
|
||||
# @return [Integer] The interface's hash
|
||||
def registry_interface_hash
|
||||
hash = calculate_interface_hash(
|
||||
[
|
||||
|
|
|
@ -12,7 +12,7 @@ module Msf
|
|||
#
|
||||
# @param signature [String] The remote method signature as specified by the JDK 1.2,
|
||||
# method name + method descriptor (as explained in the Java Virtual Machine Specification)
|
||||
# @return [Fixnum] The method hash
|
||||
# @return [Integer] The method hash
|
||||
# @see http://docs.oracle.com/javase/8/docs/platform/rmi/spec/rmi-stubs24.html The RemoteRef Interface documentation to understand how method hashes are calculated
|
||||
def calculate_method_hash(signature)
|
||||
utf = Rex::Java::Serialization::Model::Utf.new(nil, signature)
|
||||
|
@ -24,7 +24,7 @@ module Msf
|
|||
# Calculates an interface hash to make RMI calls as defined by the JDK 1.1
|
||||
#
|
||||
# @param methods [Array] set of method names and their descriptors
|
||||
# @return [Fixnum] The interface hash
|
||||
# @return [Integer] The interface hash
|
||||
# @see http://docs.oracle.com/javase/8/docs/platform/rmi/spec/rmi-stubs24.html The RemoteRef Interface documentation to understand how interface hashes are calculated
|
||||
def calculate_interface_hash(methods)
|
||||
stream = ''
|
||||
|
@ -68,7 +68,7 @@ module Msf
|
|||
# Extracts an int from an IO
|
||||
#
|
||||
# @param io [IO] the io to extract the int from
|
||||
# @return [Fixnum, nil] the extracted int if success, nil otherwise
|
||||
# @return [Integer, nil] the extracted int if success, nil otherwise
|
||||
def extract_int(io)
|
||||
int_raw = io.read(4)
|
||||
unless int_raw && int_raw.length == 4
|
||||
|
@ -82,7 +82,7 @@ module Msf
|
|||
# Extracts a long from an IO
|
||||
#
|
||||
# @param io [IO] the io to extract the long from
|
||||
# @return [Fixnum, nil] the extracted int if success, nil otherwise
|
||||
# @return [Integer, nil] the extracted int if success, nil otherwise
|
||||
def extract_long(io)
|
||||
int_raw = io.read(8)
|
||||
unless int_raw && int_raw.length == 8
|
||||
|
|
|
@ -47,14 +47,14 @@ module Msf
|
|||
|
||||
# Returns the remote port
|
||||
#
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
def rport
|
||||
datastore['RPORT']
|
||||
end
|
||||
|
||||
# Returns the TCP timeout
|
||||
#
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
def timeout
|
||||
datastore['Timeout']
|
||||
end
|
||||
|
@ -68,9 +68,9 @@ module Msf
|
|||
|
||||
# Creates a kerberos connection
|
||||
#
|
||||
# @param opts [Hash{Symbol => <String, Fixnum>}]
|
||||
# @param opts [Hash{Symbol => <String, Integer>}]
|
||||
# @option opts [String] :rhost
|
||||
# @option opts [<String, Fixnum>] :rport
|
||||
# @option opts [<String, Integer>] :rport
|
||||
# @return [Rex::Proto::Kerberos::Client]
|
||||
def connect(opts={})
|
||||
kerb_client = Rex::Proto::Kerberos::Client.new(
|
||||
|
|
|
@ -32,10 +32,10 @@ module Msf
|
|||
|
||||
# Builds a kerberos PA-ENC-TIMESTAMP pre authenticated structure
|
||||
#
|
||||
# @param opts [Hash{Symbol => <Time, Fixnum, String>}]
|
||||
# @param opts [Hash{Symbol => <Time, Integer, String>}]
|
||||
# @option opts [Time] :time_stamp
|
||||
# @option opts [Fixnum] :pausec
|
||||
# @option opts [Fixnum] :etype
|
||||
# @option opts [Integer] :pausec
|
||||
# @option opts [Integer] :etype
|
||||
# @option opts [String] :key
|
||||
# @return [Rex::Proto::Kerberos::Model::PreAuthData]
|
||||
# @see Rex::Proto::Kerberos::Model::PreAuthEncTimeStamp
|
||||
|
@ -67,13 +67,13 @@ module Msf
|
|||
|
||||
# Builds a kerberos AS request body
|
||||
#
|
||||
# @param opts [Hash{Symbol => <Fixnum, Time, String, Rex::Proto::Kerberos::Model::PrincipalName>}]
|
||||
# @option opts [Fixnum] :options
|
||||
# @param opts [Hash{Symbol => <Integer, Time, String, Rex::Proto::Kerberos::Model::PrincipalName>}]
|
||||
# @option opts [Integer] :options
|
||||
# @option opts [Time] :from
|
||||
# @option opts [Time] :till
|
||||
# @option opts [Time] :rtime
|
||||
# @option opts [Fixnum] :nonce
|
||||
# @option opts [Fixnum] :etype
|
||||
# @option opts [Integer] :nonce
|
||||
# @option opts [Integer] :etype
|
||||
# @option opts [Rex::Proto::Kerberos::Model::PrincipalName] :cname
|
||||
# @option opts [String] :realm
|
||||
# @option opts [Rex::Proto::Kerberos::Model::PrincipalName] :sname
|
||||
|
|
|
@ -28,7 +28,7 @@ module Msf
|
|||
#
|
||||
# @param res [Rex::Proto::Kerberos::Model::KdcResponse]
|
||||
# @param key [String]
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
# @see Rex::Proto::Kerberos::Model::KdcResponse
|
||||
# @see Rex::Proto::Kerberos::Model::EncryptedData.decrypt
|
||||
# @see Rex::Proto::Kerberos::Model::EncKdcResponse
|
||||
|
|
|
@ -9,9 +9,9 @@ module Msf
|
|||
|
||||
# Builds a kerberos Client Name Principal
|
||||
#
|
||||
# @param opts [Hash{Symbol => <String, Fixnum>}]
|
||||
# @param opts [Hash{Symbol => <String, Integer>}]
|
||||
# @option opts [String] :client_name the client's name
|
||||
# @option opts [Fixnum] :client_type the client's name type
|
||||
# @option opts [Integer] :client_type the client's name type
|
||||
# @return [Rex::Proto::Kerberos::Model::PrincipalName]
|
||||
# @see Rex::Proto::Kerberos::Model::PrincipalName
|
||||
def build_client_name(opts = {})
|
||||
|
@ -26,9 +26,9 @@ module Msf
|
|||
|
||||
# Builds a kerberos Server Name Principal
|
||||
#
|
||||
# @param opts [Hash{Symbol => <String, Fixnum>}]
|
||||
# @param opts [Hash{Symbol => <String, Integer>}]
|
||||
# @option opts [String] :server_name the server's name
|
||||
# @option opts [Fixnum] :server_type the server's name type
|
||||
# @option opts [Integer] :server_type the server's name type
|
||||
# @return [Rex::Proto::Kerberos::Model::PrincipalName]
|
||||
# @see Rex::Proto::Kerberos::Model::PrincipalName
|
||||
def build_server_name(opts = {})
|
||||
|
|
|
@ -10,8 +10,8 @@ module Msf
|
|||
|
||||
# Builds a MIT Credential Cache
|
||||
#
|
||||
# @param opts [Hash{Symbol => <Fixnum, Array<String>, Rex::Proto::Kerberos::CredentialCache::Principal, Array<Rex::Proto::Kerberos::CredentialCache::Credential>>}]
|
||||
# @option opts [Fixnum] :version
|
||||
# @param opts [Hash{Symbol => <Integer, Array<String>, Rex::Proto::Kerberos::CredentialCache::Principal, Array<Rex::Proto::Kerberos::CredentialCache::Credential>>}]
|
||||
# @option opts [Integer] :version
|
||||
# @option opts [Array<String>] :headers
|
||||
# @option opts [Rex::Proto::Kerberos::CredentialCache::Principal] :primary_principal
|
||||
# @option opts [Array<Rex::Proto::Kerberos::CredentialCache::Credential>] :credentials
|
||||
|
@ -35,8 +35,8 @@ module Msf
|
|||
|
||||
# Builds a MIT Credential Cache principal
|
||||
#
|
||||
# @param opts [Hash<{Symbol => <Fixnum, String, Array<String>>}>]
|
||||
# @option opts [Fixnum] :name_type
|
||||
# @param opts [Hash<{Symbol => <Integer, String, Array<String>>}>]
|
||||
# @option opts [Integer] :name_type
|
||||
# @option opts [String] :realm
|
||||
# @option opts [Array<String>] :components
|
||||
# @return [Rex::Proto::Kerberos::CredentialCache::Principal]
|
||||
|
@ -57,9 +57,9 @@ module Msf
|
|||
|
||||
# Builds a MIT Credential Cache key block
|
||||
#
|
||||
# @param opts [Hash<{Symbol => <Fixnum, String>}>]
|
||||
# @option opts [Fixnum] :key_type
|
||||
# @option opts [Fixnum] :e_type
|
||||
# @param opts [Hash<{Symbol => <Integer, String>}>]
|
||||
# @option opts [Integer] :key_type
|
||||
# @option opts [Integer] :e_type
|
||||
# @option opts [String] :key_value
|
||||
# @return [Rex::Proto::Kerberos::CredentialCache::KeyBlock]
|
||||
# @see Rex::Proto::Kerberos::CredentialCache::KeyBlock
|
||||
|
@ -79,11 +79,11 @@ module Msf
|
|||
|
||||
# Builds a times structure linked to a credential in a MIT Credential Cache
|
||||
#
|
||||
# @param opts [Hash<{Symbol => Fixnum}>]
|
||||
# @option opts [Fixnum] auth_time
|
||||
# @option opts [Fixnum] start_time
|
||||
# @option opts [Fixnum] end_time
|
||||
# @option opts [Fixnum] renew_till
|
||||
# @param opts [Hash<{Symbol => Integer}>]
|
||||
# @option opts [Integer] auth_time
|
||||
# @option opts [Integer] start_time
|
||||
# @option opts [Integer] end_time
|
||||
# @option opts [Integer] renew_till
|
||||
# @return [Rex::Proto::Kerberos::CredentialCache::Time]
|
||||
# @see Rex::Proto::Kerberos::CredentialCache::Time
|
||||
def create_cache_times(opts = {})
|
||||
|
@ -109,8 +109,8 @@ module Msf
|
|||
# @option opts [Rex::Proto::Kerberos::CredentialCache::Principal] server
|
||||
# @option opts [Rex::Proto::Kerberos::CredentialCache::KeyBlock] key
|
||||
# @option opts [Rex::Proto::Kerberos::CredentialCache::Time] time
|
||||
# @option opts [Fixnum] is_key
|
||||
# @option opts [Fixnum] flags
|
||||
# @option opts [Integer] is_key
|
||||
# @option opts [Integer] flags
|
||||
# @option opts [Array] addrs
|
||||
# @option opts [Array] auth_data
|
||||
# @option opts [String] ticket
|
||||
|
|
|
@ -28,11 +28,11 @@ module Msf
|
|||
|
||||
# Builds a kerberos PACTYPE structure
|
||||
#
|
||||
# @param opts [Hash{Symbol => <String, Fixnum, Array, Time>}]
|
||||
# @param opts [Hash{Symbol => <String, Integer, Array, Time>}]
|
||||
# @option opts [String] :client_name
|
||||
# @option opts [Fixnum] :user_id the user SID Ex: 1000
|
||||
# @option opts [Fixnum] :group_id Ex: 513 for 'Domain Users'
|
||||
# @option opts [Array<Fixnum>] :group_ids
|
||||
# @option opts [Integer] :user_id the user SID Ex: 1000
|
||||
# @option opts [Integer] :group_id Ex: 513 for 'Domain Users'
|
||||
# @option opts [Array<Integer>] :group_ids
|
||||
# @option opts [String] :realm
|
||||
# @option opts [String] :domain_id the domain SID Ex: S-1-5-21-1755879683-3641577184-3486455962
|
||||
# @option opts [Time] :logon_time
|
||||
|
|
|
@ -113,10 +113,10 @@ module Msf
|
|||
|
||||
# Builds a KRB_AP_REQ message
|
||||
#
|
||||
# @param opts [Hash{Symbol => <Fixnum, Rex::Proto::Kerberos::Model::Ticket, Rex::Proto::Kerberos::Model::EncryptedData, Rex::Proto::Kerberos::Model::EncryptionKey>}]
|
||||
# @option opts [Fixnum] :pvno
|
||||
# @option opts [Fixnum] :msg_type
|
||||
# @option opts [Fixnum] :ap_req_options
|
||||
# @param opts [Hash{Symbol => <Integer, Rex::Proto::Kerberos::Model::Ticket, Rex::Proto::Kerberos::Model::EncryptedData, Rex::Proto::Kerberos::Model::EncryptionKey>}]
|
||||
# @option opts [Integer] :pvno
|
||||
# @option opts [Integer] :msg_type
|
||||
# @option opts [Integer] :ap_req_options
|
||||
# @option opts [Rex::Proto::Kerberos::Model::Ticket] :ticket
|
||||
# @option opts [Rex::Proto::Kerberos::Model::EncryptedData] :authenticator
|
||||
# @option opts [Rex::Proto::Kerberos::Model::EncryptionKey] :session_key
|
||||
|
@ -159,7 +159,7 @@ module Msf
|
|||
# @option opts [Rex::Proto::Kerberos::Model::PrincipalName] :cname
|
||||
# @option opts [String] :realm
|
||||
# @option opts [Time] :ctime
|
||||
# @option opts [Fixnum] :cusec
|
||||
# @option opts [Integer] :cusec
|
||||
# @option opts [Rex::Proto::Kerberos::Model::Checksum] :checksum
|
||||
# @option opts [Rex::Proto::Kerberos::Model::EncryptionKey] :subkey
|
||||
# @return [Rex::Proto::Kerberos::Model::Authenticator]
|
||||
|
@ -190,8 +190,8 @@ module Msf
|
|||
|
||||
# Builds an encryption key to protect the data sent in the TGS request.
|
||||
#
|
||||
# @param opts [Hash{Symbol => <Fixnum, String>}]
|
||||
# @option opts [Fixnum] :subkey_type
|
||||
# @param opts [Hash{Symbol => <Integer, String>}]
|
||||
# @option opts [Integer] :subkey_type
|
||||
# @option opts [String] :subkey_value
|
||||
# @return [Rex::Proto::Kerberos::Model::EncryptionKey]
|
||||
# @see Rex::Proto::Kerberos::Model::EncryptionKey
|
||||
|
@ -210,13 +210,13 @@ module Msf
|
|||
|
||||
# Builds a kerberos TGS request body
|
||||
#
|
||||
# @param opts [Hash{Symbol => <Fixnum, Time, String, Rex::Proto::Kerberos::Model::PrincipalName, Rex::Proto::Kerberos::Model::EncryptedData>}]
|
||||
# @option opts [Fixnum] :options
|
||||
# @param opts [Hash{Symbol => <Integer, Time, String, Rex::Proto::Kerberos::Model::PrincipalName, Rex::Proto::Kerberos::Model::EncryptedData>}]
|
||||
# @option opts [Integer] :options
|
||||
# @option opts [Time] :from
|
||||
# @option opts [Time] :till
|
||||
# @option opts [Time] :rtime
|
||||
# @option opts [Fixnum] :nonce
|
||||
# @option opts [Fixnum] :etype
|
||||
# @option opts [Integer] :nonce
|
||||
# @option opts [Integer] :etype
|
||||
# @option opts [Rex::Proto::Kerberos::Model::PrincipalName] :cname
|
||||
# @option opts [String] :realm
|
||||
# @option opts [Rex::Proto::Kerberos::Model::PrincipalName] :sname
|
||||
|
@ -254,7 +254,7 @@ module Msf
|
|||
|
||||
# Builds a Kerberos TGS Request body checksum
|
||||
#
|
||||
# @param opts [Hash{Symbol => <Rex::Proto::Kerberos::Model::KdcRequestBody, Fixnum>}]
|
||||
# @param opts [Hash{Symbol => <Rex::Proto::Kerberos::Model::KdcRequestBody, Integer>}]
|
||||
# @option opts [Rex::Proto::Kerberos::Model::KdcRequestBody] :body
|
||||
# @return [Rex::Proto::Kerberos::Model::Checksum]
|
||||
# @see #build_tgs_request_body
|
||||
|
|
|
@ -134,19 +134,19 @@ module Exploit::ORACLE
|
|||
when 2, :update_stmt
|
||||
connect.commit
|
||||
|
||||
# If we were successful our return should be a Fixnum with the number of rows updated
|
||||
# If we were successful our return should be a Integer with the number of rows updated
|
||||
result = ['UPDATE Successful ' + sploit.row_count.to_s + ' Rows Updated']
|
||||
return result
|
||||
# Delete Queries
|
||||
when 3, :delete_stmt
|
||||
connect.commit
|
||||
# If we were successful our return should be a Fixnum with the number of rows updated
|
||||
# If we were successful our return should be a Integer with the number of rows updated
|
||||
result = ['DELETE Successful ' + sploit.row_count.to_s + ' Rows Deleted']
|
||||
return result
|
||||
# Insert Queries
|
||||
when 4, :insert_stmt
|
||||
connect.commit
|
||||
# If we were successful our return should be a Fixnum with the number of rows updated
|
||||
# If we were successful our return should be a Integer with the number of rows updated
|
||||
result = ['INSERT Successful ' + sploit.row_count.to_s + ' Rows Inserted']
|
||||
return result
|
||||
# Create Queries
|
||||
|
|
|
@ -48,7 +48,7 @@ module Exploit::Remote::Postgres
|
|||
# @return [String] IP address of the target
|
||||
def rhost; datastore['RHOST']; end
|
||||
# Return the datastore value of the same name
|
||||
# @return [Fixnum] TCP port where the target service is running
|
||||
# @return [Integer] TCP port where the target service is running
|
||||
def rport; datastore['RPORT']; end
|
||||
# Return the datastore value of the same name
|
||||
# @return [String] Username for authentication
|
||||
|
@ -82,7 +82,7 @@ module Exploit::Remote::Postgres
|
|||
# @option opts [String] :username The username
|
||||
# @option opts [String] :username The username
|
||||
# @option opts [String] :server IP address or hostname of the target server
|
||||
# @option opts [Fixnum] :port TCP port on :server
|
||||
# @option opts [Integer] :port TCP port on :server
|
||||
#
|
||||
# @return [:error_database] if user/pass are correct but database is wrong
|
||||
# @return [:error_credentials] if user/pass are wrong
|
||||
|
|
|
@ -182,10 +182,10 @@ module Msf
|
|||
# @return [String] The file name of the provided UNC.
|
||||
attr_accessor :file_name
|
||||
# @!attribute hi
|
||||
# @return [Fixnum] The high 4 bytes for the file 'created time'.
|
||||
# @return [Integer] The high 4 bytes for the file 'created time'.
|
||||
attr_accessor :hi
|
||||
# @!attribute lo
|
||||
# @return [Fixnum] The low 4 bytes for the file 'created time'.
|
||||
# @return [Integer] The low 4 bytes for the file 'created time'.
|
||||
attr_accessor :lo
|
||||
# @!attribute file_contents
|
||||
# @return [String] The contents of the provided file
|
||||
|
@ -271,10 +271,10 @@ module Msf
|
|||
# Main dispatcher function. Takes the client data and performs a case switch
|
||||
# on the command (e.g. Negotiate, Session Setup, Read file, etc.)
|
||||
#
|
||||
# @param cmd [Fixnum] The SMB Command requested.
|
||||
# @param cmd [Integer] The SMB Command requested.
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param buff [String] The data including the client request.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_dispatch(cmd, c, buff)
|
||||
smb = @state[c]
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param buff [String] The data including the client request.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_close(c, buff)
|
||||
send_close_res(c)
|
||||
end
|
||||
|
@ -19,7 +19,7 @@ module Msf
|
|||
# Builds and sends an SMB_COM_CLOSE response.
|
||||
#
|
||||
# @param c [Socket] The client to answer.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_close_res(c)
|
||||
pkt = CONST::SMB_CLOSE_RES_PKT.make_struct
|
||||
smb_set_defaults(c, pkt)
|
||||
|
|
|
@ -11,7 +11,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param buff [String] The data including the client request.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_negotiate(c, buff)
|
||||
pkt = CONST::SMB_NEG_PKT.make_struct
|
||||
pkt.from_s(buff)
|
||||
|
@ -36,18 +36,18 @@ module Msf
|
|||
# Builds and sends an SMB_COM_CLOSE response.
|
||||
#
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param opts [Hash{Symbol => <String, Fixnum>}] Response custom values.
|
||||
# @option opts [Fixnum] :dialect The index of the dialect selected by the server from the request.
|
||||
# @option opts [Fixnum] :security_mode Security modes supported or required by the server.
|
||||
# @option opts [Fixnum] :max_mpx The maximum number of outstanding SMB operations that the server supports.
|
||||
# @option opts [Fixnum] :max_vcs The maximum number of virtual circuits between the client and the server.
|
||||
# @option opts [Fixnum] :max_buff Largest SMB message that the server can handle.
|
||||
# @option opts [Fixnum] :max_raw Max size for SMB_COM_WRITE_RAW requests and SMB_COM_READ_RAW responses.
|
||||
# @option opts [Fixnum] :server_time_zone The server's time zone.
|
||||
# @option opts [Fixnum] :capabilities The server capability indicators.
|
||||
# @option opts [Fixnum] :key_length The challenge length.
|
||||
# @param opts [Hash{Symbol => <String, Integer>}] Response custom values.
|
||||
# @option opts [Integer] :dialect The index of the dialect selected by the server from the request.
|
||||
# @option opts [Integer] :security_mode Security modes supported or required by the server.
|
||||
# @option opts [Integer] :max_mpx The maximum number of outstanding SMB operations that the server supports.
|
||||
# @option opts [Integer] :max_vcs The maximum number of virtual circuits between the client and the server.
|
||||
# @option opts [Integer] :max_buff Largest SMB message that the server can handle.
|
||||
# @option opts [Integer] :max_raw Max size for SMB_COM_WRITE_RAW requests and SMB_COM_READ_RAW responses.
|
||||
# @option opts [Integer] :server_time_zone The server's time zone.
|
||||
# @option opts [Integer] :capabilities The server capability indicators.
|
||||
# @option opts [Integer] :key_length The challenge length.
|
||||
# @option opts [String] :key The challenge.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_negotitate_res(c, opts = {})
|
||||
dialect = opts[:dialect] || 0
|
||||
security_mode = opts[:security_mode] || 0
|
||||
|
|
|
@ -11,7 +11,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param buff [String] The data including the client request.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_nt_create_andx(c, buff)
|
||||
smb = @state[c]
|
||||
pkt = CONST::SMB_CREATE_PKT.make_struct
|
||||
|
@ -69,13 +69,13 @@ module Msf
|
|||
# Builds and sends an SMB_COM_NT_CREATE_ANDX response.
|
||||
#
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param opts [Hash{Symbol => <Fixnum>}] Response custom values.
|
||||
# @option opts [Fixnum] :file_id A FID representing the file or directory created or opened.
|
||||
# @option opts [Fixnum] :attributes The attributes that the server assigned to the file or directory.
|
||||
# @option opts [Fixnum] :end_of_file_low The end of file offset value (4 bytes)
|
||||
# @option opts [Fixnum] :is_directory Indicates if the FID represents a directory.
|
||||
# @option opts [Fixnum] :alloc_low The number of bytes allocated to the file by the server.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @param opts [Hash{Symbol => <Integer>}] Response custom values.
|
||||
# @option opts [Integer] :file_id A FID representing the file or directory created or opened.
|
||||
# @option opts [Integer] :attributes The attributes that the server assigned to the file or directory.
|
||||
# @option opts [Integer] :end_of_file_low The end of file offset value (4 bytes)
|
||||
# @option opts [Integer] :is_directory Indicates if the FID represents a directory.
|
||||
# @option opts [Integer] :alloc_low The number of bytes allocated to the file by the server.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_nt_create_andx_res(c, opts = {})
|
||||
file_id = opts[:file_id] || 0
|
||||
attributes = opts[:attributes] || 0
|
||||
|
|
|
@ -11,7 +11,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param buff [String] The data including the client request.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_read_andx(c, buff)
|
||||
pkt = CONST::SMB_READ_PKT.make_struct
|
||||
pkt.from_s(buff)
|
||||
|
@ -31,11 +31,11 @@ module Msf
|
|||
# Builds and sends an SMB_COM_NT_CREATE_ANDX response.
|
||||
#
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param opts [Hash{Symbol => <Fixnum, String>}] Response custom values.
|
||||
# @option opts [Fixnum] :data_len_low The length of the file data sent back.
|
||||
# @option opts [Fixnum] :byte_count The length of the file data sent back.
|
||||
# @param opts [Hash{Symbol => <Integer, String>}] Response custom values.
|
||||
# @option opts [Integer] :data_len_low The length of the file data sent back.
|
||||
# @option opts [Integer] :byte_count The length of the file data sent back.
|
||||
# @option opts [String] :data The bytes read from the file.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_read_andx_res(c, opts = {})
|
||||
data_len_low = opts[:data_len_low] || 0
|
||||
byte_count = opts[:byte_count] || 0
|
||||
|
|
|
@ -11,7 +11,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param buff [String] The data including the client request.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_session_setup_andx(c, buff)
|
||||
tree_connect_response = CONST::SMB_TREE_CONN_ANDX_RES_PKT.make_struct
|
||||
tree_connect_response.v['WordCount'] = CONST::SMB_TREE_CONN_ANDX_WORD_COUNT
|
||||
|
@ -39,15 +39,15 @@ module Msf
|
|||
# Builds and sends an SMB_COM_NT_CREATE_ANDX response.
|
||||
#
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param opts [Hash{Symbol => <Fixnum, String, Rex::Struct2::CStruct>}] Response custom values.
|
||||
# @option opts [Fixnum] :action SMB Configuration result.
|
||||
# @option opts [Fixnum] :andx_offset The offset in bytes from the start of the SMB Header to the start
|
||||
# @param opts [Hash{Symbol => <Integer, String, Rex::Struct2::CStruct>}] Response custom values.
|
||||
# @option opts [Integer] :action SMB Configuration result.
|
||||
# @option opts [Integer] :andx_offset The offset in bytes from the start of the SMB Header to the start
|
||||
# of the WordCount field in the next SMBCommand.
|
||||
# @option opts [Fixnum] :reserved Reserved field.
|
||||
# @option opts [Fixnum] :andx The command code for the next SMB Command in the packet.
|
||||
# @option opts [Integer] :reserved Reserved field.
|
||||
# @option opts [Integer] :andx The command code for the next SMB Command in the packet.
|
||||
# @option opts [String] :data The SMB_Data for the SMB_COM_SESSION_SETUP_ANDX response.
|
||||
# @option opts [Rex::Struct2::CStruct] :andx_command The next SMB Command in the packet.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_session_setup_andx_res(c, opts = {})
|
||||
action = opts[:action] || 0
|
||||
andx_offset = opts[:andx_offset] || 0
|
||||
|
|
|
@ -14,7 +14,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param buff [String] The data including the client request.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_trans2(c, buff)
|
||||
smb = @state[c]
|
||||
pkt = CONST::SMB_TRANS2_PKT.make_struct
|
||||
|
@ -44,7 +44,7 @@ module Msf
|
|||
# @param c [Socket] The client to answer.
|
||||
# @param parameters [Rex::Struct2::CStruct] The SMB_Parameters to include in the response.
|
||||
# @param data [Rex::Struct2::CStruct] The SMB_Data to include in the response.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_trans2_res(c, parameters, data)
|
||||
pkt = CONST::SMB_TRANS_RES_PKT.make_struct
|
||||
smb_set_defaults(c, pkt)
|
||||
|
|
|
@ -12,7 +12,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param buff [String] The data including the client request.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_trans2_find_first2(c, buff)
|
||||
smb = @state[c]
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param buff [String] The data including the client request.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_trans2_query_file_information(c, buff)
|
||||
smb = @state[c]
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param buff [String] The data including the client request.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_trans2_query_path_information(c, buff)
|
||||
smb = @state[c]
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param path [String] The path which the client is requesting info from.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_find_file_both_directory_info(c, path)
|
||||
contents = get_file_contents(client: c)
|
||||
|
||||
|
@ -56,7 +56,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param path [String] The path which the client is requesting info from.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_find_file_names_info(c, path)
|
||||
if path && path.ends_with?(file_name.downcase)
|
||||
data = Rex::Text.to_unicode(file_name)
|
||||
|
@ -76,7 +76,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param path [String] The path which the client is requesting info from.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_find_file_full_directory_info(c, path)
|
||||
contents = get_file_contents(client: c)
|
||||
|
||||
|
@ -120,15 +120,15 @@ module Msf
|
|||
# information level.
|
||||
#
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param opts [Hash{Symbol => <Fixnum, String>}] Response custom values.
|
||||
# @option opts [Fixnum] :search_count The number of entries returned by the search.
|
||||
# @option opts [Fixnum] :end_of_search 0 if search continues or nonzero otherwise.
|
||||
# @option opts [Fixnum] :ea_error_offset should be 0 for SMB_FIND_FILE_BOTH_DIRECTORY_INFO.
|
||||
# @option opts [Fixnum] :end_of_file The byte offset to the end of the file.
|
||||
# @option opts [Fixnum] :allocation_size The file allocation size in bytes.
|
||||
# @option opts [Fixnum] :file_attributes The extended file attributes of the file.
|
||||
# @param opts [Hash{Symbol => <Integer, String>}] Response custom values.
|
||||
# @option opts [Integer] :search_count The number of entries returned by the search.
|
||||
# @option opts [Integer] :end_of_search 0 if search continues or nonzero otherwise.
|
||||
# @option opts [Integer] :ea_error_offset should be 0 for SMB_FIND_FILE_BOTH_DIRECTORY_INFO.
|
||||
# @option opts [Integer] :end_of_file The byte offset to the end of the file.
|
||||
# @option opts [Integer] :allocation_size The file allocation size in bytes.
|
||||
# @option opts [Integer] :file_attributes The extended file attributes of the file.
|
||||
# @option opts [String] :data The long name of the file.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_find_file_both_directory_info_res(c, opts = {})
|
||||
data = opts[:data] || ''
|
||||
search_count = opts[:search_count] || 0
|
||||
|
@ -170,9 +170,9 @@ module Msf
|
|||
# Builds and sends an TRANS2_FIND_FIRST2 response with SMB_FIND_FILE_NAMES_INFO
|
||||
# information level.
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param opts [Hash{Symbol => <Fixnum, String>}] Response custom values.
|
||||
# @param opts [Hash{Symbol => <Integer, String>}] Response custom values.
|
||||
# @option opts [String] :data The long name of the file.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_find_file_names_info_res(c, opts = {})
|
||||
data = opts[:data] || ''
|
||||
|
||||
|
@ -198,15 +198,15 @@ module Msf
|
|||
# information level.
|
||||
#
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param opts [Hash{Symbol => <Fixnum, String>}] Response custom values.
|
||||
# @option opts [Fixnum] :search_count The number of entries returned by the search.
|
||||
# @option opts [Fixnum] :end_of_search 0 if search continues or nonzero otherwise.
|
||||
# @option opts [Fixnum] :ea_error_offset should be 0 for SMB_FIND_FILE_FULL_DIRECTORY_INFO.
|
||||
# @option opts [Fixnum] :end_of_file The byte offset to the end of the file.
|
||||
# @option opts [Fixnum] :allocation_size The file allocation size in bytes.
|
||||
# @option opts [Fixnum] :file_attributes The extended file attributes of the file.
|
||||
# @param opts [Hash{Symbol => <Integer, String>}] Response custom values.
|
||||
# @option opts [Integer] :search_count The number of entries returned by the search.
|
||||
# @option opts [Integer] :end_of_search 0 if search continues or nonzero otherwise.
|
||||
# @option opts [Integer] :ea_error_offset should be 0 for SMB_FIND_FILE_FULL_DIRECTORY_INFO.
|
||||
# @option opts [Integer] :end_of_file The byte offset to the end of the file.
|
||||
# @option opts [Integer] :allocation_size The file allocation size in bytes.
|
||||
# @option opts [Integer] :file_attributes The extended file attributes of the file.
|
||||
# @option opts [String] :data The long name of the file.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_find_full_directory_info_res(c, opts = {})
|
||||
data = opts[:data] || ''
|
||||
search_count = opts[:search_count] || 0
|
||||
|
|
|
@ -10,8 +10,8 @@ module Msf
|
|||
# Information Level.
|
||||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param fid [Fixnum] The file identifier which the client is requesting info from.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @param fid [Integer] The file identifier which the client is requesting info from.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_trans_query_file_info_basic(c, fid)
|
||||
smb = @state[c]
|
||||
|
||||
|
@ -30,8 +30,8 @@ module Msf
|
|||
# Information Level.
|
||||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param fid [Fixnum] The file identifier which the client is requesting info from.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @param fid [Integer] The file identifier which the client is requesting info from.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_trans_query_file_info_standard(c, fid)
|
||||
contents = get_file_contents(client: c)
|
||||
|
||||
|
@ -49,7 +49,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param path [String] The path which the client is requesting info from.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_trans_query_path_info_basic(c, path)
|
||||
if path && path.ends_with?(file_name.downcase)
|
||||
attrib = CONST::SMB_EXT_FILE_ATTR_NORMAL
|
||||
|
@ -69,7 +69,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param path [String] The path which the client is requesting info from.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_trans_query_path_info_standard(c, path)
|
||||
contents = get_file_contents(client: c)
|
||||
|
||||
|
@ -97,7 +97,7 @@ module Msf
|
|||
#
|
||||
# @param c [Socket] The client sending the request.
|
||||
# @param path [String] The path which the client is requesting info from.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def smb_cmd_trans_query_path_info_network(c, path)
|
||||
contents = get_file_contents(client: c)
|
||||
|
||||
|
@ -122,9 +122,9 @@ module Msf
|
|||
# information level.
|
||||
#
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param opts [Hash{Symbol => <Fixnum, String>}] Response custom values.
|
||||
# @option opts [Fixnum] :file_attributes The extended file attributes of the file.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @param opts [Hash{Symbol => <Integer, String>}] Response custom values.
|
||||
# @option opts [Integer] :file_attributes The extended file attributes of the file.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_info_basic_res(c, opts = {})
|
||||
file_attributes = opts[:file_attributes] || 0
|
||||
|
||||
|
@ -149,13 +149,13 @@ module Msf
|
|||
# information level.
|
||||
#
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param opts [Hash{Symbol => <Fixnum, String>}] Response custom values.
|
||||
# @option opts [Fixnum] :allocation_size The number of bytes that are allocated to the file.
|
||||
# @option opts [Fixnum] :number_links The number of hard links to the file.
|
||||
# @option opts [Fixnum] :delete_pending Indicates whether there is a delete action pending for the file.
|
||||
# @option opts [Fixnum] :directory Indicates whether the file is a directory.
|
||||
# @option opts [Fixnum] :end_of_file The offset from the start to the end of the file.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @param opts [Hash{Symbol => <Integer, String>}] Response custom values.
|
||||
# @option opts [Integer] :allocation_size The number of bytes that are allocated to the file.
|
||||
# @option opts [Integer] :number_links The number of hard links to the file.
|
||||
# @option opts [Integer] :delete_pending Indicates whether there is a delete action pending for the file.
|
||||
# @option opts [Integer] :directory Indicates whether the file is a directory.
|
||||
# @option opts [Integer] :end_of_file The offset from the start to the end of the file.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_info_standard_res(c, opts = {})
|
||||
allocation_size = opts[:allocation_size] || 0
|
||||
number_links = opts[:number_links] || 0
|
||||
|
@ -180,11 +180,11 @@ module Msf
|
|||
# information level.
|
||||
#
|
||||
# @param c [Socket] The client to answer.
|
||||
# @param opts [Hash{Symbol => <Fixnum, String>}] Response custom values.
|
||||
# @option opts [Fixnum] :allocation_size The number of bytes that are allocated to the file.
|
||||
# @option opts [Fixnum] :end_of_file The offset from the start to the end of the file.
|
||||
# @option opts [Fixnum] :file_attributes The file attributes.
|
||||
# @return [Fixnum] The number of bytes returned to the client as response.
|
||||
# @param opts [Hash{Symbol => <Integer, String>}] Response custom values.
|
||||
# @option opts [Integer] :allocation_size The number of bytes that are allocated to the file.
|
||||
# @option opts [Integer] :end_of_file The offset from the start to the end of the file.
|
||||
# @option opts [Integer] :file_attributes The file attributes.
|
||||
# @return [Integer] The number of bytes returned to the client as response.
|
||||
def send_info_network_res(c, opts= {})
|
||||
allocation_size = opts[:allocation_size] || 0
|
||||
end_of_file = opts[:end_of_file] || 0
|
||||
|
|
|
@ -22,7 +22,7 @@ module Msf::Module::UI::Message
|
|||
|
||||
xn ||= datastore['ExploitNumber']
|
||||
xn ||= framework.datastore['ExploitNumber']
|
||||
if xn.is_a?(Fixnum)
|
||||
if xn.is_a?(Integer)
|
||||
prefix << "[%04d] " % xn
|
||||
end
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ module Payload::Linux::BindTcp
|
|||
#
|
||||
# Generate an assembly stub with the configured feature set and options.
|
||||
#
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [Bool] :reliable Whether or not to enable error handling code
|
||||
#
|
||||
def asm_bind_tcp(opts={})
|
||||
|
|
|
@ -79,7 +79,7 @@ module Payload::Linux::ReverseTcp
|
|||
#
|
||||
# Generate an assembly stub with the configured feature set and options.
|
||||
#
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :host The host IP to connect to
|
||||
# @option opts [Bool] :reliable Whether or not to enable error handling code
|
||||
#
|
||||
|
|
|
@ -94,8 +94,8 @@ class Msf::Payload::UUID
|
|||
# @option opts [String] :arch The hardware architecture for this payload
|
||||
# @option opts [String] :platform The operating system platform for this payload
|
||||
# @option opts [String] :timestamp The timestamp in UTC Unix epoch format
|
||||
# @option opts [Fixnum] :xor1 An optional 8-bit XOR ID for obfuscation
|
||||
# @option opts [Fixnum] :xor2 An optional 8-bit XOR ID for obfuscation
|
||||
# @option opts [Integer] :xor1 An optional 8-bit XOR ID for obfuscation
|
||||
# @option opts [Integer] :xor2 An optional 8-bit XOR ID for obfuscation
|
||||
# @return [String] The encoded payoad UUID as a binary string
|
||||
#
|
||||
def self.generate_raw(opts={})
|
||||
|
@ -195,7 +195,7 @@ class Msf::Payload::UUID
|
|||
# Look up the numeric platform ID given a string or PlatformList as input
|
||||
#
|
||||
# @param platform [String] The name of the platform to lookup
|
||||
# @return [Fixnum] The integer value of this platform
|
||||
# @return [Integer] The integer value of this platform
|
||||
#
|
||||
def self.find_platform_id(platform)
|
||||
# Handle a PlatformList input by grabbing the first entry
|
||||
|
@ -218,7 +218,7 @@ class Msf::Payload::UUID
|
|||
# Look up the numeric architecture ID given a string as input
|
||||
#
|
||||
# @param name [String] The name of the architecture to lookup
|
||||
# @return [Fixnum] The integer value of this architecture
|
||||
# @return [Integer] The integer value of this architecture
|
||||
#
|
||||
def self.find_architecture_id(name)
|
||||
name = name.first if name.kind_of? ::Array
|
||||
|
|
|
@ -27,7 +27,7 @@ module Msf::Payload::UUID::Options
|
|||
# the desired length can accommodate it.
|
||||
#
|
||||
# @param mode [Symbol] The type of checksum to generate (:connect, :init_native, :init_python, :init_java)
|
||||
# @param len [Fixnum] The length of the URI not including the leading slash, optionally nil for random
|
||||
# @param len [Integer] The length of the URI not including the leading slash, optionally nil for random
|
||||
# @return [String] A URI with a leading slash that hashes to the checksum, with an optional UUID
|
||||
#
|
||||
def generate_uri_uuid_mode(mode, len = nil, uuid: nil)
|
||||
|
|
|
@ -101,7 +101,7 @@ module Payload::Windows::BindTcp
|
|||
#
|
||||
# Generate an assembly stub with the configured feature set and options.
|
||||
#
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh
|
||||
# @option opts [Bool] :reliable Whether or not to enable error handling code
|
||||
#
|
||||
|
|
|
@ -145,14 +145,14 @@ module Payload::Windows::ReverseHttp
|
|||
# @option opts [Bool] :ssl Whether or not to enable SSL
|
||||
# @option opts [String] :url The URI to request during staging
|
||||
# @option opts [String] :host The host to connect to
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh
|
||||
# @option opts [String] :proxy_host The optional proxy server host to use
|
||||
# @option opts [Fixnum] :proxy_port The optional proxy server port to use
|
||||
# @option opts [Integer] :proxy_port The optional proxy server port to use
|
||||
# @option opts [String] :proxy_type The optional proxy server type, one of HTTP or SOCKS
|
||||
# @option opts [String] :proxy_user The optional proxy server username
|
||||
# @option opts [String] :proxy_pass The optional proxy server password
|
||||
# @option opts [Fixnum] :retry_count The number of times to retry a failed request before giving up
|
||||
# @option opts [Integer] :retry_count The number of times to retry a failed request before giving up
|
||||
#
|
||||
def asm_reverse_http(opts={})
|
||||
|
||||
|
|
|
@ -93,9 +93,9 @@ module Payload::Windows::ReverseTcp
|
|||
#
|
||||
# Generate an assembly stub with the configured feature set and options.
|
||||
#
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh
|
||||
# @option opts [Fixnum] :retry_count Number of retry attempts
|
||||
# @option opts [Integer] :retry_count Number of retry attempts
|
||||
#
|
||||
def asm_reverse_tcp(opts={})
|
||||
|
||||
|
|
|
@ -65,9 +65,9 @@ module Payload::Windows::ReverseTcpDns
|
|||
#
|
||||
# Generate an assembly stub with the configured feature set and options.
|
||||
#
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh
|
||||
# @option opts [Fixnum] :retry_count Number of retry attempts
|
||||
# @option opts [Integer] :retry_count Number of retry attempts
|
||||
#
|
||||
def asm_reverse_tcp_dns(opts={})
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ module Payload::Windows::ReverseTcpRc4
|
|||
#
|
||||
# Generate an assembly stub with the configured feature set and options.
|
||||
#
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh
|
||||
# @option opts [Bool] :reliable Whether or not to enable error handling code
|
||||
#
|
||||
|
|
|
@ -115,10 +115,10 @@ module Payload::Windows::ReverseWinHttp
|
|||
# @option opts [Bool] :ssl Whether or not to enable SSL
|
||||
# @option opts [String] :uri The URI to request during staging
|
||||
# @option opts [String] :host The host to connect to
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :verify_cert_hash A 20-byte raw SHA-1 hash of the certificate to verify, or nil
|
||||
# @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh
|
||||
# @option opts [Fixnum] :retry_count The number of times to retry a failed request before giving up
|
||||
# @option opts [Integer] :retry_count The number of times to retry a failed request before giving up
|
||||
#
|
||||
def asm_reverse_winhttp(opts={})
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ module Payload::Windows::BindTcp_x64
|
|||
#
|
||||
# Generate an assembly stub with the configured feature set and options.
|
||||
#
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh
|
||||
# @option opts [Bool] :reliable Whether or not to enable error handling code
|
||||
#
|
||||
|
|
|
@ -144,14 +144,14 @@ module Payload::Windows::ReverseHttp_x64
|
|||
# @option opts [Bool] :ssl Whether or not to enable SSL
|
||||
# @option opts [String] :url The URI to request during staging
|
||||
# @option opts [String] :host The host to connect to
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh
|
||||
# @option opts [String] :proxy_host The optional proxy server host to use
|
||||
# @option opts [Fixnum] :proxy_port The optional proxy server port to use
|
||||
# @option opts [Integer] :proxy_port The optional proxy server port to use
|
||||
# @option opts [String] :proxy_type The optional proxy server type, one of HTTP or SOCKS
|
||||
# @option opts [String] :proxy_user The optional proxy server username
|
||||
# @option opts [String] :proxy_pass The optional proxy server password
|
||||
# @option opts [Fixnum] :retry_count The number of times to retry a failed request before giving up
|
||||
# @option opts [Integer] :retry_count The number of times to retry a failed request before giving up
|
||||
#
|
||||
def asm_reverse_http(opts={})
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ module Payload::Windows::ReverseTcp_x64
|
|||
#
|
||||
# Generate an assembly stub with the configured feature set and options.
|
||||
#
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh
|
||||
# @option opts [Bool] :reliable Whether or not to enable error handling code
|
||||
#
|
||||
|
|
|
@ -117,10 +117,10 @@ module Payload::Windows::ReverseWinHttp_x64
|
|||
# @option opts [Bool] :ssl Whether or not to enable SSL
|
||||
# @option opts [String] :uri The URI to request during staging
|
||||
# @option opts [String] :host The host to connect to
|
||||
# @option opts [Fixnum] :port The port to connect to
|
||||
# @option opts [Integer] :port The port to connect to
|
||||
# @option opts [String] :verify_cert_hash A 20-byte raw SHA-1 hash of the certificate to verify, or nil
|
||||
# @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh
|
||||
# @option opts [Fixnum] :retry_count The number of times to retry a failed request before giving up
|
||||
# @option opts [Integer] :retry_count The number of times to retry a failed request before giving up
|
||||
#
|
||||
def asm_reverse_winhttp(opts={})
|
||||
|
||||
|
|
|
@ -51,13 +51,13 @@ module Msf
|
|||
# @return [Msf::Framework] The framework instance to use for generation
|
||||
attr_accessor :framework
|
||||
# @!attribute iterations
|
||||
# @return [Fixnum] The number of iterations to run the encoder
|
||||
# @return [Integer] The number of iterations to run the encoder
|
||||
attr_accessor :iterations
|
||||
# @!attribute keep
|
||||
# @return [Boolean] Whether or not to preserve the original functionality of the template
|
||||
attr_accessor :keep
|
||||
# @!attribute nops
|
||||
# @return [Fixnum] The size in bytes of NOP sled to prepend the payload with
|
||||
# @return [Integer] The size in bytes of NOP sled to prepend the payload with
|
||||
attr_accessor :nops
|
||||
# @!attribute payload
|
||||
# @return [String] The refname of the payload to generate
|
||||
|
@ -69,10 +69,10 @@ module Msf
|
|||
# @return [Boolean] Whether or not to find the smallest possible output
|
||||
attr_accessor :smallest
|
||||
# @!attribute space
|
||||
# @return [Fixnum] The maximum size in bytes of the payload
|
||||
# @return [Integer] The maximum size in bytes of the payload
|
||||
attr_accessor :space
|
||||
# @!attribute encoder_space
|
||||
# @return [Fixnum] The maximum size in bytes of the encoded payload
|
||||
# @return [Integer] The maximum size in bytes of the encoded payload
|
||||
attr_accessor :encoder_space
|
||||
# @!attribute stdin
|
||||
# @return [String] The raw bytes of a payload taken from STDIN
|
||||
|
@ -89,14 +89,14 @@ module Msf
|
|||
# @option opts [String] :payload (see #payload)
|
||||
# @option opts [String] :format (see #format)
|
||||
# @option opts [String] :encoder (see #encoder)
|
||||
# @option opts [Fixnum] :iterations (see #iterations)
|
||||
# @option opts [Integer] :iterations (see #iterations)
|
||||
# @option opts [String] :arch (see #arch)
|
||||
# @option opts [String] :platform (see #platform)
|
||||
# @option opts [String] :badchars (see #badchars)
|
||||
# @option opts [String] :template (see #template)
|
||||
# @option opts [Fixnum] :space (see #space)
|
||||
# @option opts [Fixnum] :encoder_space (see #encoder_space)
|
||||
# @option opts [Fixnum] :nops (see #nops)
|
||||
# @option opts [Integer] :space (see #space)
|
||||
# @option opts [Integer] :encoder_space (see #encoder_space)
|
||||
# @option opts [Integer] :nops (see #nops)
|
||||
# @option opts [String] :add_code (see #add_code)
|
||||
# @option opts [Boolean] :keep (see #keep)
|
||||
# @option opts [Hash] :datastore (see #datastore)
|
||||
|
|
|
@ -57,7 +57,7 @@ class Msf::Post < Msf::Module
|
|||
# is currently running against.
|
||||
#
|
||||
# @return [NilClass] if there is no database record for the session
|
||||
# @return [Fixnum] if there is a database record to get the id for
|
||||
# @return [Integer] if there is a database record to get the id for
|
||||
def session_db_id
|
||||
if session.db_record
|
||||
session.db_record.id
|
||||
|
|
|
@ -533,7 +533,7 @@ protected
|
|||
#
|
||||
# Calculate the maximum line length for a unix shell.
|
||||
#
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
def _unix_max_line_length
|
||||
# Based on autoconf's arg_max calculator, see
|
||||
# http://www.in-ulm.de/~mascheck/various/argmax/autoconf_check.html
|
||||
|
|
|
@ -268,7 +268,7 @@ module Accounts
|
|||
|
||||
# Gets an impersonation token from the primary token.
|
||||
#
|
||||
# @return [Fixnum] the impersonate token handle identifier if success, nil if
|
||||
# @return [Integer] the impersonate token handle identifier if success, nil if
|
||||
# fails
|
||||
def get_imperstoken
|
||||
adv = session.railgun.advapi32
|
||||
|
@ -291,7 +291,7 @@ module Accounts
|
|||
# to an access token.
|
||||
#
|
||||
# @param [String] dir the directory path
|
||||
# @param [Fixnum] token the access token
|
||||
# @param [Integer] token the access token
|
||||
# @return [String, nil] a String describing the permissions or nil
|
||||
def check_dir_perms(dir, token)
|
||||
adv = session.railgun.advapi32
|
||||
|
|
|
@ -108,7 +108,7 @@ module LDAP
|
|||
# Performs an ldap query
|
||||
#
|
||||
# @param filter [String] LDAP search filter
|
||||
# @param max_results [Fixnum] Maximum results
|
||||
# @param max_results [Integer] Maximum results
|
||||
# @param fields [Array<String>] Attributes to retrieve
|
||||
# @param domain [String] Optional domain or distinguished name
|
||||
# @return [Hash] Entries found
|
||||
|
@ -158,9 +158,9 @@ module LDAP
|
|||
# Performs a query on the LDAP session
|
||||
#
|
||||
# @param session_handle [Handle] LDAP Session Handle
|
||||
# @param base [Fixnum] Pointer to string that contains distinguished
|
||||
# @param base [Integer] Pointer to string that contains distinguished
|
||||
# name of entry to start the search
|
||||
# @param scope [Fixnum] Search Scope
|
||||
# @param scope [Integer] Search Scope
|
||||
# @param filter [String] Search Filter
|
||||
# @param fields [Array<String>] Attributes to retrieve
|
||||
# @return [Hash] Entries found
|
||||
|
@ -245,7 +245,7 @@ module LDAP
|
|||
|
||||
# Gets the LDAP Entry
|
||||
#
|
||||
# @param pEntry [Fixnum] Pointer to the Entry
|
||||
# @param pEntry [Integer] Pointer to the Entry
|
||||
# @return [Array] Entry data structure
|
||||
def get_entry(pEntry)
|
||||
return client.railgun.memread(pEntry,41).unpack('VVVVVVVVVvCCC')
|
||||
|
@ -328,7 +328,7 @@ module LDAP
|
|||
end
|
||||
|
||||
# Binds to the default LDAP Server
|
||||
# @param size_limit [Fixnum] Maximum number of results to return in a query
|
||||
# @param size_limit [Integer] Maximum number of results to return in a query
|
||||
# @param domain [String] Optional domain or distinguished name
|
||||
# @return LDAP session handle
|
||||
def bind_default_ldap_server(size_limit, domain=nil)
|
||||
|
|
|
@ -10,8 +10,8 @@ module Process
|
|||
# Injects shellcode to a process, and executes it.
|
||||
#
|
||||
# @param shellcode [String] The shellcode to execute
|
||||
# @param base_addr [Fixnum] The base address to allocate memory
|
||||
# @param pid [Fixnum] The process ID to inject to
|
||||
# @param base_addr [Integer] The base address to allocate memory
|
||||
# @param pid [Integer] The process ID to inject to
|
||||
#
|
||||
# @return [Boolean] True if successful, otherwise false
|
||||
#
|
||||
|
|
|
@ -21,7 +21,7 @@ module Msf::Post::Windows::ReflectiveDLLInjection
|
|||
# The process to inject the shellcode into.
|
||||
# @param shellcode [String] The shellcode to inject.
|
||||
#
|
||||
# @return [Fixnum] Address of the shellcode in the target process's
|
||||
# @return [Integer] Address of the shellcode in the target process's
|
||||
# memory.
|
||||
def inject_into_process(process, shellcode)
|
||||
shellcode_size = shellcode.length
|
||||
|
|
|
@ -55,11 +55,11 @@ module Services
|
|||
# @param opts [Hash]
|
||||
# @option opts [String] :host (nil) The host on which to open the
|
||||
# service manager. May be a hostname or IP address.
|
||||
# @option opts [Fixnum] :access (0xF003F) Bitwise-or of the
|
||||
# @option opts [Integer] :access (0xF003F) Bitwise-or of the
|
||||
# SC_MANAGER_* constants (see
|
||||
# {http://msdn.microsoft.com/en-us/library/windows/desktop/ms685981(v=vs.85).aspx})
|
||||
#
|
||||
# @return [Fixnum] Opaque Windows handle SC_HANDLE as returned by
|
||||
# @return [Integer] Opaque Windows handle SC_HANDLE as returned by
|
||||
# OpenSCManagerA()
|
||||
# @yield [manager] Gives the block a manager handle as returned by
|
||||
# advapi32.dll!OpenSCManagerA. When the block returns, the handle
|
||||
|
@ -105,7 +105,7 @@ module Services
|
|||
# Open the service with advapi32.dll!OpenServiceA on the
|
||||
# target manager
|
||||
#
|
||||
# @return [Fixnum] Opaque Windows handle SC_HANDLE as returned by
|
||||
# @return [Integer] Opaque Windows handle SC_HANDLE as returned by
|
||||
# OpenServiceA()
|
||||
# @yield [manager] Gives the block a service handle as returned by
|
||||
# advapi32.dll!OpenServiceA. When the block returns, the handle
|
||||
|
@ -376,7 +376,7 @@ module Services
|
|||
# @param server [String,nil] A hostname or IP address. Default is the
|
||||
# remote localhost
|
||||
#
|
||||
# @return [Fixnum] 0 if service started successfully, 1 if it failed
|
||||
# @return [Integer] 0 if service started successfully, 1 if it failed
|
||||
# because the service is already running, 2 if it is disabled
|
||||
#
|
||||
# @raise [RuntimeError] if OpenServiceA failed
|
||||
|
@ -395,7 +395,7 @@ module Services
|
|||
# Stop a service.
|
||||
#
|
||||
# @param (see #service_start)
|
||||
# @return [Fixnum] 0 if service stopped successfully, 1 if it failed
|
||||
# @return [Integer] 0 if service stopped successfully, 1 if it failed
|
||||
# because the service is already stopped or disabled, 2 if it
|
||||
# cannot be stopped for some other reason.
|
||||
#
|
||||
|
|
|
@ -131,7 +131,7 @@ module Msf::PostMixin
|
|||
#
|
||||
# Checks the session's type against this module's
|
||||
# <tt>module_info["SessionTypes"]</tt> as well as examining platform
|
||||
# compatibility. +sess_or_sid+ can be a Session object, Fixnum, or
|
||||
# compatibility. +sess_or_sid+ can be a Session object, Integer, or
|
||||
# String. In the latter cases it should be a key in
|
||||
# +framework.sessions+.
|
||||
#
|
||||
|
@ -139,14 +139,14 @@ module Msf::PostMixin
|
|||
# value from this method does not guarantee the module will work
|
||||
# with the session.
|
||||
#
|
||||
# @param sess_or_sid [Msf::Session,Fixnum,String]
|
||||
# @param sess_or_sid [Msf::Session,Integer,String]
|
||||
# A session or session ID to compare against this module for
|
||||
# compatibility.
|
||||
#
|
||||
def session_compatible?(sess_or_sid)
|
||||
# Normalize the argument to an actual Session
|
||||
case sess_or_sid
|
||||
when ::Fixnum, ::String
|
||||
when ::Integer, ::String
|
||||
s = framework.sessions[sess_or_sid.to_i]
|
||||
when ::Msf::Session
|
||||
s = sess_or_sid
|
||||
|
|
|
@ -29,9 +29,9 @@ module Msf::ReflectiveDLLLoader
|
|||
# Load a reflectively-injectable DLL from an string and find the offset
|
||||
# to the ReflectiveLoader function inside the DLL.
|
||||
#
|
||||
# @param [Fixnum] dll_data the DLL to load.
|
||||
# @param [Integer] dll_data the DLL to load.
|
||||
#
|
||||
# @return [Fixnum] offset to the +ReflectiveLoader+ function within the DLL.
|
||||
# @return [Integer] offset to the +ReflectiveLoader+ function within the DLL.
|
||||
def load_rdi_dll_from_data(dll_data)
|
||||
offset = parse_pe(dll_data)
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ class Exception < RuntimeError
|
|||
|
||||
# Initializes Exception.
|
||||
#
|
||||
# @param [Fixnum] code An error code.
|
||||
# @param [Integer] code An error code.
|
||||
# @param [String] message An error message.
|
||||
# @return [void]
|
||||
def initialize(code, message)
|
||||
|
@ -25,7 +25,7 @@ class ServerException < RuntimeError
|
|||
|
||||
# Initializes ServerException.
|
||||
#
|
||||
# @param [Fixnum] code An error code.
|
||||
# @param [Integer] code An error code.
|
||||
# @param [String] error_message An error message.
|
||||
# @param [Exception] error_class An error class.
|
||||
# @param [Array] error_backtrace A backtrace of the error.
|
||||
|
|
|
@ -17,7 +17,7 @@ class RPC_Base
|
|||
|
||||
# Raises an Msf::RPC Exception.
|
||||
#
|
||||
# @param [Fixnum] code The error code to raise.
|
||||
# @param [Integer] code The error code to raise.
|
||||
# @param [String] message The error message.
|
||||
# @raise [Msf::RPC::Exception]
|
||||
# @return [void]
|
||||
|
|
|
@ -19,7 +19,7 @@ class RPC_Console < RPC_Base
|
|||
#
|
||||
# @param [Hash] opts See Msf::Ui::Web::Driver#create_console
|
||||
# @return [Hash] Information about the new console. It contains the following keys:
|
||||
# * 'id' [Fixnum] The console's ID.
|
||||
# * 'id' [Integer] The console's ID.
|
||||
# * 'prompt' [String] The framework prompt (example: 'msf > ')
|
||||
# * 'busy' [TrueClass] The console's busy state, or
|
||||
# * 'busy' [FalseClass] The console's busy state.
|
||||
|
@ -39,7 +39,7 @@ class RPC_Console < RPC_Base
|
|||
#
|
||||
# @return [Hash] Console information.
|
||||
# * 'consoles' [Array<Hash>] consoles, each element is a hash that includes:
|
||||
# * 'id' [Fixnum] The console's ID
|
||||
# * 'id' [Integer] The console's ID
|
||||
# * 'prompt' [String] The framework prompt (example: 'msf > ')
|
||||
# * 'busy' [TrueClass] The console's busy state, or
|
||||
# * 'busy' [FalseClass] The console's busy state.
|
||||
|
@ -60,7 +60,7 @@ class RPC_Console < RPC_Base
|
|||
|
||||
# Deletes a framework console instance.
|
||||
#
|
||||
# @param [Fixnum] cid Framework console ID.
|
||||
# @param [Integer] cid Framework console ID.
|
||||
# @return [Hash] A result indicating whether the action was successful or not.
|
||||
# It contains the following key:
|
||||
# * 'result' [String] Either 'success' or 'failure'.
|
||||
|
@ -76,7 +76,7 @@ class RPC_Console < RPC_Base
|
|||
|
||||
# Returns the framework console output in raw form.
|
||||
#
|
||||
# @param [Fixnum] cid Framework console ID.
|
||||
# @param [Integer] cid Framework console ID.
|
||||
# @return [Hash] There are two different hashes you might get:
|
||||
#
|
||||
# If the console ID is invalid, you will get a hash like the following:
|
||||
|
@ -101,14 +101,14 @@ class RPC_Console < RPC_Base
|
|||
|
||||
# Sends an input (such as a command) to the framework console.
|
||||
#
|
||||
# @param [Fixnum] cid Framework console ID.
|
||||
# @param [Integer] cid Framework console ID.
|
||||
# @param [String] data User input.
|
||||
# @return [Hash] There are two different hashes you might get:
|
||||
#
|
||||
# If the console ID is invalid, you will get a hash like the following:
|
||||
# * 'result' [String] A value that says 'failure'.
|
||||
# If the console ID is invalid, you will get a hash like the following:
|
||||
# * 'wrote' [Fixnum] Number of bytes sent.
|
||||
# * 'wrote' [Integer] Number of bytes sent.
|
||||
# @note Remember to add a newline (\\r\\n) at the end of input, otherwise
|
||||
# the console will not do anything. And you will need to use the
|
||||
# #rpc_read method to retrieve the output again.
|
||||
|
@ -124,7 +124,7 @@ class RPC_Console < RPC_Base
|
|||
|
||||
# Returns the tab-completed version of your input (such as a module path).
|
||||
#
|
||||
# @param [Fixnum] cid Framework console ID.
|
||||
# @param [Integer] cid Framework console ID.
|
||||
# @param [String] line Command.
|
||||
# @return [Hash] There are two different hashes you might get:
|
||||
#
|
||||
|
@ -146,7 +146,7 @@ class RPC_Console < RPC_Base
|
|||
# Kills a framework session. This serves the same purpose as [CTRL]+[C] to abort an interactive session.
|
||||
# You might also want to considering using the session API calls instead of this.
|
||||
#
|
||||
# @param [Fixnum] cid Framework console ID.
|
||||
# @param [Integer] cid Framework console ID.
|
||||
# @return [Hash] A hash indicating whether the action was successful or not. It contains:
|
||||
# * 'result' [String] A message that says 'success' if the console ID is valid (and successfully killed, otherwise 'failed')
|
||||
# @example Here's how you would use this from the client:
|
||||
|
@ -162,7 +162,7 @@ class RPC_Console < RPC_Base
|
|||
# Detaches a framework session. This serves the same purpose as [CTRL]+[Z] to
|
||||
# background an interactive session.
|
||||
#
|
||||
# @param [Fixnum] cid Framework console ID.
|
||||
# @param [Integer] cid Framework console ID.
|
||||
# @return [Hash] A hash indicating whether the action was successful or not. It contains:
|
||||
# * 'result' [String] A message that says 'success' if the console ID is valid (and successfully detached, otherwise 'failed')
|
||||
# @example Here's how you would use this from the client:
|
||||
|
|
|
@ -84,12 +84,12 @@ class RPC_Core < RPC_Base
|
|||
# Reloads framework modules. This will take some time to complete.
|
||||
#
|
||||
# @return [Hash] Module stats that contain the following keys:
|
||||
# * 'exploits' [Fixnum] The number of exploits reloaded.
|
||||
# * 'auxiliary' [Fixnum] The number of auxiliary modules reloaded.
|
||||
# * 'post' [Fixnum] The number of post modules reloaded.
|
||||
# * 'encoders' [Fixnum] The number of encoders reloaded.
|
||||
# * 'nops' [Fixnum] The number of NOP modules reloaded.
|
||||
# * 'payloads' [Fixnum] The number of payloads reloaded.
|
||||
# * 'exploits' [Integer] The number of exploits reloaded.
|
||||
# * 'auxiliary' [Integer] The number of auxiliary modules reloaded.
|
||||
# * 'post' [Integer] The number of post modules reloaded.
|
||||
# * 'encoders' [Integer] The number of encoders reloaded.
|
||||
# * 'nops' [Integer] The number of NOP modules reloaded.
|
||||
# * 'payloads' [Integer] The number of payloads reloaded.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('core.reload_modules')
|
||||
def rpc_reload_modules
|
||||
|
@ -105,12 +105,12 @@ class RPC_Core < RPC_Base
|
|||
#
|
||||
# @param [String] path The new path to load.
|
||||
# @return [Hash] Module stats that contain the following keys:
|
||||
# * 'exploits' [Fixnum] The number of exploits loaded.
|
||||
# * 'auxiliary' [Fixnum] The number of auxiliary modules loaded.
|
||||
# * 'post' [Fixnum] The number of post modules loaded.
|
||||
# * 'encoders' [Fixnum] The number of encoders loaded.
|
||||
# * 'nops' [Fixnum] The number of NOP modules loaded.
|
||||
# * 'payloads' [Fixnum] The number of payloads loaded.
|
||||
# * 'exploits' [Integer] The number of exploits loaded.
|
||||
# * 'auxiliary' [Integer] The number of auxiliary modules loaded.
|
||||
# * 'post' [Integer] The number of post modules loaded.
|
||||
# * 'encoders' [Integer] The number of encoders loaded.
|
||||
# * 'nops' [Integer] The number of NOP modules loaded.
|
||||
# * 'payloads' [Integer] The number of payloads loaded.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('core.add_module_path', '/tmp/modules/')
|
||||
def rpc_add_module_path(path)
|
||||
|
@ -122,12 +122,12 @@ class RPC_Core < RPC_Base
|
|||
# Returns the module stats.
|
||||
#
|
||||
# @return [Hash] Module stats that contain the following keys:
|
||||
# * 'exploits' [Fixnum] The number of exploits.
|
||||
# * 'auxiliary' [Fixnum] The number of auxiliary modules.
|
||||
# * 'post' [Fixnum] The number of post modules.
|
||||
# * 'encoders' [Fixnum] The number of encoders.
|
||||
# * 'nops' [Fixnum] The number of NOP modules.
|
||||
# * 'payloads' [Fixnum] The number of payloads.
|
||||
# * 'exploits' [Integer] The number of exploits.
|
||||
# * 'auxiliary' [Integer] The number of auxiliary modules.
|
||||
# * 'post' [Integer] The number of post modules.
|
||||
# * 'encoders' [Integer] The number of encoders.
|
||||
# * 'nops' [Integer] The number of NOP modules.
|
||||
# * 'payloads' [Integer] The number of payloads.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('core.module_stats')
|
||||
def rpc_module_stats
|
||||
|
@ -170,7 +170,7 @@ class RPC_Core < RPC_Base
|
|||
|
||||
# Kills a framework thread.
|
||||
#
|
||||
# @param [Fixnum] tid The thread ID to kill.
|
||||
# @param [Integer] tid The thread ID to kill.
|
||||
# @return [Hash] A hash indicating the action was successful. It contains the following key:
|
||||
# * 'result' [String] A successful message: 'success'
|
||||
# @example Here's how you would use this from the client:
|
||||
|
|
|
@ -246,10 +246,10 @@ public
|
|||
# * 'creds' [Array<Hash>] An array of credentials. Each hash in the array will have the following:
|
||||
# * 'user' [String] Username.
|
||||
# * 'pass' [String] Password.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# * 'type' [String] Password type.
|
||||
# * 'host' [String] Host.
|
||||
# * 'port' [Fixnum] Port.
|
||||
# * 'port' [Integer] Port.
|
||||
# * 'proto' [String] Protocol.
|
||||
# * 'sname' [String] Service name.
|
||||
# @example Here's how you would use this from the client:
|
||||
|
@ -301,7 +301,7 @@ public
|
|||
# * 500 Invalid workspace.
|
||||
# @return [Hash] Host information that starts with the following hash key:
|
||||
# * 'hosts' [Array<Hash>] An array of hosts. Each hash in the array will have the following:
|
||||
# * 'created_at' [Fixnum] Creation date.
|
||||
# * 'created_at' [Integer] Creation date.
|
||||
# * 'address' [String] IP address.
|
||||
# * 'mac' [String] MAC address.
|
||||
# * 'name' [String] Computer name.
|
||||
|
@ -310,7 +310,7 @@ public
|
|||
# * 'os_flavor' [String] OS flavor.
|
||||
# * 'os_sp' [String] Service pack.
|
||||
# * 'os_lang' [String] OS language.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# * 'purpose' [String] Host purpose (example: server)
|
||||
# * 'info' [String] Additional information about the host.
|
||||
# @example Here's how you would use this from the client:
|
||||
|
@ -353,8 +353,8 @@ public
|
|||
#
|
||||
# @param [Hash] xopts Options:
|
||||
# @option xopts [String] :workspace Name of workspace.
|
||||
# @option xopts [Fixnum] :limit Limit.
|
||||
# @option xopts [Fixnum] :offset Offset.
|
||||
# @option xopts [Integer] :limit Limit.
|
||||
# @option xopts [Integer] :offset Offset.
|
||||
# @option xopts [String] :proto Protocol.
|
||||
# @option xopts [String] :address Address.
|
||||
# @option xopts [String] :ports Port range.
|
||||
|
@ -366,9 +366,9 @@ public
|
|||
# @return [Hash] A hash with the following keys:
|
||||
# * 'services' [Array<Hash>] In each hash of the array, you will get these keys:
|
||||
# * 'host' [String] Host.
|
||||
# * 'created_at' [Fixnum] Last created at.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'port' [Fixnum] Port.
|
||||
# * 'created_at' [Integer] Last created at.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# * 'port' [Integer] Port.
|
||||
# * 'proto' [String] Protocol.
|
||||
# * 'state' [String] Service state.
|
||||
# * 'name' [String] Service name.
|
||||
|
@ -413,8 +413,8 @@ public
|
|||
#
|
||||
# @param [Hash] xopts Options:
|
||||
# @option xopts [String] :workspace Name of workspace.
|
||||
# @option xopts [Fixnum] :limit Limit.
|
||||
# @option xopts [Fixnum] :offset Offset.
|
||||
# @option xopts [Integer] :limit Limit.
|
||||
# @option xopts [Integer] :offset Offset.
|
||||
# @option xopts [String] :proto Protocol.
|
||||
# @option xopts [String] :address Address.
|
||||
# @option xopts [String] :ports Port range.
|
||||
|
@ -424,9 +424,9 @@ public
|
|||
# * 500 Invalid workspace.
|
||||
# @return [Hash] A hash with the following key:
|
||||
# * 'vulns' [Array<Hash>] In each hash of the array, you will get these keys:
|
||||
# * 'port' [Fixnum] Port.
|
||||
# * 'port' [Integer] Port.
|
||||
# * 'proto' [String] Protocol.
|
||||
# * 'time' [Fixnum] Time reported.
|
||||
# * 'time' [Integer] Time reported.
|
||||
# * 'host' [String] Vulnerable host.
|
||||
# * 'name' [String] Exploit that was used.
|
||||
# * 'refs' [String] Vulnerability references.
|
||||
|
@ -472,10 +472,10 @@ public
|
|||
# @raise [Msf::RPC::Exception] Database not loaded.
|
||||
# @return [Hash] A hash with the following key:
|
||||
# * 'workspaces' [Array<Hash>] In each hash of the array, you will get these keys:
|
||||
# * 'id' [Fixnum] Workspace ID.
|
||||
# * 'id' [Integer] Workspace ID.
|
||||
# * 'name' [String] Workspace name.
|
||||
# * 'created_at' [Fixnum] Last created at.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'created_at' [Integer] Last created at.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('db.workspaces')
|
||||
def rpc_workspaces
|
||||
|
@ -500,7 +500,7 @@ public
|
|||
# @raise [Msf::RPC::Exception] Database not loaded. Try: rpc.call('console.create')
|
||||
# @return [Hash] A hash with the following keys:
|
||||
# * 'workspace' [String] Workspace name.
|
||||
# * 'workspace_id' [Fixnum] Workspace ID.
|
||||
# * 'workspace_id' [Integer] Workspace ID.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('db.current_workspace')
|
||||
def rpc_current_workspace
|
||||
|
@ -518,9 +518,9 @@ public
|
|||
# @return [Hash] A hash with the following key:
|
||||
# * 'workspace' [Array<Hash>] In each hash of the array, you will get these keys:
|
||||
# * 'name' [String] Workspace name.
|
||||
# * 'id' [Fixnum] Workspace ID.
|
||||
# * 'created_at' [Fixnum] Last created at.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'id' [Integer] Workspace ID.
|
||||
# * 'created_at' [Integer] Last created at.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('db.get_workspace')
|
||||
def rpc_get_workspace(wspace)
|
||||
|
@ -631,7 +631,7 @@ public
|
|||
# * 500 Invalid workspace.
|
||||
# @return [Hash] A hash that contains the following:
|
||||
# * 'host' [Array<Hash>] Each hash in the array contains the following:
|
||||
# * 'created_at' [Fixnum] Last created at.
|
||||
# * 'created_at' [Integer] Last created at.
|
||||
# * 'address' [String] Address.
|
||||
# * 'mac' [String] Mac address.
|
||||
# * 'name' [String] Host name.
|
||||
|
@ -640,7 +640,7 @@ public
|
|||
# * 'os_flavor' [String] OS flavor.
|
||||
# * 'os_sp' [String] OS service pack.
|
||||
# * 'os_lang' [String] OS language.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# * 'purpose' [String] Purpose. Example: 'server'.
|
||||
# * 'info' [String] Additional information.
|
||||
# @example Here's how you would use this from the client:
|
||||
|
@ -739,7 +739,7 @@ public
|
|||
# @param [Hash] xopts Filters for the search, see below:
|
||||
# @option xopts [String] :workspace Workspace name.
|
||||
# @option xopts [String] :proto Protocol.
|
||||
# @option xopts [Fixnum] :port Port.
|
||||
# @option xopts [Integer] :port Port.
|
||||
# @option xopts [String] :names Service names.
|
||||
# @raise [Msf::RPC::ServerException] You might get one of these errors:
|
||||
# * 500 ActiveRecord::ConnectionNotEstablished. Try: rpc.call('console.create').
|
||||
|
@ -748,8 +748,8 @@ public
|
|||
# @return [Hash] A hash that contains the following key:
|
||||
# * 'service' [Array<Hash>] Each hash in the array contains the following:
|
||||
# * 'host' [String] Host address.
|
||||
# * 'created_at' [Fixnum] Creation date.
|
||||
# * 'port' [Fixnum] Port.
|
||||
# * 'created_at' [Integer] Creation date.
|
||||
# * 'port' [Integer] Port.
|
||||
# * 'proto' [String] Protocol.
|
||||
# * 'state' [String] Service state.
|
||||
# * 'name' [String] Service name.
|
||||
|
@ -809,7 +809,7 @@ public
|
|||
# @option xopts [String] :address Same as :addr.
|
||||
# @option xopts [String] :host Same as :address.
|
||||
# @option xopts [String] :proto Protocol.
|
||||
# @option xopts [Fixnum] :port Port.
|
||||
# @option xopts [Integer] :port Port.
|
||||
# @option xopts [String] :ntype Note type.
|
||||
# @raise [Msf::RPC::ServerException] You might get one of these errors:
|
||||
# * 500 ActiveRecord::ConnectionNotEstablished. Try: rpc.call('console.create').
|
||||
|
@ -818,10 +818,10 @@ public
|
|||
# @return [Hash] A hash that contains the following:
|
||||
# * 'note' [Array<Hash>] Each hash in the array contains the following:
|
||||
# * 'host' [String] Host.
|
||||
# * 'port' [Fixnum] Port.
|
||||
# * 'port' [Integer] Port.
|
||||
# * 'proto' [String] Protocol.
|
||||
# * 'created_at' [Fixnum] Last created at.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'created_at' [Integer] Last created at.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# * 'ntype' [String] Note type.
|
||||
# * 'data' [String] Note data.
|
||||
# * 'critical' [String] A boolean indicating criticality.
|
||||
|
@ -867,8 +867,8 @@ public
|
|||
# @return [Hash] A hash that contains the client connection:
|
||||
# * 'client' [Array<Hash>] Each hash of the array contains the following:
|
||||
# * 'host' [String] Host IP.
|
||||
# * 'created_at' [Fixnum] Created date.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'created_at' [Integer] Created date.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# * 'ua_string' [String] User-Agent string.
|
||||
# * 'ua_name' [String] User-Agent name.
|
||||
# * 'ua_ver' [String] User-Agent version.
|
||||
|
@ -931,7 +931,7 @@ public
|
|||
# @option xopts [String] :host An IP address or a Host object to associate with this note.
|
||||
# @option xopts [String] :service A Service object to associate with this note.
|
||||
# @option xopts [String] :data Whatever it is you're making a note of.
|
||||
# @option xopts [Fixnum] :port Along with +:host+ and +:proto+, a service to associate with this note.
|
||||
# @option xopts [Integer] :port Along with +:host+ and +:proto+, a service to associate with this note.
|
||||
# @option xopts [String] :proto Along with +:host+ and +:port+, a service to associate with this note.
|
||||
# @option xopts [Hash] A hash that contains the following information.
|
||||
# * :unique [Boolean] Allow only a single Note per +:host+/+:type+ pair.
|
||||
|
@ -981,7 +981,7 @@ public
|
|||
# * 500 Invalid workspace.
|
||||
# @return [Hash] A hash that contains the following:
|
||||
# * 'notes' [Array<Hash>] Each hash in the array contains the following:
|
||||
# * 'time' [Fixnum] Creation date.
|
||||
# * 'time' [Integer] Creation date.
|
||||
# * 'host' [String] Host address.
|
||||
# * 'service' [String] Service name or port.
|
||||
# * 'type' [String] Host type.
|
||||
|
@ -1045,7 +1045,7 @@ public
|
|||
# @option xopts [String] :host Host address.
|
||||
# @option xopts [String] :address Same as :host.
|
||||
# @option xopts [Array] :addresses Same as :address.
|
||||
# @option xopts [Fixnum] :port Port.
|
||||
# @option xopts [Integer] :port Port.
|
||||
# @option xopts [String] :proto Protocol.
|
||||
# @option xopts [String] :name Name of the vulnerability.
|
||||
# @raise [Msf::RPC::ServerException] You might get one of these errors:
|
||||
|
@ -1056,7 +1056,7 @@ public
|
|||
# * 'result' [String] A message that says 'success'.
|
||||
# * 'deleted' [Array<Hash>] Each hash in the array contains the following:
|
||||
# * 'address' [String] Host address.
|
||||
# * 'port' [Fixnum] Port.
|
||||
# * 'port' [Integer] Port.
|
||||
# * 'proto' [String] Protocol.
|
||||
# * 'name' [String] Vulnerability name.
|
||||
# @example Here's how you would use this from the client:
|
||||
|
@ -1139,7 +1139,7 @@ public
|
|||
# @option xopts [String] :host Host address.
|
||||
# @option xopts [String] :address Same as :host.
|
||||
# @option xopts [Array] :addresses Same as :address.
|
||||
# @option xopts [Fixnum] :port Port.
|
||||
# @option xopts [Integer] :port Port.
|
||||
# @option xopts [String] :proto Protocol.
|
||||
# @option xopts [String] :ntype Note type.
|
||||
# @raise [Msf::RPC::ServerException] You might get one of these errors:
|
||||
|
@ -1150,7 +1150,7 @@ public
|
|||
# * 'result' [String] A message that says 'success'.
|
||||
# * 'deleted' [Array<Hash>] Each hash in the array contains the following:
|
||||
# * 'address' [String] Host address.
|
||||
# * 'port' [Fixnum] Port.
|
||||
# * 'port' [Integer] Port.
|
||||
# * 'proto' [String] Protocol.
|
||||
# * 'ntype' [String] Note type.
|
||||
# @example Here's how you would use this from the client:
|
||||
|
@ -1180,7 +1180,7 @@ public
|
|||
# @option xopts [String] :host Host address.
|
||||
# @option xopts [String] :address Same as :host.
|
||||
# @option xopts [Array] :addresses Host addresses.
|
||||
# @option xopts [Fixnum] :port Port.
|
||||
# @option xopts [Integer] :port Port.
|
||||
# @option xopts [String] :proto Protocol.
|
||||
# @raise [Msf::RPC::ServerException] You might get one of these errors:
|
||||
# * 500 ActiveRecord::ConnectionNotEstablished. Try: rpc.call('console.create').
|
||||
|
@ -1191,7 +1191,7 @@ public
|
|||
# * 'deleted' [Array<Hash>] If result says success, then you will get this key.
|
||||
# Each hash in the array contains:
|
||||
# * 'address' [String] Host address.
|
||||
# * 'port' [Fixnum] Port.
|
||||
# * 'port' [Integer] Port.
|
||||
# * 'proto' [String] Protocol.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('db.del_service', {:host=>ip})
|
||||
|
@ -1331,8 +1331,8 @@ public
|
|||
#
|
||||
# @param [Hash] xopts Options:
|
||||
# @option xopts [String] :workspace Workspace name.
|
||||
# @option xopts [Fixnum] :limit Limit.
|
||||
# @option xopts [Fixnum] :offset Offset.
|
||||
# @option xopts [Integer] :limit Limit.
|
||||
# @option xopts [Integer] :offset Offset.
|
||||
# @raise [Msf::RPC::ServerException] You might get one of these errors:
|
||||
# * 500 ActiveRecord::ConnectionNotEstablished. Try: rpc.call('console.create').
|
||||
# * 500 Database not loaded. Try: rpc.call('console.create')
|
||||
|
@ -1340,8 +1340,8 @@ public
|
|||
# @return [Hash] A hash that contains the following:
|
||||
# * 'events' [Array<Hash>] Each hash in the array contains the following:
|
||||
# * 'host' [String] Host address.
|
||||
# * 'created_at' [Fixnum] Creation date.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'created_at' [Integer] Creation date.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# * 'name' [String] Event name.
|
||||
# * 'critical' [Boolean] Criticality.
|
||||
# * 'username' [String] Username.
|
||||
|
@ -1401,7 +1401,7 @@ public
|
|||
# @param [Hash] xopts Information about the looted item.
|
||||
# @option xopts [String] :workspace Workspace name.
|
||||
# @option xopts [String] :host Host address.
|
||||
# @option xopts [Fixnum] :port Port. Should match :service.
|
||||
# @option xopts [Integer] :port Port. Should match :service.
|
||||
# @option xopts [String] :proto Protocol. Should match :service.
|
||||
# @option xopts [String] :path Required. Path where the item was looted.
|
||||
# @option xopts [String] :type Loot type.
|
||||
|
@ -1435,8 +1435,8 @@ public
|
|||
#
|
||||
# @param [Hash] xopts Filters that narrow down the search:
|
||||
# @option xopts [Hash] :workspace Workspace name.
|
||||
# @option xopts [Fixnum] :limit Limit.
|
||||
# @option xopts [Fixnum] :offset Offset.
|
||||
# @option xopts [Integer] :limit Limit.
|
||||
# @option xopts [Integer] :offset Offset.
|
||||
# @raise [Msf::RPC::ServerException] You might get one of these errors:
|
||||
# * 500 ActiveRecord::ConnectionNotEstablished. Try: rpc.call('console.create').
|
||||
# * 500 Database not loaded. Try: rpc.call('console.create')
|
||||
|
@ -1448,8 +1448,8 @@ public
|
|||
# * 'ltype' [String] Loot type.
|
||||
# * 'ctype' [String] Content type.
|
||||
# * 'data' [String] Looted data.
|
||||
# * 'created_at' [Fixnum] Creation date.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'created_at' [Integer] Creation date.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# * 'name' [String] Name.
|
||||
# * 'info' [String] Additional information.
|
||||
# @example Here's how you would use this from the client:
|
||||
|
@ -1540,7 +1540,7 @@ public
|
|||
# @param [Hash] xopts Filters to narrow down which vulnerabilities to find.
|
||||
# @option xopts [String] :workspace Workspace name.
|
||||
# @option xopts [String] :proto Protocol.
|
||||
# @option xopts [Fixnum] :port Port.
|
||||
# @option xopts [Integer] :port Port.
|
||||
# @raise [Msf::RPC::ServerException] You might get one of these errors:
|
||||
# * 500 ActiveRecord::ConnectionNotEstablished. Try: rpc.call('console.create').
|
||||
# * 500 Database not loaded. Try: rpc.call('console.create')
|
||||
|
@ -1548,10 +1548,10 @@ public
|
|||
# @return [Hash] A hash that contains the following:
|
||||
# * 'vuln' [Array<Hash>] Each hash in the array contains the following:
|
||||
# * 'host' [String] Host address.
|
||||
# * 'port' [Fixnum] Port.
|
||||
# * 'port' [Integer] Port.
|
||||
# * 'proto' [String] Protocol.
|
||||
# * 'created_at' [Fixnum] Creation date.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'created_at' [Integer] Creation date.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# * 'name' [String] Vulnerability name.
|
||||
# * 'info' [String] Additional information.
|
||||
# * 'refs' [Array<String>] Reference names.
|
||||
|
@ -1624,8 +1624,8 @@ public
|
|||
# * 'ua_string' [String] User-agent string.
|
||||
# * 'ua_name' [String] Browser name.
|
||||
# * 'ua_ver' [String] Browser version.
|
||||
# * 'created_at' [Fixnum] Creation date.
|
||||
# * 'updated_at' [Fixnum] Last updated at.
|
||||
# * 'created_at' [Integer] Creation date.
|
||||
# * 'updated_at' [Integer] Last updated at.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('db.clients', {})
|
||||
def rpc_clients(xopts)
|
||||
|
|
|
@ -21,7 +21,7 @@ class RPC_Job < RPC_Base
|
|||
|
||||
# Stops a job.
|
||||
#
|
||||
# @param [Fixnum] jid Job ID.
|
||||
# @param [Integer] jid Job ID.
|
||||
# @raise [Msf::RPC::Exception] A 500 response indicating an invalid job ID was given.
|
||||
# @return [Hash] A hash indicating the action was successful. It contains the following key:
|
||||
# * 'result' [String] A successful message: 'success'
|
||||
|
@ -37,12 +37,12 @@ class RPC_Job < RPC_Base
|
|||
|
||||
# Returns information about a job.
|
||||
#
|
||||
# @param [Fixnum] jid Job ID.
|
||||
# @param [Integer] jid Job ID.
|
||||
# @raise [Msf::RPC::Exception] A 500 response indicating an invalid job ID was given.
|
||||
# @return [Hash] A hash that contains information about the job, such as the following (and maybe more):
|
||||
# * 'jid' [Fixnum] The Job ID.
|
||||
# * 'jid' [Integer] The Job ID.
|
||||
# * 'name' [String] The name of the job.
|
||||
# * 'start_time' [Fixnum] The start time.
|
||||
# * 'start_time' [Integer] The start time.
|
||||
# * 'datastore' [Hash] Datastore options for the module.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('job.info', 0)
|
||||
|
|
|
@ -168,7 +168,7 @@ class RPC_Module < RPC_Base
|
|||
# @param [String] mname Post module name. For example: 'windows/wlan/wlan_profile'.
|
||||
# @raise [Msf::RPC::Exception] Module not found (wrong name).
|
||||
# @return [Hash] The post module's compatible sessions. It contains the following key:
|
||||
# * 'sessions' [Array<Fixnum>] A list of session IDs.
|
||||
# * 'sessions' [Array<Integer>] A list of session IDs.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('module.compatible_sessions', 'windows/wlan/wlan_profile')
|
||||
def rpc_compatible_sessions(mname)
|
||||
|
@ -183,7 +183,7 @@ class RPC_Module < RPC_Base
|
|||
# Returns the compatible target-specific payloads for an exploit.
|
||||
#
|
||||
# @param [String] mname Exploit module name. For example: 'windows/smb/ms08_067_netapi'
|
||||
# @param [Fixnum] target A specific target the exploit module provides.
|
||||
# @param [Integer] target A specific target the exploit module provides.
|
||||
# @raise [Msf::RPC::Exception] Module not found (wrong name).
|
||||
# @return [Hash] The exploit's target-specific payloads. It contains the following key:
|
||||
# * 'payloads' [Array<string>] A list of payloads.
|
||||
|
@ -259,7 +259,7 @@ class RPC_Module < RPC_Base
|
|||
# even see these sessions, because it belongs to a different framework instance.
|
||||
# However, this restriction does not apply to the database.
|
||||
# @return [Hash] It contains the following keys:
|
||||
# * 'job_id' [Fixnum] Job ID.
|
||||
# * 'job_id' [Integer] Job ID.
|
||||
# * 'uuid' [String] UUID.
|
||||
# @example Here's how you would use this from the client:
|
||||
# # Starts a windows/meterpreter/reverse_tcp on port 6669
|
||||
|
@ -301,7 +301,7 @@ class RPC_Module < RPC_Base
|
|||
# @option options [String] 'badchars' Bad characters.
|
||||
# @option options [String] 'platform' Platform.
|
||||
# @option options [String] 'arch' Architecture.
|
||||
# @option options [Fixnum] 'ecount' Number of times to encode.
|
||||
# @option options [Integer] 'ecount' Number of times to encode.
|
||||
# @option options [TrueClass] 'inject' To enable injection.
|
||||
# @option options [String] 'template' The template file (an executable).
|
||||
# @option options [String] 'template_path' Template path.
|
||||
|
|
|
@ -18,7 +18,7 @@ class RPC_Session < RPC_Base
|
|||
# * 'info' [String] Session info (most likely the target's computer name).
|
||||
# * 'workspace' [String] Name of the workspace.
|
||||
# * 'session_host' [String] Session host.
|
||||
# * 'session_port' [Fixnum] Session port.
|
||||
# * 'session_port' [Integer] Session port.
|
||||
# * 'target_host' [String] Target host.
|
||||
# * 'username' [String] Username.
|
||||
# * 'uuid' [String] UUID.
|
||||
|
@ -58,7 +58,7 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Stops a session.
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @raise [Msf::RPC::Exception] Unknown session ID.
|
||||
# @return [Hash] A hash indicating the action was successful. It contains the following key:
|
||||
# * 'result' [String] A message that says 'success'.
|
||||
|
@ -81,8 +81,8 @@ class RPC_Session < RPC_Base
|
|||
# sequence number on their own (making multiple views into the same
|
||||
# session possible, regardless of position in the stream)
|
||||
# @see #rpc_ring_read
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Fixnum] ptr Pointer.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @param [Integer] ptr Pointer.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
# * 500 Invalid session type.
|
||||
|
@ -117,10 +117,10 @@ class RPC_Session < RPC_Base
|
|||
# * 500 Session ID is unknown.
|
||||
# * 500 Invalid session type.
|
||||
# * 500 Session is disconnected.
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @param [String] data The data to write.
|
||||
# @return [Hash]
|
||||
# * 'write_count' [Fixnum] Number of bytes written.
|
||||
# * 'write_count' [Integer] Number of bytes written.
|
||||
# @example Here's how you would use this from the client:
|
||||
# rpc.call('session.shell_write', 2, "DATA")
|
||||
def rpc_shell_write( sid, data)
|
||||
|
@ -132,9 +132,9 @@ class RPC_Session < RPC_Base
|
|||
# Upgrades a shell to a meterpreter.
|
||||
#
|
||||
# @note This uses post/multi/manage/shell_to_meterpreter.
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @param [String] lhost Local host.
|
||||
# @param [Fixnum] lport Local port.
|
||||
# @param [Integer] lport Local port.
|
||||
# @return [Hash] A hash indicating the actioin was successful. It contains the following key:
|
||||
# * 'result' [String] A message that says 'success'
|
||||
# @example Here's how you would use this from the client:
|
||||
|
@ -153,7 +153,7 @@ class RPC_Session < RPC_Base
|
|||
# @note Multiple concurrent callers writing and reading the same Meterperter session can lead to
|
||||
# a conflict, where one caller gets the others output and vice versa. Concurrent access to a
|
||||
# Meterpreter session is best handled by post modules.
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
# * 500 Invalid session type.
|
||||
|
@ -175,8 +175,8 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Reads from a session (such as a command output).
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Fixnum] ptr Pointer.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @param [Integer] ptr Pointer.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
# * 500 Invalid session type.
|
||||
|
@ -199,7 +199,7 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Sends an input to a session (such as a command).
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @param [String] data Data to write.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
|
@ -221,7 +221,7 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Returns the last sequence (last issued ReadPointer) for a shell session.
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
# * 500 Invalid session type.
|
||||
|
@ -237,7 +237,7 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Clears a shell session. This may be useful to reclaim memory for idle background sessions.
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
# * 500 Invalid session type.
|
||||
|
@ -262,7 +262,7 @@ class RPC_Session < RPC_Base
|
|||
# @note Multiple concurrent callers writing and reading the same Meterperter session can lead to
|
||||
# a conflict, where one caller gets the others output and vice versa. Concurrent access to a
|
||||
# Meterpreter session is best handled by post modules.
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @param [String] data Input to the meterpreter prompt.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
|
@ -294,7 +294,7 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Detaches from a meterpreter session. Serves the same purpose as [CTRL]+[Z].
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
# * 500 Invalid session type.
|
||||
|
@ -316,7 +316,7 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Kills a meterpreter session. Serves the same purpose as [CTRL]+[C].
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
# * 500 Invalid session type.
|
||||
|
@ -339,7 +339,7 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Returns a tab-completed version of your meterpreter prompt input.
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @param [String] line Input.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
|
@ -359,7 +359,7 @@ class RPC_Session < RPC_Base
|
|||
# Runs a meterpreter command even if interacting with a shell or other channel.
|
||||
# You will want to use the #rpc_meterpreter_read to retrieve the output.
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @param [String] data Command.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
|
@ -385,7 +385,7 @@ class RPC_Session < RPC_Base
|
|||
# @deprecated Metasploit no longer maintains or accepts meterpreter scripts. Please try to use
|
||||
# post modules instead.
|
||||
# @see Msf::RPC::RPC_Module#rpc_execute You should use Msf::RPC::RPC_Module#rpc_execute instead.
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @param [String] data Meterpreter script name.
|
||||
# @return [Hash] A hash indicating the action was successful. It contains the following key:
|
||||
# * 'result' [String] 'success'
|
||||
|
@ -397,7 +397,7 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Changes the Transport of a given Meterpreter Session
|
||||
#
|
||||
# @param sid [Fixnum] The Session ID of the `Msf::Session`
|
||||
# @param sid [Integer] The Session ID of the `Msf::Session`
|
||||
# @option opts [String] :transport The transport protocol to use (e.g. reverse_tcp, reverse_http, bind_tcp etc)
|
||||
# @option opts [String] :lhost The LHOST of the listener to use
|
||||
# @option opts [String] :lport The LPORT of the listener to use
|
||||
|
@ -430,7 +430,7 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Returns the separator used by the meterpreter.
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @raise [Msf::RPC::Exception] An error that could be one of these:
|
||||
# * 500 Session ID is unknown.
|
||||
# * 500 Invalid session type.
|
||||
|
@ -449,7 +449,7 @@ class RPC_Session < RPC_Base
|
|||
|
||||
# Returns all the compatible post modules for this session.
|
||||
#
|
||||
# @param [Fixnum] sid Session ID.
|
||||
# @param [Integer] sid Session ID.
|
||||
# @return [Hash] Post modules. It contains the following key:
|
||||
# * 'modules' [Array<string>] An array of post module names. Example: ['post/windows/wlan/wlan_profile']
|
||||
# @example Here's how you would use this from the client:
|
||||
|
|
|
@ -1465,7 +1465,7 @@ class Db
|
|||
case input
|
||||
when String
|
||||
input = input.downcase
|
||||
when Fixnum
|
||||
when Integer
|
||||
input = "%016" % input
|
||||
when Time
|
||||
input = input.strftime("%Y%m%d%H%M%S%L")
|
||||
|
|
|
@ -2297,7 +2297,7 @@ require 'msf/core/exe/segment_appender'
|
|||
# @param mo [String]
|
||||
# @param err_msg [String]
|
||||
# @raise [RuntimeError] if the "PAYLOAD:" is not found
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
def self.find_payload_tag(mo, err_msg)
|
||||
bo = mo.index('PAYLOAD:')
|
||||
unless bo
|
||||
|
|
|
@ -79,7 +79,7 @@ class PayloadCachedSize
|
|||
# Calculates the CachedSize value for a payload module
|
||||
#
|
||||
# @param mod [Msf::Payload] The class of the payload module to update
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
def self.compute_cached_size(mod)
|
||||
return ":dynamic" if is_dynamic?(mod)
|
||||
return mod.generate_simple(OPTS).size
|
||||
|
@ -88,9 +88,9 @@ class PayloadCachedSize
|
|||
# Determines whether a payload generates a static sized output
|
||||
#
|
||||
# @param mod [Msf::Payload] The class of the payload module to update
|
||||
# @param generation_count [Fixnum] The number of iterations to use to
|
||||
# @param generation_count [Integer] The number of iterations to use to
|
||||
# verify that the size is static.
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
def self.is_dynamic?(mod, generation_count=5)
|
||||
[*(1..generation_count)].map{|x|
|
||||
mod.generate_simple(OPTS).size}.uniq.length != 1
|
||||
|
|
|
@ -37,7 +37,7 @@ module Net # :nodoc:
|
|||
case cls
|
||||
when String
|
||||
return Classes.has_key?(cls)
|
||||
when Fixnum
|
||||
when Integer
|
||||
return Classes.invert.has_key?(cls)
|
||||
else
|
||||
raise ClassArgumentError, "Wrong class: #{cls.class}"
|
||||
|
@ -48,7 +48,7 @@ module Net # :nodoc:
|
|||
# given the numeric value
|
||||
def self.to_str(cls)
|
||||
case cls
|
||||
when Fixnum
|
||||
when Integer
|
||||
if Classes.invert.has_key? cls
|
||||
return Classes.invert[cls]
|
||||
else
|
||||
|
@ -73,7 +73,7 @@ module Net # :nodoc:
|
|||
when String
|
||||
# type in the form "A" or "NS"
|
||||
new_from_string(cls.upcase)
|
||||
when Fixnum
|
||||
when Integer
|
||||
# type in numeric form
|
||||
new_from_num(cls)
|
||||
when nil
|
||||
|
|
|
@ -90,7 +90,7 @@ module Net # :nodoc:
|
|||
case type
|
||||
when String
|
||||
return Types.has_key?(type)
|
||||
when Fixnum
|
||||
when Integer
|
||||
return Types.invert.has_key?(type)
|
||||
else
|
||||
raise TypeArgumentError, "Wrong type class: #{type.class}"
|
||||
|
@ -101,7 +101,7 @@ module Net # :nodoc:
|
|||
# given the numeric value
|
||||
def self.to_str(type)
|
||||
case type
|
||||
when Fixnum
|
||||
when Integer
|
||||
if Types.invert.has_key? type
|
||||
return Types.invert[type]
|
||||
else
|
||||
|
@ -126,7 +126,7 @@ module Net # :nodoc:
|
|||
when String
|
||||
# type in the form "A" or "NS"
|
||||
new_from_string(type.upcase)
|
||||
when Fixnum
|
||||
when Integer
|
||||
# type in numeric form
|
||||
new_from_num(type)
|
||||
when nil
|
||||
|
|
|
@ -61,9 +61,9 @@ module Rex
|
|||
|
||||
# Create a URI that matches the specified checksum and payload uuid
|
||||
#
|
||||
# @param sum [Fixnum] A checksum mode value to use for the generated url
|
||||
# @param sum [Integer] A checksum mode value to use for the generated url
|
||||
# @param uuid [Msf::Payload::UUID] A valid UUID object
|
||||
# @param len [Fixnum] An optional URI length value, including the leading slash
|
||||
# @param len [Integer] An optional URI length value, including the leading slash
|
||||
# @return [String] The URI string for connections
|
||||
def generate_uri_uuid(sum, uuid, len=nil)
|
||||
curl_uri_len = URI_CHECKSUM_UUID_MIN_LEN+rand(URI_CHECKSUM_CONN_MAX_LEN-URI_CHECKSUM_UUID_MIN_LEN)
|
||||
|
@ -84,8 +84,8 @@ module Rex
|
|||
|
||||
# Create an arbitrary length URI that matches a given checksum
|
||||
#
|
||||
# @param sum [Fixnum] The checksum value that the generated URI should match
|
||||
# @param len [Fixnum] The length of the URI to generate
|
||||
# @param sum [Integer] The checksum value that the generated URI should match
|
||||
# @param len [Integer] The length of the URI to generate
|
||||
# @param prefix [String] The optional prefix to use to build the URI
|
||||
# @return [String] The URI string that checksums to the given value
|
||||
def generate_uri_checksum(sum, len=5, prefix="")
|
||||
|
@ -122,7 +122,7 @@ module Rex
|
|||
# Return the numerical checksum for a given mode symbol
|
||||
#
|
||||
# @param mode [Symbol] The mode symbol to lookup (:connect, :init_native, :init_python, :init_java)
|
||||
# @return [Fixnum] The URI checksum value corresponding with the mode
|
||||
# @return [Integer] The URI checksum value corresponding with the mode
|
||||
def uri_checksum_lookup(mode)
|
||||
sum = URI_CHECKSUM_MODES.keys.select{|ksum| URI_CHECKSUM_MODES[ksum] == mode}.first
|
||||
unless sum
|
||||
|
|
|
@ -332,8 +332,8 @@ class Kiwi < Extension
|
|||
# @param opts[:domain_name] [String] Domain name.
|
||||
# @param opts[:domain_sid] [String] SID of the domain.
|
||||
# @param opts[:krbtgt_hash] [String] The kerberos ticket granting token.
|
||||
# @param opts[:id] [Fixnum] ID of the user to grant the token for.
|
||||
# @param opts[:group_ids] [Array<Fixnum>] IDs of the groups to assign to the user
|
||||
# @param opts[:id] [Integer] ID of the user to grant the token for.
|
||||
# @param opts[:group_ids] [Array<Integer>] IDs of the groups to assign to the user
|
||||
#
|
||||
# @return [Array<Byte>]
|
||||
#
|
||||
|
|
|
@ -149,19 +149,25 @@ class DLL
|
|||
|
||||
# we care only about out-only buffers
|
||||
if param_desc[2] == "out"
|
||||
raise "error in param #{param_desc[1]}: Out-only buffers must be described by a number indicating their size in bytes " unless args[param_idx].class == Fixnum
|
||||
if !args[param_idx].kind_of? Integer
|
||||
raise "error in param #{param_desc[1]}: Out-only buffers must be described by a number indicating their size in bytes"
|
||||
end
|
||||
buffer_size = args[param_idx]
|
||||
if param_desc[0] == "PDWORD"
|
||||
# bump up the size for an x64 pointer
|
||||
if( native == 'Q<' and buffer_size == 4 )
|
||||
if native == 'Q<' && buffer_size == 4
|
||||
args[param_idx] = 8
|
||||
buffer_size = args[param_idx]
|
||||
end
|
||||
|
||||
if( native == 'Q<' )
|
||||
raise "Please pass 8 for 'out' PDWORDS, since they require a buffer of size 8" unless buffer_size == 8
|
||||
elsif( native == 'V' )
|
||||
raise "Please pass 4 for 'out' PDWORDS, since they require a buffer of size 4" unless buffer_size == 4
|
||||
if native == 'Q<'
|
||||
if buffer_size != 8
|
||||
raise "Please pass 8 for 'out' PDWORDS, since they require a buffer of size 8"
|
||||
end
|
||||
elsif native == 'V'
|
||||
if buffer_size != 4
|
||||
raise "Please pass 4 for 'out' PDWORDS, since they require a buffer of size 4"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -76,11 +76,9 @@ module DLLHelper
|
|||
def param_to_number(v, win_consts = @win_consts)
|
||||
if v.class == NilClass then
|
||||
return 0
|
||||
elsif v.class == Fixnum then
|
||||
elsif v.kind_of? Integer then
|
||||
return v # ok, it's already a number
|
||||
elsif v.class == Bignum then
|
||||
return v # ok, it's already a number
|
||||
elsif v.class == String then
|
||||
elsif v.kind_of? String then
|
||||
dw = win_consts.parse(v) # might raise an exception
|
||||
if dw != nil
|
||||
return dw
|
||||
|
|
|
@ -99,18 +99,24 @@ class MultiCaller
|
|||
|
||||
# we care only about out-only buffers
|
||||
if param_desc[2] == "out"
|
||||
raise "error in param #{param_desc[1]}: Out-only buffers must be described by a number indicating their size in bytes " unless args[param_idx].class == Fixnum
|
||||
if !args[param_idx].class.kind_of? Integer
|
||||
raise "error in param #{param_desc[1]}: Out-only buffers must be described by a number indicating their size in bytes "
|
||||
end
|
||||
buffer_size = args[param_idx]
|
||||
# bump up the size for an x64 pointer
|
||||
if( @native == 'Q<' and buffer_size == 4 )
|
||||
if @native == 'Q<' && buffer_size == 4
|
||||
args[param_idx] = 8
|
||||
buffer_size = args[param_idx]
|
||||
end
|
||||
|
||||
if( @native == 'Q<' )
|
||||
raise "Please pass 8 for 'out' PDWORDS, since they require a buffer of size 8" unless buffer_size == 8
|
||||
if @native == 'Q<'
|
||||
if buffer_size != 8
|
||||
raise "Please pass 8 for 'out' PDWORDS, since they require a buffer of size 8"
|
||||
end
|
||||
elsif( @native == 'V' )
|
||||
raise "Please pass 4 for 'out' PDWORDS, since they require a buffer of size 4" unless buffer_size == 4
|
||||
if buffer_size != 4
|
||||
raise "Please pass 4 for 'out' PDWORDS, since they require a buffer of size 4"
|
||||
end
|
||||
end
|
||||
|
||||
out_only_layout[param_desc[1]] = BufferItem.new(param_idx, out_only_size_bytes, buffer_size, param_desc[0])
|
||||
|
|
|
@ -71,7 +71,7 @@ module PointerUtil
|
|||
#
|
||||
# def self.is_unpacked_pointer?(pointer, platform)
|
||||
# # TODO also check that the integer size is appropriate for the platform
|
||||
# unless pointer.kind_of?(Fixnum) and pointer > 0 # and pointer <
|
||||
# unless pointer.kind_of?(Integer) and pointer > 0 # and pointer <
|
||||
# return false
|
||||
# end
|
||||
#
|
||||
|
|
|
@ -641,7 +641,7 @@ class Util
|
|||
# state of each bit.
|
||||
#
|
||||
# Parameters:
|
||||
# +value+:: a bit field represented by a Fixnum
|
||||
# +value+:: a bit field represented by a Integer
|
||||
# +mappings+:: { 'WINAPI_CONSTANT_NAME' => :descriptive_symbol, ... }
|
||||
#
|
||||
# Returns:
|
||||
|
|
|
@ -139,7 +139,7 @@ class Tlv
|
|||
|
||||
if (value != nil)
|
||||
if (type & TLV_META_TYPE_STRING == TLV_META_TYPE_STRING)
|
||||
if (value.kind_of?(Fixnum))
|
||||
if (value.kind_of?(Integer))
|
||||
@value = value.to_s
|
||||
else
|
||||
@value = value.dup
|
||||
|
|
|
@ -193,7 +193,7 @@ module PacketDispatcher
|
|||
# Sends a packet and waits for a timeout for the given time interval.
|
||||
#
|
||||
# @param packet [Packet] request to send
|
||||
# @param timeout [Fixnum,nil] seconds to wait for response, or nil to ignore the
|
||||
# @param timeout [Integer,nil] seconds to wait for response, or nil to ignore the
|
||||
# response and return immediately
|
||||
# @return (see #send_packet_wait_response)
|
||||
def send_request(packet, timeout = self.response_timeout)
|
||||
|
@ -219,7 +219,7 @@ module PacketDispatcher
|
|||
# Transmits a packet and waits for a response.
|
||||
#
|
||||
# @param packet [Packet] the request packet to send
|
||||
# @param timeout [Fixnum,nil] number of seconds to wait, or nil to wait
|
||||
# @param timeout [Integer,nil] number of seconds to wait, or nil to wait
|
||||
# forever
|
||||
def send_packet_wait_response(packet, timeout)
|
||||
# First, add the waiter association for the supplied packet
|
||||
|
|
|
@ -36,7 +36,7 @@ class PacketResponseWaiter
|
|||
# @return [Packet]
|
||||
attr_accessor :response
|
||||
|
||||
# @return [Fixnum] request ID to wait for
|
||||
# @return [Integer] request ID to wait for
|
||||
attr_accessor :rid
|
||||
|
||||
#
|
||||
|
@ -84,7 +84,7 @@ class PacketResponseWaiter
|
|||
#
|
||||
# Wait for a given time interval for the response packet to arrive.
|
||||
#
|
||||
# @param interval [Fixnum,nil] number of seconds to wait, or nil to wait
|
||||
# @param interval [Integer,nil] number of seconds to wait, or nil to wait
|
||||
# forever
|
||||
# @return [Packet,nil] the response, or nil if the interval elapsed before
|
||||
# receiving one
|
||||
|
|
|
@ -36,7 +36,7 @@ class Client
|
|||
# Calls OpenSCManagerW() to obtain a handle to the service control manager.
|
||||
#
|
||||
# @param rhost [String] the target host.
|
||||
# @param access [Fixnum] the access flags requested.
|
||||
# @param access [Integer] the access flags requested.
|
||||
#
|
||||
# @return [Array<String,Integer>] the handle to the service control manager or nil if
|
||||
# the call is not successful and the Windows error code
|
||||
|
@ -70,18 +70,18 @@ class Client
|
|||
# @param display_name [String] the display name.
|
||||
# @param binary_path [String] the path of the binary to run.
|
||||
# @param opts [Hash] arguments for CreateServiceW()
|
||||
# @option opts [Fixnum] :access (SERVICE_ALL_ACCESS) the access level.
|
||||
# @option opts [Fixnum] :type (SERVICE_WIN32_OWN_PROCESS ||
|
||||
# @option opts [Integer] :access (SERVICE_ALL_ACCESS) the access level.
|
||||
# @option opts [Integer] :type (SERVICE_WIN32_OWN_PROCESS ||
|
||||
# SERVICE_INTERACTIVE_PROCESS) the type of service.
|
||||
# @option opts [Fixnum] :start (SERVICE_DEMAND_START) the start options.
|
||||
# @option opts [Fixnum] :errors (SERVICE_ERROR_IGNORE) the error options.
|
||||
# @option opts [Fixnum] :load_order_group (0) the load order group.
|
||||
# @option opts [Fixnum] :dependencies (0) the dependencies of the service.
|
||||
# @option opts [Fixnum] :service_start (0)
|
||||
# @option opts [Fixnum] :password1 (0)
|
||||
# @option opts [Fixnum] :password2 (0)
|
||||
# @option opts [Fixnum] :password3 (0)
|
||||
# @option opts [Fixnum] :password4 (0)
|
||||
# @option opts [Integer] :start (SERVICE_DEMAND_START) the start options.
|
||||
# @option opts [Integer] :errors (SERVICE_ERROR_IGNORE) the error options.
|
||||
# @option opts [Integer] :load_order_group (0) the load order group.
|
||||
# @option opts [Integer] :dependencies (0) the dependencies of the service.
|
||||
# @option opts [Integer] :service_start (0)
|
||||
# @option opts [Integer] :password1 (0)
|
||||
# @option opts [Integer] :password2 (0)
|
||||
# @option opts [Integer] :password3 (0)
|
||||
# @option opts [Integer] :password4 (0)
|
||||
#
|
||||
# @return [String, Integer] a handle to the created service, windows
|
||||
# error code.
|
||||
|
@ -182,7 +182,7 @@ class Client
|
|||
#
|
||||
# @param scm_handle [String] the SCM handle (from {#openscmanagerw}).
|
||||
# @param service_name [String] the name of the service to open.
|
||||
# @param access [Fixnum] the level of access requested (default is maximum).
|
||||
# @param access [Integer] the level of access requested (default is maximum).
|
||||
#
|
||||
# @return [String, nil] the handle of the service opened, or nil on failure.
|
||||
def openservicew(scm_handle, service_name, access = SERVICE_ALL_ACCESS)
|
||||
|
@ -208,8 +208,8 @@ class Client
|
|||
# it. Returns true on success, or false.
|
||||
#
|
||||
# @param svc_handle [String] the handle of the service (from {#openservicew}).
|
||||
# @param magic1 [Fixnum] an unknown value.
|
||||
# @param magic2 [Fixnum] another unknown value.
|
||||
# @param magic1 [Integer] an unknown value.
|
||||
# @param magic2 [Integer] another unknown value.
|
||||
#
|
||||
# @return [Integer] Windows error code
|
||||
def startservice(svc_handle, magic1 = 0, magic2 = 0)
|
||||
|
@ -240,7 +240,7 @@ class Client
|
|||
# Controls an existing service.
|
||||
#
|
||||
# @param svc_handle [String] the handle of the service (from {#openservicew}).
|
||||
# @param operation [Fixnum] the operation number to perform (1 = stop
|
||||
# @param operation [Integer] the operation number to perform (1 = stop
|
||||
# service; others are unknown).
|
||||
#
|
||||
# @return [Integer] Windows error code
|
||||
|
@ -281,7 +281,7 @@ class Client
|
|||
#
|
||||
# @param svc_handle [String] the handle of the service (from {#openservicew}).
|
||||
#
|
||||
# @return [Fixnum] Returns 0 if the query failed (i.e.: a state was returned
|
||||
# @return [Integer] Returns 0 if the query failed (i.e.: a state was returned
|
||||
# that isn't implemented), 1 if the service is running, and
|
||||
# 2 if the service is stopped.
|
||||
def queryservice(svc_handle)
|
||||
|
|
|
@ -159,7 +159,7 @@ class Client
|
|||
#
|
||||
# Connects to the remote server if possible.
|
||||
#
|
||||
# @param t [Fixnum] Timeout
|
||||
# @param t [Integer] Timeout
|
||||
# @see Rex::Socket::Tcp.create
|
||||
# @return [Rex::Socket::Tcp]
|
||||
def connect(t = -1)
|
||||
|
@ -250,7 +250,7 @@ class Client
|
|||
#
|
||||
# @param res [Response] the HTTP Response object
|
||||
# @param opts [Hash] the options used to generate the original HTTP request
|
||||
# @param t [Fixnum] the timeout for the request in seconds
|
||||
# @param t [Integer] the timeout for the request in seconds
|
||||
# @param persist [Boolean] whether or not to persist the TCP connection (pipelining)
|
||||
#
|
||||
# @return [Response] the last valid HTTP response object we received
|
||||
|
|
|
@ -9,10 +9,10 @@ module Rex
|
|||
# @return [String] The kerberos server host
|
||||
attr_accessor :host
|
||||
# @!attribute port
|
||||
# @return [Fixnum] The kerberos server port
|
||||
# @return [Integer] The kerberos server port
|
||||
attr_accessor :port
|
||||
# @!attribute timeout
|
||||
# @return [Fixnum] The connect / read timeout
|
||||
# @return [Integer] The connect / read timeout
|
||||
attr_accessor :timeout
|
||||
# @todo Support UDP
|
||||
# @!attribute protocol
|
||||
|
@ -65,7 +65,7 @@ module Rex
|
|||
# Sends a kerberos request through the connection
|
||||
#
|
||||
# @param req [Rex::Proto::Kerberos::Model::KdcRequest] the request to send
|
||||
# @return [Fixnum] the number of bytes sent
|
||||
# @return [Integer] the number of bytes sent
|
||||
# @raise [RuntimeError] if the transport protocol is unknown
|
||||
# @raise [NotImplementedError] if the transport protocol isn't supported
|
||||
def send_request(req)
|
||||
|
@ -139,7 +139,7 @@ module Rex
|
|||
# Sends a Kerberos Request over a tcp connection
|
||||
#
|
||||
# @param req [Rex::Proto::Kerberos::Model::KdcRequest] the request to send
|
||||
# @return [Fixnum] the number of bytes sent
|
||||
# @return [Integer] the number of bytes sent
|
||||
# @raise [RuntimeError] if the request can't be encoded
|
||||
def send_request_tcp(req)
|
||||
data = req.encode
|
||||
|
|
|
@ -8,7 +8,7 @@ module Rex
|
|||
class Cache < Element
|
||||
|
||||
# @!attribute version
|
||||
# @return [Fixnum] The file format version
|
||||
# @return [Integer] The file format version
|
||||
attr_accessor :version
|
||||
# @!attribute headers
|
||||
# @return [Array<String>] The header tags
|
||||
|
|
|
@ -19,10 +19,10 @@ module Rex
|
|||
# @return [Rex::Proto::Kerberos::CredentialCache::Time]
|
||||
attr_accessor :time
|
||||
# @!attribute is_skey
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :is_skey
|
||||
# @!attribute tkt_flags
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :tkt_flags
|
||||
# @!attribute addrs
|
||||
# @return [Array]
|
||||
|
|
|
@ -8,10 +8,10 @@ module Rex
|
|||
# This class provides a representation of a credential keys stored in the Kerberos Credential Cache.
|
||||
class KeyBlock < Element
|
||||
# @!attribute key_type
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :key_type
|
||||
# @!attribute e_type
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :e_type
|
||||
# @!attribute key_value
|
||||
# @return [String]
|
||||
|
|
|
@ -7,7 +7,7 @@ module Rex
|
|||
# This class provides a representation of a Principal stored in the Kerberos Credential Cache.
|
||||
class Principal < Element
|
||||
# @!attribute name_type
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :name_type
|
||||
# @!attribute realm
|
||||
# @return [String]
|
||||
|
|
|
@ -7,16 +7,16 @@ module Rex
|
|||
# This class provides a representation of credential times stored in the Kerberos Credential Cache.
|
||||
class Time < Element
|
||||
# @!attribute auth_time
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :auth_time
|
||||
# @!attribute start_time
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :start_time
|
||||
# @!attribute end_time
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :end_time
|
||||
# @!attribute renew_till
|
||||
# @return [Fixnum]
|
||||
# @return [Integer]
|
||||
attr_accessor :renew_till
|
||||
|
||||
# Encodes the Rex::Proto::Kerberos::CredentialCache::Time into an String
|
||||
|
|
|
@ -9,7 +9,7 @@ module Rex
|
|||
#
|
||||
# @param cipher [String] the data to decrypt
|
||||
# @param key [String] the key to decrypt
|
||||
# @param msg_type [Fixnum] the message type
|
||||
# @param msg_type [Integer] the message type
|
||||
# @return [String] the decrypted cipher
|
||||
# @raise [RuntimeError] if decryption doesn't succeed
|
||||
def decrypt_rc4_hmac(cipher, key, msg_type)
|
||||
|
@ -39,7 +39,7 @@ module Rex
|
|||
#
|
||||
# @param data [String] the data to encrypt
|
||||
# @param key [String] the key to encrypt
|
||||
# @param msg_type [Fixnum] the message type
|
||||
# @param msg_type [Integer] the message type
|
||||
# @return [String] the encrypted data
|
||||
def encrypt_rc4_hmac(data, key, msg_type)
|
||||
k1 = OpenSSL::HMAC.digest('MD5', key, [msg_type].pack('V'))
|
||||
|
|
|
@ -9,13 +9,13 @@ module Rex
|
|||
# themselves
|
||||
class ApReq < Element
|
||||
# @!attribute pvno
|
||||
# @return [Fixnum] The protocol version number
|
||||
# @return [Integer] The protocol version number
|
||||
attr_accessor :pvno
|
||||
# @!attribute msg_type
|
||||
# @return [Fixnum] The type of the protocol message
|
||||
# @return [Integer] The type of the protocol message
|
||||
attr_accessor :msg_type
|
||||
# @!attribute options
|
||||
# @return [Fixnum] request options, affects processing
|
||||
# @return [Integer] request options, affects processing
|
||||
attr_accessor :options
|
||||
# @!attribute ticket
|
||||
# @return [Rex::Proto::Kerberos::Model::Ticket] The ticket authenticating the client to the server
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue