Skip to content

Commit c69b6b2

Browse files
David MaloneyDavid Maloney
authored andcommitted
only issue db warning once
cache the fact that we have issued the db warning so we do not issue it for every credential attempt on the module run. 5266
1 parent dd5060e commit c69b6b2

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

lib/msf/core/auxiliary/report.rb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,43 @@ module Auxiliary::Report
1212

1313
optionally_include_metasploit_credential_creation
1414

15+
def db_warning_given?
16+
if @warning_issued
17+
true
18+
else
19+
@warning_issued = true
20+
false
21+
end
22+
end
23+
1524
def create_cracked_credential(opts={})
1625
if active_db?
1726
super(opts)
18-
else
27+
elsif !db_warning_given?
1928
vprint_warning('No active DB -- Credential data will not be saved!')
2029
end
2130
end
2231

2332
def create_credential(opts={})
2433
if active_db?
2534
super(opts)
26-
else
35+
elsif !db_warning_given?
2736
vprint_warning('No active DB -- Credential data will not be saved!')
2837
end
2938
end
3039

3140
def create_credential_login(opts={})
3241
if active_db?
3342
super(opts)
34-
else
43+
elsif !db_warning_given?
3544
vprint_warning('No active DB -- Credential data will not be saved!')
3645
end
3746
end
3847

3948
def invalidate_login(opts={})
4049
if active_db?
4150
super(opts)
42-
else
51+
elsif !db_warning_given?
4352
vprint_warning('No active DB -- Credential data will not be saved!')
4453
end
4554
end

0 commit comments

Comments
 (0)