File tree Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,6 @@ def initialize(info = {})
114
114
@module_info_copy = info . dup
115
115
116
116
self . module_info = info
117
- generate_uuid
118
117
119
118
set_defaults
120
119
Original file line number Diff line number Diff line change 1
- require 'rex/text'
2
-
1
+ # NOTE: Metasploit does not use real UUIDs currently.
2
+ # To modify this to be a real UUID we will need to do a database migration.
3
+ # See: https://github.com/rapid7/metasploit-framework/pull/20170
3
4
module Msf ::Module ::UUID
5
+ UUID_CHARS = [ *( 'a' ..'z' ) , *( '0' ..'9' ) ] . freeze
6
+ private_constant :UUID_CHARS
7
+
4
8
#
5
9
# Attributes
6
10
#
7
11
8
- # @!attribute [r] uuid
9
- # A unique identifier for this module instance
10
- attr_reader :uuid
12
+ # @return [String] A unique identifier for this module instance
13
+ def uuid
14
+ @uuid ||= UUID_CHARS . sample ( 8 ) . join
15
+ end
11
16
12
17
protected
13
18
@@ -17,13 +22,4 @@ module Msf::Module::UUID
17
22
18
23
# @!attribute [w] uuid
19
24
attr_writer :uuid
20
-
21
-
22
- #
23
- # Instance Methods
24
- #
25
-
26
- def generate_uuid
27
- self . uuid = Rex ::Text . rand_text_alphanumeric ( 8 ) . downcase
28
- end
29
25
end
You can’t perform that action at this time.
0 commit comments