Module: Msf::Auxiliary::WmapModule
- Included in:
- WmapCrawler, WmapScanDir, WmapScanFile, WmapScanGeneric, WmapScanQuery, WmapScanSSL, WmapScanServer, WmapScanUniqueQuery
- Defined in:
- lib/msf/core/auxiliary/wmap_module.rb
Instance Attribute Summary collapse
-
#orderid ⇒ Object
Returns the value of attribute orderid.
-
#requiredids ⇒ Object
Returns the value of attribute requiredids.
Instance Method Summary collapse
-
#distance(a, b) ⇒ Object
Levenshtein distance algorithm (slow, huge mem consuption).
-
#headersparse(qheaders) ⇒ Object
Modified from CGI.rb as we dont use arrays.
-
#initialize(info = {}) ⇒ Object
Initializes an instance of a WMAP module.
-
#queryparse(query) ⇒ Object
modified from CGI.rb as we dont use arrays.
- #register_wmap_options(options) ⇒ Object
- #wmap_base_url ⇒ Object
- #wmap_enabled ⇒ Object
- #wmap_getoid ⇒ Object
- #wmap_setoid(oid) ⇒ Object
- #wmap_target_host ⇒ Object
- #wmap_target_port ⇒ Object
- #wmap_target_ssl ⇒ Object
- #wmap_target_vhost ⇒ Object
- #wmap_type ⇒ Object
Instance Attribute Details
#orderid ⇒ Object
Returns the value of attribute orderid.
11 12 13 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 11 def orderid @orderid end |
#requiredids ⇒ Object
Returns the value of attribute requiredids.
12 13 14 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 12 def requiredids @requiredids end |
Instance Method Details
#distance(a, b) ⇒ Object
Levenshtein distance algorithm (slow, huge mem consuption)
112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 112 def distance(a, b) case when a.empty? b.length when b.empty? a.length else [(a[0] == b[0] ? 0 : 1) + distance(a[1..-1], b[1..-1]), 1 + distance(a[1..-1], b), 2 + distance(a, b[1..-1])].min end end |
#headersparse(qheaders) ⇒ Object
Modified from CGI.rb as we dont use arrays
82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 82 def headersparse(qheaders) params = Hash.new() qheaders.split(/[&;]/n).each do |pairs| key, value = pairs.split(':',2) if params.has_key?(key) #Error else params[key] = value end end params end |
#initialize(info = {}) ⇒ Object
Initializes an instance of a WMAP module
17 18 19 20 21 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 17 def initialize(info = {}) super self.orderid = 0xFFFFFF self.requiredids = {} end |
#queryparse(query) ⇒ Object
modified from CGI.rb as we dont use arrays
97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 97 def queryparse(query) params = Hash.new() query.split(/[&;]/n).each do |pairs| key, value = pairs.split('=',2) if params.has_key?(key) #Error else params[key] = value end end params end |
#register_wmap_options(options) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 23 def () if .has_key?('OrderID') self.orderid = ['OrderID'] end if .has_key?('Require') self.requiredids = ['Require'] end end |
#wmap_base_url ⇒ Object
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 67 def wmap_base_url res = (ssl ? "https://" : "http://") if datastore['VHOST'].nil? res << wmap_target_host else res << datastore['VHOST'] end res << ":" + wmap_target_port.to_s res end |
#wmap_enabled ⇒ Object
33 34 35 36 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 33 def wmap_enabled #enabled by default true end |
#wmap_getoid ⇒ Object
38 39 40 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 38 def wmap_getoid self.orderid end |
#wmap_setoid(oid) ⇒ Object
42 43 44 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 42 def wmap_setoid(oid) self.orderid = oid end |
#wmap_target_host ⇒ Object
51 52 53 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 51 def wmap_target_host datastore['RHOST'] end |
#wmap_target_port ⇒ Object
55 56 57 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 55 def wmap_target_port datastore['RPORT'] end |
#wmap_target_ssl ⇒ Object
59 60 61 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 59 def wmap_target_ssl datastore['SSL'] end |
#wmap_target_vhost ⇒ Object
63 64 65 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 63 def wmap_target_vhost datastore['VHOST'] end |
#wmap_type ⇒ Object
46 47 48 49 |
# File 'lib/msf/core/auxiliary/wmap_module.rb', line 46 def wmap_type #default type nil end |