Class: Msf::Auxiliary::Web::Fuzzable

Inherits:
Object
  • Object
show all
Defined in:
lib/msf/core/auxiliary/web/fuzzable.rb

Direct Known Subclasses

Form, Path

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fuzzerObject

Returns the value of attribute fuzzer


21
22
23
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 21

def fuzzer
  @fuzzer
end

Instance Method Details

#==(other) ⇒ Object


67
68
69
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 67

def ==( other )
  hash == other.hash
end

#dupObject


71
72
73
74
75
76
77
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 71

def dup
  cf = self.fuzzer
  self.fuzzer = nil
  ce = Marshal.load( Marshal.dump( self ) )
  self.fuzzer = ce.fuzzer = cf
  ce
end

#fuzz(cfuzzer = nil, &callback) ⇒ Object


35
36
37
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 35

def fuzz( cfuzzer = nil, &callback )
  fuzz_wrapper( cfuzzer ) { |p| callback.call( p.submit, p ) }
end

#fuzz_async(cfuzzer = nil, &callback) ⇒ Object


39
40
41
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 39

def fuzz_async( cfuzzer = nil, &callback )
  fuzz_wrapper( cfuzzer ) { |p| p.submit_async { |res| callback.call( res, p ) } }
end

#fuzz_id(opts = {}) ⇒ Object


31
32
33
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 31

def fuzz_id( opts = {} )
  "#{opts[:type]}:#{fuzzer.shortname}:#{method}:#{action}:#{params.keys.sort.to_s}:#{altered}=#{altered_value}"
end

#fuzzed(opts = {}) ⇒ Object


27
28
29
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 27

def fuzzed( opts = {} )
  fuzzer.checked fuzz_id( opts )
end

#fuzzed?(opts = {}) ⇒ Boolean

Returns:

  • (Boolean)

23
24
25
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 23

def fuzzed?( opts = {} )
  fuzzer.checked? fuzz_id( opts )
end

#hashObject


63
64
65
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 63

def hash
  to_hash.hash
end

#httpObject


59
60
61
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 59

def http
  fuzzer.http
end

#submit(opts = {}) ⇒ Object


43
44
45
46
47
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 43

def submit( opts = {} )
  fuzzer.increment_request_counter if fuzzer

  http.request( *request( opts ) )
end

#submit_async(opts = {}, &callback) ⇒ Object


49
50
51
52
53
54
55
56
57
# File 'lib/msf/core/auxiliary/web/fuzzable.rb', line 49

def submit_async( opts = {}, &callback )
  fuzzer.increment_request_counter

  http.request_async( *request( opts ) ) do |resp|
    callback.call resp if callback
  end

  nil
end