ronin 1.0.0 → 1.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +0 -1
- data/ChangeLog.md +67 -3
- data/Gemfile +20 -12
- data/README.md +3 -5
- data/gemspec.yml +5 -5
- data/lib/ronin/address.rb +8 -3
- data/lib/ronin/arch.rb +39 -14
- data/lib/ronin/author.rb +2 -0
- data/lib/ronin/auto_load.rb +67 -0
- data/lib/ronin/campaign.rb +15 -2
- data/lib/ronin/class_methods.rb +7 -1
- data/lib/ronin/config.rb +5 -0
- data/lib/ronin/credential.rb +14 -3
- data/lib/ronin/database/database.rb +38 -12
- data/lib/ronin/database/migrations.rb +3 -1
- data/lib/ronin/database/migrations/add_created_at_column_to_targets_table.rb +48 -0
- data/lib/ronin/database/migrations/add_updated_at_column_to_campaigns_table.rb +47 -0
- data/lib/ronin/database/migrations/create_licenses_table.rb +1 -1
- data/lib/ronin/database/migrations/create_passwords_table.rb +1 -1
- data/lib/ronin/database/migrations/{create_cached_files_table.rb → create_script_paths_table.rb} +4 -4
- data/lib/ronin/database/migrations/migration.rb +3 -6
- data/lib/ronin/database/migrations/migrations.rb +3 -3
- data/lib/ronin/email_address.rb +20 -3
- data/lib/ronin/environment.rb +0 -3
- data/lib/ronin/host_name.rb +20 -6
- data/lib/ronin/host_name_ip_address.rb +2 -3
- data/lib/ronin/installation.rb +92 -23
- data/lib/ronin/ip_address.rb +31 -8
- data/lib/ronin/ip_address_mac_address.rb +2 -3
- data/lib/ronin/license.rb +1 -1
- data/lib/ronin/mac_address.rb +6 -4
- data/lib/ronin/model/class_methods.rb +4 -0
- data/lib/ronin/model/has_authors/class_methods.rb +4 -0
- data/lib/ronin/model/has_authors/has_authors.rb +4 -0
- data/lib/ronin/model/has_description/class_methods.rb +2 -0
- data/lib/ronin/model/has_description/has_description.rb +2 -0
- data/lib/ronin/model/has_license/class_methods.rb +2 -0
- data/lib/ronin/model/has_license/has_license.rb +4 -0
- data/lib/ronin/model/has_name/class_methods.rb +2 -0
- data/lib/ronin/model/has_name/has_name.rb +4 -0
- data/lib/ronin/model/has_title/class_methods.rb +2 -0
- data/lib/ronin/model/has_title/has_title.rb +2 -0
- data/lib/ronin/model/has_unique_name/class_methods.rb +2 -0
- data/lib/ronin/model/has_unique_name/has_unique_name.rb +7 -1
- data/lib/ronin/model/has_version/class_methods.rb +4 -0
- data/lib/ronin/model/has_version/has_version.rb +2 -0
- data/lib/ronin/model/model.rb +2 -0
- data/lib/ronin/model/types.rb +1 -7
- data/lib/ronin/model/types/description.rb +2 -0
- data/lib/ronin/network/mixins/esmtp.rb +40 -25
- data/lib/ronin/network/mixins/http.rb +336 -73
- data/lib/ronin/network/mixins/imap.rb +38 -25
- data/lib/ronin/network/mixins/pop3.rb +34 -21
- data/lib/ronin/network/mixins/smtp.rb +40 -25
- data/lib/ronin/network/mixins/tcp.rb +66 -41
- data/lib/ronin/network/mixins/telnet.rb +43 -30
- data/lib/ronin/network/mixins/udp.rb +59 -40
- data/lib/ronin/open_port.rb +12 -5
- data/lib/ronin/organization.rb +1 -2
- data/lib/ronin/os.rb +10 -3
- data/lib/ronin/os_guess.rb +2 -3
- data/lib/ronin/password.rb +11 -3
- data/lib/ronin/port.rb +7 -2
- data/lib/ronin/{engine/exceptions/deploy_failed.rb → repositories.rb} +4 -6
- data/lib/ronin/repository.rb +110 -37
- data/lib/ronin/ronin.rb +4 -3
- data/lib/ronin/{engine.rb → script.rb} +2 -1
- data/lib/ronin/{engine → script}/buildable.rb +43 -29
- data/lib/ronin/script/class_methods.rb +84 -0
- data/lib/ronin/{engine → script}/deployable.rb +61 -40
- data/lib/ronin/{engine → script}/exceptions.rb +4 -3
- data/lib/ronin/script/exceptions/deploy_failed.rb +27 -0
- data/lib/ronin/{engine/exceptions/not_built.rb → script/exceptions/exception.rb} +2 -2
- data/lib/ronin/{engine/exceptions/verification_failed.rb → script/exceptions/not_built.rb} +4 -2
- data/lib/ronin/script/exceptions/test_failed.rb +27 -0
- data/lib/ronin/script/instance_methods.rb +217 -0
- data/lib/ronin/script/path.rb +277 -0
- data/lib/ronin/{engine/engine.rb → script/script.rb} +52 -15
- data/lib/ronin/{engine/verifiable.rb → script/testable.rb} +97 -68
- data/lib/ronin/service.rb +1 -2
- data/lib/ronin/service_credential.rb +1 -2
- data/lib/ronin/software.rb +3 -2
- data/lib/ronin/spec/database.rb +0 -4
- data/lib/ronin/target.rb +11 -3
- data/lib/ronin/tcp_port.rb +3 -2
- data/lib/ronin/udp_port.rb +2 -0
- data/lib/ronin/ui/cli/cli.rb +6 -0
- data/lib/ronin/ui/cli/command.rb +48 -12
- data/lib/ronin/ui/cli/commands/campaigns.rb +3 -3
- data/lib/ronin/ui/cli/commands/console.rb +2 -1
- data/lib/ronin/ui/cli/commands/creds.rb +3 -3
- data/lib/ronin/ui/cli/commands/database.rb +1 -17
- data/lib/ronin/ui/cli/commands/emails.rb +3 -3
- data/lib/ronin/ui/cli/commands/hosts.rb +3 -7
- data/lib/ronin/ui/cli/commands/ips.rb +3 -7
- data/lib/ronin/ui/cli/commands/repos.rb +5 -17
- data/lib/ronin/ui/cli/commands/urls.rb +3 -3
- data/lib/ronin/ui/cli/model_command.rb +82 -97
- data/lib/ronin/ui/cli/resources_command.rb +89 -0
- data/lib/ronin/ui/cli/script_command.rb +115 -0
- data/lib/ronin/ui/console.rb +17 -3
- data/lib/ronin/ui/output/helpers.rb +18 -0
- data/lib/ronin/ui/output/output.rb +20 -1
- data/lib/ronin/ui/output/terminal/color.rb +10 -0
- data/lib/ronin/ui/output/terminal/raw.rb +10 -0
- data/lib/ronin/ui/shell.rb +2 -0
- data/lib/ronin/url.rb +47 -12
- data/lib/ronin/url_query_param.rb +4 -0
- data/lib/ronin/url_scheme.rb +3 -3
- data/lib/ronin/user_name.rb +2 -0
- data/lib/ronin/version.rb +1 -1
- data/lib/ronin/web_credential.rb +6 -3
- data/spec/arch_spec.rb +3 -3
- data/spec/classes/my_script.rb +21 -0
- data/spec/helpers/repos/{test1 → installed}/ronin.yml +1 -1
- data/spec/helpers/repos/{hello/cache → installed/scripts}/.keep +0 -0
- data/spec/helpers/repos/local/lib/init.rb +1 -0
- data/spec/helpers/repos/{hello → local}/lib/stuff/another_test.rb +0 -0
- data/spec/helpers/repos/{hello → local}/lib/stuff/test.rb +0 -0
- data/spec/helpers/repos/{random → local}/ronin.yml +1 -1
- data/spec/helpers/repos/{random/cache → local/scripts}/.keep +0 -0
- data/spec/helpers/repos/{hello → remote}/ronin.yml +1 -1
- data/spec/helpers/repos/remote/scripts/.keep +0 -0
- data/spec/helpers/repos/{test2 → scripts}/ronin.yml +0 -0
- data/spec/helpers/repos/scripts/scripts/cached/cached.rb +10 -0
- data/spec/helpers/repos/scripts/scripts/cached/missing.rb +10 -0
- data/spec/helpers/repos/scripts/scripts/cached/modified.rb +10 -0
- data/spec/helpers/repos/scripts/scripts/cached/unmodified.rb +10 -0
- data/spec/helpers/repos/scripts/scripts/failures/exceptions.rb +11 -0
- data/spec/helpers/repos/{test2/cache/cacheable_model → scripts/scripts/failures}/load_errors.rb +3 -1
- data/spec/helpers/repos/{test2/cache/cacheable_model → scripts/scripts/failures}/name_errors.rb +1 -0
- data/spec/helpers/repos/scripts/scripts/failures/no_method_errors.rb +10 -0
- data/spec/helpers/repos/scripts/scripts/failures/syntax_errors.rb +11 -0
- data/spec/helpers/repos/scripts/scripts/failures/validation_errors.rb +11 -0
- data/spec/helpers/repos/scripts/scripts/my_scripts/test.rb +16 -0
- data/spec/model/spec_helper.rb +0 -2
- data/spec/repository_spec.rb +61 -81
- data/spec/ronin_spec.rb +2 -2
- data/spec/{engine → script}/buildable_spec.rb +9 -9
- data/spec/script/classes/buildable_class.rb +15 -0
- data/spec/script/classes/deployable_class.rb +13 -0
- data/spec/{engine/classes/engine_class.rb → script/classes/script_class.rb} +3 -3
- data/spec/{engine/classes/verifiable_class.rb → script/classes/testable_class.rb} +5 -5
- data/spec/{engine → script}/deployable_spec.rb +10 -10
- data/spec/{cached_file_spec.rb → script/path_spec.rb} +33 -72
- data/spec/script/script_spec.rb +130 -0
- data/spec/script/testable_spec.rb +117 -0
- data/spec/spec_helper.rb +15 -13
- metadata +114 -139
- data/lib/ronin/cached_file.rb +0 -247
- data/lib/ronin/engine/class_methods.rb +0 -135
- data/lib/ronin/engine/instance_methods.rb +0 -97
- data/lib/ronin/model/cacheable.rb +0 -21
- data/lib/ronin/model/cacheable/cacheable.rb +0 -273
- data/lib/ronin/model/cacheable/class_methods.rb +0 -60
- data/lib/ronin/ui/cli/engine_command.rb +0 -106
- data/spec/engine/classes/buildable_class.rb +0 -15
- data/spec/engine/classes/deployable_class.rb +0 -13
- data/spec/engine/engine_spec.rb +0 -55
- data/spec/engine/verifiable_spec.rb +0 -117
- data/spec/helpers/repos/hello/lib/init.rb +0 -1
- data/spec/helpers/repos/test1/cache/cacheable_model/one.rb +0 -15
- data/spec/helpers/repos/test2/cache/cacheable_model/exceptions.rb +0 -7
- data/spec/helpers/repos/test2/cache/cacheable_model/no_method_errors.rb +0 -9
- data/spec/helpers/repos/test2/cache/cacheable_model/syntax_errors.rb +0 -7
- data/spec/helpers/repos/test2/cache/cacheable_model/two.rb +0 -15
- data/spec/helpers/repos/test2/cache/cacheable_model/validation_errors.rb +0 -9
- data/spec/model/cacheable_spec.rb +0 -96
- data/spec/model/models/cacheable_model.rb +0 -13
@@ -17,24 +17,30 @@
|
|
17
17
|
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
|
18
18
|
#
|
19
19
|
|
20
|
-
require 'ronin/
|
21
|
-
require 'ronin/
|
20
|
+
require 'ronin/script/exceptions/not_built'
|
21
|
+
require 'ronin/script/testable'
|
22
|
+
require 'ronin/ui/output/helpers'
|
22
23
|
|
23
24
|
module Ronin
|
24
|
-
module
|
25
|
+
module Script
|
25
26
|
#
|
26
|
-
# Adds building methods to an {
|
27
|
+
# Adds building methods to an {Script}.
|
28
|
+
#
|
29
|
+
# @since 1.1.0
|
27
30
|
#
|
28
31
|
module Buildable
|
29
|
-
include
|
32
|
+
include Testable,
|
33
|
+
UI::Output::Helpers
|
30
34
|
|
31
35
|
#
|
32
|
-
# Initializes the buildable
|
36
|
+
# Initializes the buildable script.
|
33
37
|
#
|
34
38
|
# @param [Hash] attributes
|
35
|
-
# Additional attributes for the
|
39
|
+
# Additional attributes for the script.
|
40
|
+
#
|
41
|
+
# @since 1.1.0
|
36
42
|
#
|
37
|
-
# @
|
43
|
+
# @api semipublic
|
38
44
|
#
|
39
45
|
def initialize(attributes={})
|
40
46
|
super(attributes)
|
@@ -44,62 +50,68 @@ module Ronin
|
|
44
50
|
end
|
45
51
|
|
46
52
|
#
|
47
|
-
# Determines whether the
|
53
|
+
# Determines whether the script has been built.
|
48
54
|
#
|
49
55
|
# @return [Boolean]
|
50
|
-
# Specifies whether the
|
56
|
+
# Specifies whether the script is built.
|
57
|
+
#
|
58
|
+
# @since 1.1.0
|
51
59
|
#
|
52
|
-
# @
|
60
|
+
# @api semipublic
|
53
61
|
#
|
54
62
|
def built?
|
55
63
|
@built == true
|
56
64
|
end
|
57
65
|
|
58
66
|
#
|
59
|
-
# Builds the
|
67
|
+
# Builds the script.
|
60
68
|
#
|
61
69
|
# @param [Hash] options
|
62
70
|
# Additional options to also use as parameters.
|
63
71
|
#
|
64
72
|
# @yield []
|
65
|
-
# The given block will be called after the
|
73
|
+
# The given block will be called after the script has been built.
|
66
74
|
#
|
67
75
|
# @see #build
|
68
76
|
#
|
69
|
-
# @since 1.
|
77
|
+
# @since 1.1.0
|
78
|
+
#
|
79
|
+
# @api semipublic
|
70
80
|
#
|
71
81
|
def build!(options={})
|
72
82
|
self.params = options
|
73
|
-
print_debug "#{
|
83
|
+
print_debug "#{script_type} #{self} parameters: #{self.params.inspect}"
|
74
84
|
|
75
|
-
print_info "Building #{
|
85
|
+
print_info "Building #{script_type} #{self} ..."
|
76
86
|
|
77
87
|
@built = false
|
78
88
|
@build_blocks.each { |block| block.call() }
|
79
89
|
@built = true
|
80
90
|
|
81
|
-
print_info "#{
|
91
|
+
print_info "#{script_type} #{self} built!"
|
82
92
|
|
83
93
|
yield if block_given?
|
84
94
|
return self
|
85
95
|
end
|
86
96
|
|
87
97
|
#
|
88
|
-
#
|
98
|
+
# Tests that the script has been built and is properly configured.
|
89
99
|
#
|
90
100
|
# @return [true]
|
91
|
-
# The
|
101
|
+
# The script has been tested.
|
92
102
|
#
|
93
103
|
# @raise [NotBuilt]
|
94
|
-
# The
|
104
|
+
# The script has not been built, and cannot be verified.
|
105
|
+
#
|
106
|
+
# @see #test
|
95
107
|
#
|
96
|
-
# @
|
108
|
+
# @since 1.1.0
|
97
109
|
#
|
98
|
-
# @
|
110
|
+
# @api semipublic
|
99
111
|
#
|
100
|
-
def
|
112
|
+
def test!
|
101
113
|
unless built?
|
102
|
-
raise(NotBuilt,"cannot verify an unbuilt #{
|
114
|
+
raise(NotBuilt,"cannot verify an unbuilt #{script_type}")
|
103
115
|
end
|
104
116
|
|
105
117
|
super
|
@@ -108,15 +120,17 @@ module Ronin
|
|
108
120
|
protected
|
109
121
|
|
110
122
|
#
|
111
|
-
# Registers a given block to be called when the
|
123
|
+
# Registers a given block to be called when the script is built.
|
112
124
|
#
|
113
125
|
# @yield []
|
114
|
-
# The given block will be called when the
|
126
|
+
# The given block will be called when the script is being built.
|
127
|
+
#
|
128
|
+
# @return [Script]
|
129
|
+
# The script.
|
115
130
|
#
|
116
|
-
# @
|
117
|
-
# The engine.
|
131
|
+
# @since 1.1.0
|
118
132
|
#
|
119
|
-
# @
|
133
|
+
# @api public
|
120
134
|
#
|
121
135
|
def build(&block)
|
122
136
|
@build_blocks << block
|
@@ -0,0 +1,84 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
|
+
#
|
4
|
+
# This file is part of Ronin.
|
5
|
+
#
|
6
|
+
# Ronin is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Ronin is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Ronin
|
21
|
+
module Script
|
22
|
+
#
|
23
|
+
# @since 1.1.0
|
24
|
+
#
|
25
|
+
module ClassMethods
|
26
|
+
#
|
27
|
+
# Loads the {Script} of the same class.
|
28
|
+
#
|
29
|
+
# @param [String] path
|
30
|
+
# The path to load the script from.
|
31
|
+
#
|
32
|
+
# @return [Script]
|
33
|
+
# The loaded script.
|
34
|
+
#
|
35
|
+
# @example
|
36
|
+
# Exploits::HTTP.load_from('mod_php_exploit.rb')
|
37
|
+
# # => #<Ronin::Exploits::HTTP: ...>
|
38
|
+
#
|
39
|
+
# @since 1.1.0
|
40
|
+
#
|
41
|
+
def load_from(path)
|
42
|
+
load_object(path)
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# Loads all objects with the matching attributes.
|
47
|
+
#
|
48
|
+
# @param [Hash] attributes
|
49
|
+
# Attributes to search for.
|
50
|
+
#
|
51
|
+
# @since 1.1.0
|
52
|
+
#
|
53
|
+
# @api public
|
54
|
+
#
|
55
|
+
def load_all(attributes={})
|
56
|
+
resources = all(attributes)
|
57
|
+
resources.each { |resource| resource.load_script! }
|
58
|
+
|
59
|
+
return resources
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# Loads the first object with matching attributes.
|
64
|
+
#
|
65
|
+
# @param [Hash] attributes
|
66
|
+
# Attributes to search for.
|
67
|
+
#
|
68
|
+
# @return [Cacheable]
|
69
|
+
# The loaded cached objects.
|
70
|
+
#
|
71
|
+
# @since 1.1.0
|
72
|
+
#
|
73
|
+
# @api public
|
74
|
+
#
|
75
|
+
def load_first(attributes={})
|
76
|
+
if (resource = first(attributes))
|
77
|
+
resource.load_script!
|
78
|
+
end
|
79
|
+
|
80
|
+
return resource
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -17,24 +17,30 @@
|
|
17
17
|
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
|
18
18
|
#
|
19
19
|
|
20
|
-
require 'ronin/
|
21
|
-
require 'ronin/
|
20
|
+
require 'ronin/script/exceptions/deploy_failed'
|
21
|
+
require 'ronin/script/testable'
|
22
|
+
require 'ronin/ui/output/helpers'
|
22
23
|
|
23
24
|
module Ronin
|
24
|
-
module
|
25
|
+
module Script
|
25
26
|
#
|
26
|
-
# Adds deployment methods to an {
|
27
|
+
# Adds deployment methods to an {Script}.
|
28
|
+
#
|
29
|
+
# @since 1.1.0
|
27
30
|
#
|
28
31
|
module Deployable
|
29
|
-
include
|
32
|
+
include Testable,
|
33
|
+
UI::Output::Helpers
|
30
34
|
|
31
35
|
#
|
32
|
-
# Initializes the deployable
|
36
|
+
# Initializes the deployable script.
|
33
37
|
#
|
34
38
|
# @param [Hash] attributes
|
35
|
-
# Additional attributes for the
|
39
|
+
# Additional attributes for the script.
|
40
|
+
#
|
41
|
+
# @since 1.1.0
|
36
42
|
#
|
37
|
-
# @
|
43
|
+
# @api semipublic
|
38
44
|
#
|
39
45
|
def initialize(attributes={})
|
40
46
|
super(attributes)
|
@@ -47,84 +53,93 @@ module Ronin
|
|
47
53
|
end
|
48
54
|
|
49
55
|
#
|
50
|
-
# Determines whether the
|
56
|
+
# Determines whether the script was deployed.
|
51
57
|
#
|
52
58
|
# @return [Boolean]
|
53
|
-
# Specifies whether the
|
59
|
+
# Specifies whether the script was previously deployed.
|
60
|
+
#
|
61
|
+
# @since 1.1.0
|
54
62
|
#
|
55
|
-
# @
|
63
|
+
# @api semipublic
|
56
64
|
#
|
57
65
|
def deployed?
|
58
66
|
@deployed == true
|
59
67
|
end
|
60
68
|
|
61
69
|
#
|
62
|
-
#
|
70
|
+
# Tests and then deploys the exploit. If a payload has been set,
|
63
71
|
# the payload will also be deployed.
|
64
72
|
#
|
65
73
|
# @yield []
|
66
|
-
# If a block is given, it will be passed the deployed
|
74
|
+
# If a block is given, it will be passed the deployed script
|
75
|
+
# after a successful deploy.
|
67
76
|
#
|
68
|
-
# @return [
|
69
|
-
# The deployed
|
77
|
+
# @return [Script]
|
78
|
+
# The deployed script.
|
70
79
|
#
|
71
80
|
# @see deploy
|
72
81
|
#
|
73
|
-
# @since 1.
|
82
|
+
# @since 1.1.0
|
83
|
+
#
|
84
|
+
# @api semipublic
|
74
85
|
#
|
75
86
|
def deploy!
|
76
|
-
|
87
|
+
test!
|
77
88
|
|
78
|
-
print_info "Deploying #{
|
89
|
+
print_info "Deploying #{script_type} #{self} ..."
|
79
90
|
|
80
91
|
@deployed = false
|
81
92
|
@deploy_blocks.each { |block| block.call() }
|
82
93
|
@deployed = true
|
83
94
|
@evacuated = false
|
84
95
|
|
85
|
-
print_info "#{
|
96
|
+
print_info "#{script_type} #{self} deployed!"
|
86
97
|
|
87
98
|
yield if block_given?
|
88
99
|
return self
|
89
100
|
end
|
90
101
|
|
91
102
|
#
|
92
|
-
# Determines whether the
|
103
|
+
# Determines whether the script was evacuated.
|
93
104
|
#
|
94
105
|
# @return [Boolean]
|
95
|
-
# Specifies whether the
|
106
|
+
# Specifies whether the script has been evacuated.
|
107
|
+
#
|
108
|
+
# @since 1.1.0
|
96
109
|
#
|
97
|
-
# @
|
110
|
+
# @api semipublic
|
98
111
|
#
|
99
112
|
def evacuated?
|
100
113
|
@evacuated == true
|
101
114
|
end
|
102
115
|
|
103
116
|
#
|
104
|
-
# Evacuates the deployed
|
117
|
+
# Evacuates the deployed script.
|
105
118
|
#
|
106
119
|
# @yield []
|
107
|
-
# If a block is given, it will be called before the
|
120
|
+
# If a block is given, it will be called before the script is
|
108
121
|
# evacuated.
|
109
122
|
#
|
110
|
-
# @return [
|
111
|
-
# The evacuated
|
123
|
+
# @return [Script]
|
124
|
+
# The evacuated script.
|
112
125
|
#
|
113
126
|
# @see #evacuate
|
114
127
|
#
|
115
|
-
# @since 1.
|
128
|
+
# @since 1.1.0
|
129
|
+
#
|
130
|
+
# @api semipublic
|
116
131
|
#
|
117
132
|
def evacuate!
|
118
133
|
yield if block_given?
|
119
134
|
|
120
|
-
print_info "Evauating #{
|
135
|
+
print_info "Evauating #{script_type} #{self} ..."
|
121
136
|
|
122
137
|
@evacuated = false
|
123
138
|
@evacuate_blocks.each { |block| block.call() }
|
124
139
|
@evacuated = true
|
125
140
|
@deployed = false
|
126
141
|
|
127
|
-
print_info "#{
|
142
|
+
print_info "#{script_type} #{self} evacuated."
|
128
143
|
return self
|
129
144
|
end
|
130
145
|
|
@@ -136,24 +151,28 @@ module Ronin
|
|
136
151
|
# @raise [DeployFailed]
|
137
152
|
# The deployment of the exploit failed.
|
138
153
|
#
|
139
|
-
# @since 1.
|
154
|
+
# @since 1.1.0
|
155
|
+
#
|
156
|
+
# @api public
|
140
157
|
#
|
141
158
|
def deploy_failed!(message)
|
142
159
|
raise(DeployFailed,message)
|
143
160
|
end
|
144
161
|
|
145
162
|
#
|
146
|
-
# Registers a given block to be called when the
|
163
|
+
# Registers a given block to be called when the script is being
|
147
164
|
# deployed.
|
148
165
|
#
|
149
166
|
# @yield []
|
150
|
-
# The given block will be called when the
|
167
|
+
# The given block will be called when the script is being
|
151
168
|
# deployed.
|
152
169
|
#
|
153
|
-
# @return [
|
154
|
-
# The
|
170
|
+
# @return [Script]
|
171
|
+
# The script.
|
155
172
|
#
|
156
|
-
# @since 1.
|
173
|
+
# @since 1.1.0
|
174
|
+
#
|
175
|
+
# @api public
|
157
176
|
#
|
158
177
|
def deploy(&block)
|
159
178
|
@deploy_blocks << block
|
@@ -161,17 +180,19 @@ module Ronin
|
|
161
180
|
end
|
162
181
|
|
163
182
|
#
|
164
|
-
# Registers a given block to be called when the
|
183
|
+
# Registers a given block to be called when the script is being
|
165
184
|
# evacuated.
|
166
185
|
#
|
167
186
|
# @yield []
|
168
|
-
# The given block will be called when the
|
187
|
+
# The given block will be called when the script is being
|
169
188
|
# evacuated.
|
170
189
|
#
|
171
|
-
# @return [
|
172
|
-
# The
|
190
|
+
# @return [Script]
|
191
|
+
# The script.
|
192
|
+
#
|
193
|
+
# @since 1.1.0
|
173
194
|
#
|
174
|
-
# @
|
195
|
+
# @api public
|
175
196
|
#
|
176
197
|
def evacuate(&block)
|
177
198
|
@evacuate_blocks.unshift(block)
|