Class: Watobo::PassiveCheck
- Inherits:
-
Object
- Object
- Watobo::PassiveCheck
show all
- Extended by:
- Subscriber
- Includes:
- Constants
- Defined in:
- lib/watobo/core/passive_check.rb
Overview
Constant Summary
collapse
- @@lock =
Mutex.new
Constants included
from Constants
Constants::AC_GROUP_APACHE, Constants::AC_GROUP_DOMINO, Constants::AC_GROUP_ENUMERATION, Constants::AC_GROUP_FILE_INCLUSION, Constants::AC_GROUP_FLASH, Constants::AC_GROUP_GENERIC, Constants::AC_GROUP_JBOSS, Constants::AC_GROUP_JOOMLA, Constants::AC_GROUP_SAP, Constants::AC_GROUP_SQL, Constants::AC_GROUP_TYPO3, Constants::AC_GROUP_XSS, Constants::AUTH_TYPE_BASIC, Constants::AUTH_TYPE_DIGEST, Constants::AUTH_TYPE_NONE, Constants::AUTH_TYPE_NTLM, Constants::AUTH_TYPE_UNKNOWN, Constants::CHAT_SOURCE_AUTO_SCAN, Constants::CHAT_SOURCE_FUZZER, Constants::CHAT_SOURCE_INTERCEPT, Constants::CHAT_SOURCE_MANUAL, Constants::CHAT_SOURCE_MANUAL_SCAN, Constants::CHAT_SOURCE_PROXY, Constants::CHAT_SOURCE_UNDEF, Constants::DEFAULT_PORT_HTTP, Constants::DEFAULT_PORT_HTTPS, Constants::FINDING_TYPE_HINT, Constants::FINDING_TYPE_INFO, Constants::FINDING_TYPE_UNDEFINED, Constants::FINDING_TYPE_VULN, Constants::FIRST_TIME_FILE, Constants::GUI_REGULAR_FONT_SIZE, Constants::GUI_SMALL_FONT_SIZE, Constants::ICON_PATH, Constants::LOG_DEBUG, Constants::LOG_INFO, Constants::SCAN_CANCELED, Constants::SCAN_FINISHED, Constants::SCAN_PAUSED, Constants::SCAN_STARTED, Constants::TE_CHUNKED, Constants::TE_COMPRESS, Constants::TE_DEFLATE, Constants::TE_GZIP, Constants::TE_IDENTITY, Constants::TE_NONE, Constants::VULN_RATING_CRITICAL, Constants::VULN_RATING_HIGH, Constants::VULN_RATING_INFO, Constants::VULN_RATING_LOW, Constants::VULN_RATING_MEDIUM, Constants::VULN_RATING_UNDEFINED
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Subscriber
clearEvents, notify, subscribe
Constructor Details
Returns a new instance of PassiveCheck.
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
# File 'lib/watobo/core/passive_check.rb', line 90
def initialize(project)
@project = project
@enabled = true
@info = {
:check_name => '', :check_group => '', :description => '', :author => "not modified", :version => "unversioned", :target => nil }
@finding = {
:title => 'untitled', :check_pattern => nil, :proof_pattern => nil, :threat => '', :measure => '', :class => "undefined", :subclass => nil, :type => FINDING_TYPE_UNDEFINED, :chat => nil, :rating => VULN_RATING_UNDEFINED, :cvss => "n/a", :icon => nil, :timestamp => nil }
end
|
Instance Attribute Details
#info ⇒ Object
Returns the value of attribute info.
8
9
10
|
# File 'lib/watobo/core/passive_check.rb', line 8
def info
@info
end
|
Instance Method Details
#addFinding(details) ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# File 'lib/watobo/core/passive_check.rb', line 11
def addFinding(details)
t = Time.now
now = t.strftime("%m/%d/%Y@%H:%M:%S")
@@lock.synchronize {
new_details = Hash.new
new_details.update(@finding)
new_details.update(details)
new_details[:tstamp] = now
unless new_details.has_key?(:fid)
id_string = ''
id_string << new_details[:chat].request.url.to_s if new_details[:chat]
id_string << new_details[:class] if new_details[:class]
id_string << new_details[:title] if new_details[:title]
id_string << new_details[:unique] if new_details[:unique]
if id_string.empty? then
id_string = rand(10000)
end
new_details[:fid] = Digest::MD5.hexdigest(id_string)
end
new_details[:module] = self.class.to_s
if details[:debug] == true then
puts "---"
puts new_details[:class]
puts new_details[:title]
puts "---"
end
request = new_details[:chat].request
response = new_details[:chat].response
new_details[:chat_id] = new_details[:chat].id
unless new_details[:proof_pattern].nil?
new_details[:proof_pattern] = new_details[:proof_pattern].length > 128 ? new_details[:proof_pattern][0..127] : new_details[:proof_pattern]
end
unless new_details[:check_pattern].nil?
new_details[:check_pattern] = new_details[:check_pattern].length > 128 ? new_details[:check_pattern][0..127] : new_details[:check_pattern]
end
new_details.delete(:chat)
new_finding = Watobo::Finding.new(request, response, new_details)
Watobo::Findings.add new_finding
}
end
|
#disable ⇒ Object
82
83
84
|
# File 'lib/watobo/core/passive_check.rb', line 82
def disable
@enable = false
end
|
#do_test(chat) ⇒ Object
86
87
88
|
# File 'lib/watobo/core/passive_check.rb', line 86
def do_test(chat)
raise "function do_test not defined"
end
|
#enable ⇒ Object
78
79
80
|
# File 'lib/watobo/core/passive_check.rb', line 78
def enable
@enabled = true
end
|
#enabled=(status) ⇒ Object
74
75
76
|
# File 'lib/watobo/core/passive_check.rb', line 74
def enabled=(status)
@enabled = status
end
|
#enabled? ⇒ Boolean
70
71
72
|
# File 'lib/watobo/core/passive_check.rb', line 70
def enabled?
@enabled
end
|