Use yardoc for new methods

Also substitute '&&' for 'and', and fix some whitespace
bug/bundler_fix
James Lee 2014-08-24 14:19:39 -05:00
parent 3b5eb42b55
commit a75d47aad9
No known key found for this signature in database
GPG Key ID: 2D6094C7CEA0A321
1 changed files with 32 additions and 28 deletions

View File

@ -445,10 +445,10 @@ module Exploit::Remote::HttpClient
# destination host and port. This method falls back to using the old # destination host and port. This method falls back to using the old
# service.info field to represent the HTTP Server header. # service.info field to represent the HTTP Server header.
# #
# Options: # @option opts [String] :uri ('/') An HTTP URI to request in order to generate
# @option opts [String] :uri An HTTP URI to request in order to generate a fingerprint # a fingerprint
# @option opts [String] :method An HTTP method to use in the fingerprint request # @option opts [String] :method ('GET') An HTTP method to use in the fingerprint
# # request
def lookup_http_fingerprints(opts={}) def lookup_http_fingerprints(opts={})
uri = opts[:uri] || '/' uri = opts[:uri] || '/'
method = opts[:method] || 'GET' method = opts[:method] || 'GET'
@ -465,8 +465,8 @@ module Exploit::Remote::HttpClient
# Order by note_id descending so the first value is the most recent # Order by note_id descending so the first value is the most recent
service.notes.where(:ntype => 'http.fingerprint').order("notes.id DESC").each do |n| service.notes.where(:ntype => 'http.fingerprint').order("notes.id DESC").each do |n|
next unless n.data and n.data.kind_of?(::Hash) next unless n.data && n.data.kind_of?(::Hash)
next unless n.data[:uri] == uri and n.data[:method] == method next unless n.data[:uri] == uri && n.data[:method] == method
# Append additional fingerprints to the results as found # Append additional fingerprints to the results as found
fprints.unshift n.data.dup fprints.unshift n.data.dup
end end
@ -481,14 +481,18 @@ module Exploit::Remote::HttpClient
# will use it directly, otherwise it will check the database for a previous # will use it directly, otherwise it will check the database for a previous
# fingerprint. Failing that, it will make a request for /. # fingerprint. Failing that, it will make a request for /.
# #
# Options: # Other options are passed directly to {#connect} if :response is not given
# :response an Http::Packet as returned from any of the send_* methods
# :uri an HTTP URI to request in order to generate a fingerprint
# :method an HTTP method to use in the fingerprint request
# :full request the full HTTP fingerprint, not just the signature
# #
# Other options are passed directly to +connect+ if :response is not given # @option opts [Rex::Proto::Http::Packet] :response The return value from any
# of the send_* methods
# @option opts [String] :uri ('/') An HTTP URI to request in order to generate
# a fingerprint
# @option opts [String] :method ('GET') An HTTP method to use in the fingerprint
# request
# @option opts [Boolean] :full (false) Request the full HTTP fingerprint, not
# just the signature
# #
# @return [String]
def http_fingerprint(opts={}) def http_fingerprint(opts={})
res = nil res = nil
uri = opts[:uri] || '/' uri = opts[:uri] || '/'