Skip to content

Commit 001b6d9

Browse files
David MaloneyDavid Maloney
authored andcommitted
allows loginscanners to work without db
created stub methods around the credential creation methods modules would use from Metasploit::Credential, they try to call the real ones but rescue a NoMethodError that arises if framework is setup without the db. it just prints a message to the console telling the user the cred data will not be saved MSP-10969
1 parent e3e9a64 commit 001b6d9

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lib/msf/core/auxiliary/report.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,38 @@ module Auxiliary::Report
1212

1313
optionally_include_metasploit_credential_creation
1414

15+
def create_cracked_credential(opts={})
16+
begin
17+
super(opts)
18+
rescue NoMethodError => e
19+
print_error "There does not appear to be a functioning DB, Credential Data will not be saved!"
20+
end
21+
end
22+
23+
def create_credential(opts={})
24+
begin
25+
super(opts)
26+
rescue NoMethodError => e
27+
print_error "There does not appear to be a functioning DB, Credential Data will not be saved!"
28+
end
29+
end
30+
31+
def create_credential_login(opts={})
32+
begin
33+
super(opts)
34+
rescue NoMethodError => e
35+
print_error "There does not appear to be a functioning DB, Credential Data will not be saved!"
36+
end
37+
end
38+
39+
def invalidate_login(opts={})
40+
begin
41+
super(opts)
42+
rescue NoMethodError => e
43+
print_error "There does not appear to be a functioning DB, Credential Data will not be saved!"
44+
end
45+
end
46+
1547
# This method overrides the method from Metasploit::Credential to check for an active db
1648
def active_db?
1749
framework.db.active

0 commit comments

Comments
 (0)