File tree Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Original file line number Diff line number Diff line change 1
- require 'metasploit/credential/creation'
2
1
# -*- coding: binary -*-
3
2
module Msf
4
3
@@ -9,8 +8,18 @@ module Msf
9
8
###
10
9
11
10
module Auxiliary ::Report
12
-
13
- include Metasploit ::Credential ::Creation
11
+ begin
12
+ require 'metasploit/credential/creation'
13
+ rescue LoadError
14
+ warn "metasploit-credential not in the bundle, so Metasploit::Credential creation will fail for Msf::Auxiliary::Report."
15
+ warn "Bundle installed '--without #{ Bundler . settings . without . join ( ' ' ) } '"
16
+ warn "To clear the without option do `bundle install --without ''` " \
17
+ "(the --without flag with an empty string) or " \
18
+ "`rm -rf .bundle` to remove the .bundle/config manually and " \
19
+ "then `bundle install`"
20
+ else
21
+ include Metasploit ::Credential ::Creation
22
+ end
14
23
15
24
# This method overrides the method from Metasploit::Credential to check for an active db
16
25
def active_db?
Original file line number Diff line number Diff line change 56
56
#
57
57
58
58
require 'msf/core/db_manager/import_msf_xml'
59
- require 'metasploit/credential/creation'
60
59
61
60
module Msf
62
61
@@ -157,7 +156,19 @@ class DBImportError < RuntimeError
157
156
###
158
157
class DBManager
159
158
include Msf ::DBManager ::ImportMsfXml
160
- include Metasploit ::Credential ::Creation
159
+
160
+ begin
161
+ require 'metasploit/credential/creation'
162
+ rescue LoadError
163
+ warn "metasploit-credential not in the bundle, so Metasploit::Credential creation will fail for Msf::DBManager"
164
+ warn "Bundle installed '--without #{ Bundler . settings . without . join ( ' ' ) } '"
165
+ warn "To clear the without option do `bundle install --without ''` " \
166
+ "(the --without flag with an empty string) or " \
167
+ "`rm -rf .bundle` to remove the .bundle/config manually and " \
168
+ "then `bundle install`"
169
+ else
170
+ include Metasploit ::Credential ::Creation
171
+ end
161
172
162
173
def rfc3330_reserved ( ip )
163
174
case ip . class . to_s
Original file line number Diff line number Diff line change 1
- require 'metasploit/credential/creation'
2
-
3
1
module Msf
4
2
class DBManager
5
3
# Handles importing of the xml format exported by Pro. The methods are in a
@@ -8,7 +6,6 @@ class DBManager
8
6
# methods defined in a class cannot be overridden by including a module
9
7
# (unless you're running Ruby 2.0 and can use prepend)
10
8
module ImportMsfXml
11
- include Metasploit ::Credential ::Creation
12
9
#
13
10
# CONSTANTS
14
11
#
You can’t perform that action at this time.
0 commit comments