Skip to content

Commit 43c076e

Browse files
committed
Merge remote-tracking branch 'tasos-r7/bug/web-vuln-logging' into rapid7
[Closes rapid7#1559]
2 parents 3b87ba8 + 8131366 commit 43c076e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

lib/msf/core/auxiliary/web.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ def log_fingerprint( opts = {} )
161161
map { |x| x.to_s }.join( '|' ).hash
162162

163163
return if parent.vulns.include?( vhash )
164-
parent.vulns[vhash] = true
165164

166165
location = opts[:location] ?
167166
page.url.merge( URI( opts[:location].to_s )) : page.url
@@ -183,6 +182,7 @@ def log_fingerprint( opts = {} )
183182
}
184183

185184
info[:confidence] = calculate_confidence( info )
185+
parent.vulns[vhash] = info
186186

187187
report_web_vuln( info )
188188

@@ -196,7 +196,6 @@ def log_resource( opts = {} )
196196
map { |x| x.to_s }.join( '|' ).hash
197197

198198
return if parent.vulns.include?( vhash )
199-
parent.vulns[vhash] = true
200199

201200
location = URI( opts[:location].to_s )
202201
info = {
@@ -216,6 +215,7 @@ def log_resource( opts = {} )
216215
}
217216

218217
info[:confidence] = calculate_confidence( info )
218+
parent.vulns[vhash] = info
219219

220220
report_web_vuln( info )
221221

lib/msf/core/auxiliary/web/http.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def timed_out
6767
attr_reader :opts
6868
attr_reader :headers
6969
attr_reader :framework
70+
attr_reader :parent
7071

7172
attr_accessor :redirect_limit
7273
attr_accessor :username , :password
@@ -75,6 +76,7 @@ def initialize( opts = {} )
7576
@opts = opts.dup
7677

7778
@framework = opts[:framework]
79+
@parent = opts[:parent]
7880

7981
@headers = {
8082
'Accept' => '*/*',
@@ -130,8 +132,8 @@ def run
130132
begin
131133
request.handle_response request( request.url, request.opts )
132134
rescue => e
133-
elog e.to_s
134-
e.backtrace.each { |l| elog l }
135+
print_error e.to_s
136+
e.backtrace.each { |l| print_error l }
135137
end
136138
end
137139
end
@@ -250,6 +252,11 @@ def custom_404?( path, body, &callback )
250252

251253
private
252254

255+
def print_error( message )
256+
return if !@parent
257+
@parent.print_error message
258+
end
259+
253260
def call_after_run_blocks
254261
while block = @after_run_blocks.pop
255262
block.call

0 commit comments

Comments
 (0)