File tree Expand file tree Collapse file tree 3 files changed +40
-5
lines changed
modules/payloads/stagers/windows Expand file tree Collapse file tree 3 files changed +40
-5
lines changed Original file line number Diff line number Diff line change @@ -33,25 +33,50 @@ def deprecation_date; @deprecation_date; end
33
33
end
34
34
35
35
# (see ClassMethods#replacement_module)
36
- def replacement_module ; self . class . replacement_module ; end
36
+ def replacement_module
37
+ if self . class . instance_variable_defined? ( :@replacement_module )
38
+ return self . class . replacement_module
39
+ elsif self . class . const_defined? ( :DEPRECATION_REPLACEMENT )
40
+ return self . class . const_get ( :DEPRECATION_REPLACEMENT )
41
+ end
42
+ end
43
+
37
44
# (see ClassMethods#deprecation_date)
38
- def deprecation_date ; self . class . deprecation_date ; end
45
+ def deprecation_date
46
+ if self . class . instance_variable_defined? ( :@deprecation_date )
47
+ return self . class . deprecation_date
48
+ elsif self . class . const_defined? ( :DEPRECATION_DATE )
49
+ return self . class . const_get ( :DEPRECATION_DATE )
50
+ end
51
+ end
39
52
40
53
# Extends with {ClassMethods}
41
54
def self . included ( base )
42
55
base . extend ( ClassMethods )
43
56
end
44
57
45
- def setup
58
+ # Print the module deprecation information
59
+ #
60
+ # @return [void]
61
+ def print_deprecation_warning
46
62
print_warning ( "*" *72 )
47
- print_warning ( "*%red" +"This module is deprecated!" . center ( 70 ) +"%clr*" )
63
+ print_warning ( "*%red" +"The module #{ refname } is deprecated!" . center ( 70 ) +"%clr*" )
48
64
if deprecation_date
49
65
print_warning ( "*" +"It will be removed on or about #{ deprecation_date } " . center ( 70 ) +"*" )
50
66
end
51
67
if replacement_module
52
68
print_warning ( "*" +"Use #{ replacement_module } instead" . center ( 70 ) +"*" )
53
69
end
54
70
print_warning ( "*" *72 )
71
+ end
72
+
73
+ def generate
74
+ print_deprecation_warning
75
+ super
76
+ end
77
+
78
+ def setup
79
+ print_deprecation_warning
55
80
super
56
81
end
57
82
Original file line number Diff line number Diff line change 6
6
7
7
require 'msf/core'
8
8
require 'msf/core/handler/reverse_ipv6_http'
9
-
9
+ require 'msf/core/module/deprecated'
10
10
11
11
module Metasploit3
12
12
13
13
include Msf ::Payload ::Stager
14
14
include Msf ::Payload ::Windows
15
+ include Msf ::Module ::Deprecated
16
+
17
+ DEPRECATION_DATE = Date . new ( 2014 , 7 , 30 )
18
+ DEPRECATION_REPLACEMENT = 'windows/meterpreter/reverse_https'
15
19
16
20
def initialize ( info = { } )
17
21
super ( merge_info ( info ,
Original file line number Diff line number Diff line change 3
3
# Current source: https://github.com/rapid7/metasploit-framework
4
4
##
5
5
6
+
6
7
require 'msf/core'
7
8
require 'msf/core/handler/reverse_ipv6_https'
9
+ require 'msf/core/module/deprecated'
8
10
9
11
module Metasploit3
10
12
11
13
include Msf ::Payload ::Stager
12
14
include Msf ::Payload ::Windows
15
+ include Msf ::Module ::Deprecated
16
+
17
+ DEPRECATION_DATE = Date . new ( 2014 , 7 , 30 )
18
+ DEPRECATION_REPLACEMENT = 'windows/meterpreter/reverse_https'
13
19
14
20
def initialize ( info = { } )
15
21
super ( merge_info ( info ,
You can’t perform that action at this time.
0 commit comments