ronin 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +95 -0
- data/Manifest.txt +55 -25
- data/README.txt +64 -52
- data/Rakefile +21 -14
- data/bin/ronin +1 -1
- data/bin/ronin-add +1 -1
- data/bin/ronin-console +1 -1
- data/bin/ronin-help +1 -1
- data/bin/ronin-install +1 -1
- data/bin/ronin-list +1 -1
- data/bin/ronin-remove +1 -1
- data/bin/ronin-uninstall +1 -1
- data/bin/ronin-update +1 -1
- data/lib/ronin.rb +2 -4
- data/lib/ronin/arch.rb +66 -21
- data/lib/ronin/author.rb +27 -18
- data/lib/ronin/cacheable.rb +63 -23
- data/lib/ronin/code/emittable.rb +1 -4
- data/lib/ronin/code/reference.rb +2 -5
- data/lib/ronin/code/symbol_table.rb +1 -4
- data/lib/ronin/code/token.rb +1 -4
- data/lib/ronin/config.rb +31 -10
- data/lib/ronin/database.rb +1 -4
- data/lib/ronin/database/database.rb +42 -23
- data/lib/ronin/database/exceptions.rb +1 -4
- data/lib/ronin/database/exceptions/invalid_config.rb +1 -4
- data/lib/ronin/environment.rb +1 -5
- data/lib/ronin/extensions.rb +1 -5
- data/lib/ronin/extensions/array.rb +8 -6
- data/lib/ronin/extensions/file.rb +9 -4
- data/lib/ronin/extensions/ip_addr.rb +33 -13
- data/lib/ronin/extensions/kernel.rb +44 -9
- data/lib/ronin/extensions/meta.rb +1 -4
- data/lib/ronin/extensions/string.rb +8 -7
- data/lib/ronin/extensions/uri.rb +1 -4
- data/lib/ronin/extensions/uri/http.rb +1 -48
- data/lib/ronin/extensions/uri/query_params.rb +27 -8
- data/lib/ronin/formatting.rb +1 -4
- data/lib/ronin/formatting/binary.rb +1 -4
- data/lib/ronin/formatting/digest.rb +1 -4
- data/lib/ronin/formatting/extensions.rb +1 -4
- data/lib/ronin/formatting/extensions/binary.rb +1 -4
- data/lib/ronin/formatting/extensions/binary/file.rb +3 -28
- data/lib/ronin/formatting/extensions/binary/integer.rb +31 -12
- data/lib/ronin/formatting/extensions/binary/string.rb +59 -36
- data/lib/ronin/formatting/extensions/digest.rb +1 -4
- data/lib/ronin/formatting/extensions/digest/string.rb +31 -9
- data/lib/ronin/formatting/extensions/http.rb +1 -4
- data/lib/ronin/formatting/extensions/http/string.rb +16 -9
- data/lib/ronin/formatting/extensions/text.rb +1 -4
- data/lib/ronin/formatting/extensions/text/array.rb +17 -7
- data/lib/ronin/formatting/extensions/text/string.rb +70 -27
- data/lib/ronin/formatting/http.rb +1 -4
- data/lib/ronin/formatting/text.rb +1 -4
- data/lib/ronin/license.rb +72 -65
- data/lib/ronin/model.rb +1 -4
- data/lib/ronin/model/has_description.rb +37 -8
- data/lib/ronin/model/has_license.rb +12 -8
- data/lib/ronin/model/has_name.rb +10 -7
- data/lib/ronin/model/has_version.rb +14 -4
- data/lib/ronin/model/model.rb +71 -14
- data/lib/ronin/network.rb +1 -4
- data/lib/ronin/network/esmtp.rb +1 -4
- data/lib/ronin/network/extensions.rb +1 -4
- data/lib/ronin/network/extensions/esmtp.rb +1 -4
- data/lib/ronin/network/extensions/esmtp/net.rb +49 -21
- data/lib/ronin/network/extensions/http.rb +1 -4
- data/lib/ronin/network/extensions/http/net.rb +319 -531
- data/lib/ronin/network/extensions/imap.rb +1 -4
- data/lib/ronin/network/extensions/imap/net.rb +50 -23
- data/lib/ronin/network/extensions/pop3.rb +1 -4
- data/lib/ronin/network/extensions/pop3/net.rb +40 -17
- data/lib/ronin/network/extensions/smtp.rb +1 -4
- data/lib/ronin/network/extensions/smtp/net.rb +49 -21
- data/lib/ronin/network/extensions/tcp.rb +1 -4
- data/lib/ronin/network/extensions/tcp/net.rb +234 -31
- data/lib/ronin/network/extensions/telnet.rb +1 -4
- data/lib/ronin/network/extensions/telnet/net.rb +83 -51
- data/lib/ronin/network/extensions/udp.rb +1 -4
- data/lib/ronin/network/extensions/udp/net.rb +164 -27
- data/lib/ronin/{sessions.rb → network/helpers.rb} +10 -13
- data/lib/ronin/network/helpers/esmtp.rb +129 -0
- data/lib/ronin/{sessions/session.rb → network/helpers/helper.rb} +25 -17
- data/lib/ronin/network/helpers/http.rb +444 -0
- data/lib/ronin/network/helpers/imap.rb +115 -0
- data/lib/ronin/network/helpers/pop3.rb +110 -0
- data/lib/ronin/network/helpers/smtp.rb +123 -0
- data/lib/ronin/network/helpers/tcp.rb +309 -0
- data/lib/ronin/network/helpers/telnet.rb +158 -0
- data/lib/ronin/network/helpers/udp.rb +197 -0
- data/lib/ronin/network/http.rb +3 -156
- data/lib/ronin/network/http/exceptions.rb +1 -4
- data/lib/ronin/network/http/exceptions/unknown_request.rb +1 -4
- data/lib/ronin/network/http/http.rb +214 -0
- data/lib/ronin/network/http/proxy.rb +308 -0
- data/lib/ronin/network/imap.rb +7 -6
- data/lib/ronin/network/pop3.rb +7 -6
- data/lib/ronin/network/smtp.rb +1 -4
- data/lib/ronin/network/smtp/email.rb +34 -18
- data/lib/ronin/network/smtp/smtp.rb +19 -7
- data/lib/ronin/network/tcp.rb +1 -4
- data/lib/ronin/network/telnet.rb +25 -12
- data/lib/ronin/network/udp.rb +1 -4
- data/lib/ronin/os.rb +43 -21
- data/lib/ronin/path.rb +29 -9
- data/lib/ronin/platform.rb +1 -4
- data/lib/ronin/platform/exceptions.rb +1 -4
- data/lib/ronin/platform/exceptions/extension_not_found.rb +1 -4
- data/lib/ronin/platform/exceptions/overlay_cached.rb +1 -4
- data/lib/ronin/platform/exceptions/overlay_not_found.rb +1 -4
- data/lib/ronin/platform/extension.rb +195 -52
- data/lib/ronin/platform/extension_cache.rb +60 -24
- data/lib/ronin/platform/maintainer.rb +15 -8
- data/lib/ronin/platform/object_cache.rb +29 -8
- data/lib/ronin/platform/overlay.rb +82 -26
- data/lib/ronin/platform/overlay_cache.rb +179 -56
- data/lib/ronin/platform/platform.rb +154 -58
- data/lib/ronin/platform/ronin.rb +38 -11
- data/lib/ronin/product.rb +17 -17
- data/lib/ronin/rpc.rb +1 -4
- data/lib/ronin/rpc/call.rb +1 -4
- data/lib/ronin/rpc/client.rb +1 -4
- data/lib/ronin/rpc/console.rb +1 -4
- data/lib/ronin/rpc/exceptions.rb +1 -4
- data/lib/ronin/rpc/exceptions/not_implemented.rb +1 -4
- data/lib/ronin/rpc/exceptions/response_missing.rb +1 -4
- data/lib/ronin/rpc/response.rb +1 -4
- data/lib/ronin/rpc/service.rb +1 -4
- data/lib/ronin/rpc/shell.rb +1 -4
- data/lib/ronin/scanners.rb +1 -4
- data/lib/ronin/scanners/exceptions.rb +1 -4
- data/lib/ronin/scanners/exceptions/unknown_category.rb +1 -4
- data/lib/ronin/scanners/scanner.rb +82 -26
- data/lib/ronin/static.rb +1 -4
- data/lib/ronin/static/finders.rb +1 -4
- data/lib/ronin/static/static.rb +16 -7
- data/lib/ronin/templates.rb +2 -4
- data/lib/ronin/templates/erb.rb +24 -10
- data/lib/ronin/templates/template.rb +130 -0
- data/lib/ronin/ui.rb +2 -6
- data/lib/ronin/ui/command_line.rb +1 -4
- data/lib/ronin/ui/command_line/command.rb +137 -68
- data/lib/ronin/ui/command_line/command_line.rb +52 -29
- data/lib/ronin/ui/command_line/commands/add.rb +39 -67
- data/lib/ronin/ui/command_line/commands/console.rb +23 -27
- data/lib/ronin/ui/command_line/commands/help.rb +10 -29
- data/lib/ronin/ui/command_line/commands/install.rb +31 -56
- data/lib/ronin/ui/command_line/commands/list.rb +34 -52
- data/lib/ronin/ui/command_line/commands/remove.rb +12 -32
- data/lib/ronin/ui/command_line/commands/uninstall.rb +11 -31
- data/lib/ronin/ui/command_line/commands/update.rb +15 -35
- data/lib/ronin/ui/command_line/exceptions.rb +1 -4
- data/lib/ronin/ui/command_line/exceptions/unknown_command.rb +1 -4
- data/lib/ronin/ui/console.rb +54 -23
- data/lib/ronin/ui/hexdump.rb +1 -4
- data/lib/ronin/ui/hexdump/extensions.rb +1 -4
- data/lib/ronin/ui/hexdump/extensions/file.rb +8 -6
- data/lib/ronin/ui/hexdump/extensions/kernel.rb +4 -5
- data/lib/ronin/ui/hexdump/hexdump.rb +8 -5
- data/lib/ronin/{sessions/exceptions.rb → ui/output.rb} +3 -5
- data/lib/ronin/ui/output/handler.rb +121 -0
- data/lib/ronin/ui/output/helpers.rb +110 -0
- data/lib/ronin/ui/output/output.rb +144 -0
- data/lib/ronin/ui/shell.rb +38 -12
- data/lib/ronin/version.rb +2 -5
- data/lib/ronin/{sessions/exceptions/variable_missing.rb → yard.rb} +2 -10
- data/lib/ronin/{ronin.rb → yard/handlers.rb} +5 -15
- data/lib/ronin/yard/handlers/ruby.rb +27 -0
- data/lib/ronin/yard/handlers/ruby/base.rb +27 -0
- data/lib/ronin/yard/handlers/ruby/belongs_to_handler.rb +45 -0
- data/lib/ronin/yard/handlers/ruby/eval_block_handler.rb +18 -0
- data/lib/ronin/yard/handlers/ruby/has_handler.rb +49 -0
- data/lib/ronin/yard/handlers/ruby/legacy.rb +26 -0
- data/lib/ronin/yard/handlers/ruby/legacy/belongs_to_handler.rb +41 -0
- data/lib/ronin/yard/handlers/ruby/legacy/eval_block_handler.rb +19 -0
- data/lib/ronin/yard/handlers/ruby/legacy/has_handler.rb +34 -0
- data/lib/ronin/yard/handlers/ruby/legacy/metaclass_eval_handler.rb +21 -0
- data/lib/ronin/yard/handlers/ruby/legacy/property_handler.rb +41 -0
- data/lib/ronin/yard/handlers/ruby/legacy/scanner_handler.rb +61 -0
- data/lib/ronin/yard/handlers/ruby/metaclass_eval_handler.rb +18 -0
- data/lib/ronin/yard/handlers/ruby/property_handler.rb +45 -0
- data/lib/ronin/yard/handlers/ruby/scanner_handler.rb +66 -0
- data/spec/author_spec.rb +3 -3
- data/spec/extensions/classes/some_class.rb +2 -0
- data/spec/extensions/kernel_spec.rb +17 -0
- data/spec/extensions/uri/http_spec.rb +0 -31
- data/spec/formatting/binary/integer_spec.rb +4 -0
- data/spec/formatting/text/string_spec.rb +96 -0
- data/spec/license_spec.rb +6 -6
- data/spec/model/classes/basic_model.rb +13 -0
- data/spec/model/classes/custom_model.rb +17 -0
- data/spec/model/classes/described_model.rb +10 -0
- data/spec/model/has_description_spec.rb +42 -0
- data/spec/model/has_license_spec.rb +18 -4
- data/spec/model/model_spec.rb +68 -0
- data/spec/network/helpers/classes/test_helper.rb +11 -0
- data/spec/network/helpers/classes/uses_test_helper.rb +10 -0
- data/spec/network/helpers/helper_spec.rb +25 -0
- data/spec/network/{http_spec.rb → http/http_spec.rb} +0 -0
- data/spec/network/http/proxy_spec.rb +116 -0
- data/spec/os_spec.rb +4 -4
- data/spec/platform/extension_cache_spec.rb +14 -0
- data/spec/platform/extension_spec.rb +11 -0
- data/spec/platform/platform_spec.rb +8 -0
- data/spec/product_spec.rb +9 -9
- data/spec/spec_helper.rb +1 -1
- data/spec/templates/classes/{uses_erb.rb → example_erb.rb} +1 -1
- data/spec/templates/classes/example_template.rb +21 -0
- data/spec/templates/erb_spec.rb +2 -2
- data/spec/templates/helpers/static.rb +5 -0
- data/spec/templates/helpers/static/templates/_relative.erb +1 -0
- data/spec/templates/helpers/static/templates/example.erb +1 -0
- data/spec/templates/template_spec.rb +41 -0
- data/spec/ui/command_line/classes/test_command.rb +23 -0
- data/spec/ui/command_line/command_spec.rb +31 -0
- data/spec/ui/output_spec.rb +29 -0
- data/static/ronin/platform/overlay.xsl +135 -114
- data/tasks/spec.rb +1 -0
- data/tasks/yard.rb +18 -0
- metadata +98 -59
- metadata.gz.sig +0 -0
- data/TODO.txt +0 -15
- data/lib/ronin/extensions/hash.rb +0 -62
- data/lib/ronin/sessions/esmtp.rb +0 -57
- data/lib/ronin/sessions/http.rb +0 -678
- data/lib/ronin/sessions/imap.rb +0 -54
- data/lib/ronin/sessions/pop3.rb +0 -52
- data/lib/ronin/sessions/smtp.rb +0 -57
- data/lib/ronin/sessions/tcp.rb +0 -100
- data/lib/ronin/sessions/telnet.rb +0 -55
- data/lib/ronin/sessions/udp.rb +0 -73
- data/lib/ronin/ui/command_line/options.rb +0 -136
- data/lib/ronin/ui/diagnostics.rb +0 -66
- data/lib/ronin/ui/verbose.rb +0 -58
- data/spec/extensions/hash_spec.rb +0 -38
- data/spec/sessions/classes/test_session.rb +0 -11
- data/spec/sessions/classes/uses_test_session.rb +0 -10
- data/spec/sessions/session_spec.rb +0 -25
- data/spec/ui/verbose_spec.rb +0 -17
@@ -1,7 +1,5 @@
|
|
1
1
|
#
|
2
|
-
|
3
|
-
# Ronin - A Ruby platform designed for information security and data
|
4
|
-
# exploration tasks.
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
5
3
|
#
|
6
4
|
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
5
|
#
|
@@ -18,11 +16,11 @@
|
|
18
16
|
# You should have received a copy of the GNU General Public License
|
19
17
|
# along with this program; if not, write to the Free Software
|
20
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
-
#++
|
22
19
|
#
|
23
20
|
|
24
21
|
require 'ronin/ui/command_line/command'
|
25
|
-
require 'ronin/
|
22
|
+
require 'ronin/ui/output'
|
23
|
+
require 'ronin/platform'
|
26
24
|
|
27
25
|
module Ronin
|
28
26
|
module UI
|
@@ -30,83 +28,67 @@ module Ronin
|
|
30
28
|
module Commands
|
31
29
|
class List < Command
|
32
30
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
def define_options(opts)
|
39
|
-
opts.usage = '[NAME ...] [options]'
|
40
|
-
|
41
|
-
opts.options do
|
42
|
-
opts.on('-C','--cache DIR','Specify an alternate overlay cache') do |dir|
|
43
|
-
@cache = dir
|
44
|
-
end
|
31
|
+
desc "list [NAME]", "List all Overlays or a specific one"
|
32
|
+
method_option :cache, :type => :string, :aliases => '-C'
|
33
|
+
method_option :verbose, :type => :boolean, :aliaes => '-v'
|
45
34
|
|
46
|
-
|
47
|
-
|
48
|
-
|
35
|
+
def default(name=nil)
|
36
|
+
if options[:cache]
|
37
|
+
Platform.load_overlays(options[:cache])
|
49
38
|
end
|
50
39
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
cache
|
58
|
-
}
|
59
|
-
end
|
60
|
-
|
61
|
-
def arguments(*args)
|
62
|
-
Platform.load_overlays(@cache) if @cache
|
63
|
-
|
64
|
-
if args.empty?
|
65
|
-
# list all overlays by name
|
66
|
-
Platform.overlays.each_overlay do |overlay|
|
67
|
-
puts " #{overlay}"
|
40
|
+
unless name
|
41
|
+
indent do
|
42
|
+
# list all overlays by name
|
43
|
+
Platform.overlays.each_overlay do |overlay|
|
44
|
+
puts overlay
|
45
|
+
end
|
68
46
|
end
|
69
47
|
|
70
48
|
return
|
71
49
|
end
|
72
50
|
|
73
|
-
|
74
|
-
|
51
|
+
begin
|
52
|
+
# list a specific overlay
|
75
53
|
overlay = Platform.overlays.get(name)
|
54
|
+
rescue Platform::OverlayNotFound => e
|
55
|
+
print_error e.message
|
56
|
+
exit -1
|
57
|
+
end
|
76
58
|
|
77
|
-
|
59
|
+
print_title overlay.name
|
78
60
|
|
79
|
-
|
80
|
-
puts "
|
81
|
-
puts "
|
61
|
+
indent do
|
62
|
+
puts "Path: #{overlay.path}"
|
63
|
+
puts "Media: #{overlay.media}" if overlay.media
|
64
|
+
puts "URI: #{overlay.uri}" if overlay.uri
|
82
65
|
|
83
|
-
if
|
66
|
+
if UI::Output.verbose?
|
84
67
|
putc "\n"
|
85
68
|
|
86
69
|
if overlay.title
|
87
|
-
puts "
|
70
|
+
puts "Title: #{overlay.title}"
|
88
71
|
end
|
89
72
|
|
90
73
|
if overlay.source
|
91
|
-
puts "
|
74
|
+
puts "Source URI: #{overlay.source}"
|
92
75
|
end
|
93
76
|
|
94
77
|
if overlay.source_view
|
95
|
-
puts "
|
78
|
+
puts "Source View: #{overlay.source_view}"
|
96
79
|
end
|
97
80
|
|
98
81
|
if overlay.website
|
99
|
-
puts "
|
82
|
+
puts "Website: #{overlay.website}"
|
100
83
|
end
|
101
84
|
|
102
85
|
unless overlay.extensions.empty?
|
103
|
-
|
104
|
-
overlay.extensions.each { |ext| puts " #{ext}" }
|
105
|
-
putc "\n"
|
86
|
+
print_array(overlay.extensions, :title => 'Extensions')
|
106
87
|
end
|
107
88
|
|
108
89
|
if overlay.description
|
109
|
-
puts "
|
90
|
+
puts "Description:\n\n"
|
91
|
+
indent { puts "#{overlay.description}\n\n" }
|
110
92
|
else
|
111
93
|
putc "\n"
|
112
94
|
end
|
@@ -1,7 +1,5 @@
|
|
1
1
|
#
|
2
|
-
|
3
|
-
# Ronin - A Ruby platform designed for information security and data
|
4
|
-
# exploration tasks.
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
5
3
|
#
|
6
4
|
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
5
|
#
|
@@ -18,11 +16,10 @@
|
|
18
16
|
# You should have received a copy of the GNU General Public License
|
19
17
|
# along with this program; if not, write to the Free Software
|
20
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
-
#++
|
22
19
|
#
|
23
20
|
|
24
21
|
require 'ronin/ui/command_line/command'
|
25
|
-
require 'ronin/platform
|
22
|
+
require 'ronin/platform'
|
26
23
|
|
27
24
|
module Ronin
|
28
25
|
module UI
|
@@ -30,38 +27,21 @@ module Ronin
|
|
30
27
|
module Commands
|
31
28
|
class Remove < Command
|
32
29
|
|
33
|
-
|
34
|
-
|
35
|
-
@verbose = false
|
36
|
-
end
|
37
|
-
|
38
|
-
def define_options(opts)
|
39
|
-
opts.usage = 'NAME [...] [options]'
|
30
|
+
desc "remove NAME", "Remove the specified Overlay"
|
31
|
+
method_option :cache, :type => :string, :aliases => '-C'
|
40
32
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
opts.on('-v','--verbose','Enable verbose output') do
|
47
|
-
@verbose = true
|
48
|
-
end
|
33
|
+
def default(name)
|
34
|
+
if options[:cache]
|
35
|
+
Platform.load_overlays(options[:cache])
|
49
36
|
end
|
50
37
|
|
51
|
-
|
52
|
-
'NAME' => 'The overlay to remove'
|
53
|
-
)
|
54
|
-
|
55
|
-
opts.summary('Remove the specified repositories')
|
56
|
-
end
|
57
|
-
|
58
|
-
def arguments(*args)
|
59
|
-
Platform.load_overlays(@cache) if @cache
|
60
|
-
|
61
|
-
args.each do |name|
|
38
|
+
begin
|
62
39
|
Platform.remove(name) do |overlay|
|
63
|
-
|
40
|
+
print_info "Removing Overlay #{overlay.name.dump} ..."
|
64
41
|
end
|
42
|
+
rescue Platform::OverlayNotFound => e
|
43
|
+
print_error e.message
|
44
|
+
exit -1
|
65
45
|
end
|
66
46
|
end
|
67
47
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
#
|
2
|
-
|
3
|
-
# Ronin - A Ruby platform designed for information security and data
|
4
|
-
# exploration tasks.
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
5
3
|
#
|
6
4
|
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
5
|
#
|
@@ -18,7 +16,6 @@
|
|
18
16
|
# You should have received a copy of the GNU General Public License
|
19
17
|
# along with this program; if not, write to the Free Software
|
20
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
-
#++
|
22
19
|
#
|
23
20
|
|
24
21
|
require 'ronin/ui/command_line/command'
|
@@ -30,38 +27,21 @@ module Ronin
|
|
30
27
|
module Commands
|
31
28
|
class Uninstall < Command
|
32
29
|
|
33
|
-
|
34
|
-
|
35
|
-
@verbose = false
|
36
|
-
end
|
37
|
-
|
38
|
-
def define_options(opts)
|
39
|
-
opts.usage = 'NAME [NAME ...] [options]'
|
30
|
+
desc "uninstall NAME", "Uninstall the specified Overlay"
|
31
|
+
method_option :cache, :type => :string, :aliases => '-C'
|
40
32
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
opts.on('-v','--verbose','Enable verbose output') do
|
47
|
-
@verbose = true
|
48
|
-
end
|
33
|
+
def default(name)
|
34
|
+
if options[:cache]
|
35
|
+
Platform.load_overlays(options[:cache])
|
49
36
|
end
|
50
37
|
|
51
|
-
|
52
|
-
'NAME' => 'The overlay to uninstall'
|
53
|
-
)
|
54
|
-
|
55
|
-
opts.summary('Uninstall the specified repositories')
|
56
|
-
end
|
57
|
-
|
58
|
-
def arguments(*args)
|
59
|
-
Platform.load_overlays(@cache) if @cache
|
60
|
-
|
61
|
-
args.each do |name|
|
38
|
+
begin
|
62
39
|
Platform.uninstall(name) do
|
63
|
-
|
40
|
+
print_info "Uninstalling Overlay #{name.dump} ..."
|
64
41
|
end
|
42
|
+
rescue Platform::OverlayNotFound => e
|
43
|
+
print_error e.message
|
44
|
+
exit -1
|
65
45
|
end
|
66
46
|
end
|
67
47
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
#
|
2
|
-
|
3
|
-
# Ronin - A Ruby platform designed for information security and data
|
4
|
-
# exploration tasks.
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
5
3
|
#
|
6
4
|
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
5
|
#
|
@@ -18,7 +16,6 @@
|
|
18
16
|
# You should have received a copy of the GNU General Public License
|
19
17
|
# along with this program; if not, write to the Free Software
|
20
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
-
#++
|
22
19
|
#
|
23
20
|
|
24
21
|
require 'ronin/ui/command_line/command'
|
@@ -30,45 +27,28 @@ module Ronin
|
|
30
27
|
module Commands
|
31
28
|
class Update < Command
|
32
29
|
|
33
|
-
|
34
|
-
|
35
|
-
@verbose = false
|
36
|
-
end
|
37
|
-
|
38
|
-
def define_options(opts)
|
39
|
-
opts.usage = '[NAME ...] [options]'
|
40
|
-
|
41
|
-
opts.options do
|
42
|
-
opts.on('-C','--cache DIR','Specify an alternate overlay cache') do |dir|
|
43
|
-
@cache = dir
|
44
|
-
end
|
30
|
+
desc "update [NAME]", "Update all Overlays or just a specified Overlay"
|
31
|
+
method_option :cache, :type => :string, :aliases => '-C'
|
45
32
|
|
46
|
-
|
47
|
-
|
48
|
-
|
33
|
+
def default(name=nil)
|
34
|
+
if options[:cache]
|
35
|
+
Platform.load_overlays(options[:cache])
|
49
36
|
end
|
50
37
|
|
51
|
-
opts.arguments(
|
52
|
-
'NAME' => 'The overlay to update'
|
53
|
-
)
|
54
|
-
|
55
|
-
opts.summary('Updates all or the specified repositories')
|
56
|
-
end
|
57
|
-
|
58
|
-
def arguments(*args)
|
59
|
-
Platform.load_overlays(@cache) if @cache
|
60
|
-
|
61
38
|
update = lambda { |overlay|
|
62
|
-
|
39
|
+
print_info "Updating Overlay #{overlay.name.dump} ..."
|
63
40
|
overlay.update
|
64
41
|
}
|
65
42
|
|
66
|
-
if
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
43
|
+
if name
|
44
|
+
begin
|
45
|
+
update.call(Platform.overlays.get(name))
|
46
|
+
rescue Platform::OverlayNotFound => e
|
47
|
+
print_error e.message
|
48
|
+
exit -1
|
71
49
|
end
|
50
|
+
else
|
51
|
+
Platform.overlays.each_overlay(&update)
|
72
52
|
end
|
73
53
|
end
|
74
54
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
#
|
2
|
-
|
3
|
-
# Ronin - A Ruby platform designed for information security and data
|
4
|
-
# exploration tasks.
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
5
3
|
#
|
6
4
|
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
5
|
#
|
@@ -18,7 +16,6 @@
|
|
18
16
|
# You should have received a copy of the GNU General Public License
|
19
17
|
# along with this program; if not, write to the Free Software
|
20
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
-
#++
|
22
19
|
#
|
23
20
|
|
24
21
|
require 'ronin/ui/command_line/exceptions/unknown_command'
|
@@ -1,7 +1,5 @@
|
|
1
1
|
#
|
2
|
-
|
3
|
-
# Ronin - A Ruby platform designed for information security and data
|
4
|
-
# exploration tasks.
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
5
3
|
#
|
6
4
|
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
5
|
#
|
@@ -18,7 +16,6 @@
|
|
18
16
|
# You should have received a copy of the GNU General Public License
|
19
17
|
# along with this program; if not, write to the Free Software
|
20
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
-
#++
|
22
19
|
#
|
23
20
|
|
24
21
|
module Ronin
|
data/lib/ronin/ui/console.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
#
|
2
|
-
|
3
|
-
# Ronin - A Ruby platform designed for information security and data
|
4
|
-
# exploration tasks.
|
2
|
+
# Ronin - A Ruby platform for exploit development and security research.
|
5
3
|
#
|
6
4
|
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
5
|
#
|
@@ -18,7 +16,6 @@
|
|
18
16
|
# You should have received a copy of the GNU General Public License
|
19
17
|
# along with this program; if not, write to the Free Software
|
20
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
-
#++
|
22
19
|
#
|
23
20
|
|
24
21
|
require 'ronin/config'
|
@@ -41,29 +38,38 @@ module Ronin
|
|
41
38
|
COMPLETION = true
|
42
39
|
|
43
40
|
#
|
44
|
-
#
|
41
|
+
# @return [String]
|
42
|
+
# The default Console prompt style.
|
45
43
|
#
|
46
44
|
def Console.prompt
|
47
45
|
@@ronin_console_prompt ||= PROMPT
|
48
46
|
end
|
49
47
|
|
50
48
|
#
|
51
|
-
# Sets the default Console prompt style
|
49
|
+
# Sets the default Console prompt style.
|
50
|
+
#
|
51
|
+
# @param [String] style
|
52
|
+
# The new Console prompt style to use.
|
52
53
|
#
|
53
54
|
def Console.prompt=(style)
|
54
55
|
@@ronin_console_prompt = style
|
55
56
|
end
|
56
57
|
|
57
58
|
#
|
58
|
-
#
|
59
|
+
# @return [Boolean]
|
60
|
+
# The default Console indent setting.
|
59
61
|
#
|
60
62
|
def Console.indent
|
61
63
|
@@ronin_console_indent ||= INDENT
|
62
64
|
end
|
63
65
|
|
64
66
|
#
|
65
|
-
# Sets the default Console indent setting
|
67
|
+
# Sets the default Console indent setting.
|
68
|
+
#
|
69
|
+
# @param [Boolean] mode
|
70
|
+
# The new default Console indent setting.
|
66
71
|
#
|
72
|
+
# @example
|
67
73
|
# Console.indent = false
|
68
74
|
# # => false
|
69
75
|
#
|
@@ -72,32 +78,38 @@ module Ronin
|
|
72
78
|
end
|
73
79
|
|
74
80
|
#
|
75
|
-
#
|
76
|
-
#
|
81
|
+
# @return [Integer]
|
82
|
+
# The default Console back-trace depth.
|
77
83
|
#
|
78
84
|
def Console.backtrace_depth
|
79
85
|
@@ronin_console_backtrace_depth ||= BACKTRACE_DEPTH
|
80
86
|
end
|
81
87
|
|
82
88
|
#
|
83
|
-
# Sets the default Console back
|
89
|
+
# Sets the default Console back-trace depth.
|
90
|
+
#
|
91
|
+
# @param [Integer] depth
|
92
|
+
# The new default Console back-trace depth.
|
84
93
|
#
|
85
94
|
def Console.backtrace_depth=(depth)
|
86
95
|
@@ronin_console_backtrace_depth = depth
|
87
96
|
end
|
88
97
|
|
89
98
|
#
|
90
|
-
#
|
91
|
-
#
|
99
|
+
# @return [Boolean]
|
100
|
+
# The default Console tab-completion setting.
|
92
101
|
#
|
93
102
|
def Console.completion
|
94
103
|
@@ronin_console_completion ||= COMPLETION
|
95
104
|
end
|
96
105
|
|
97
106
|
#
|
98
|
-
# Sets the default Console tab-completion
|
99
|
-
# _mode_.
|
107
|
+
# Sets the default Console tab-completion setting.
|
100
108
|
#
|
109
|
+
# @param [Boolean] mode
|
110
|
+
# The new default Console tab-completion setting.
|
111
|
+
#
|
112
|
+
# @example
|
101
113
|
# Console.completion = false
|
102
114
|
# # => false
|
103
115
|
#
|
@@ -106,23 +118,38 @@ module Ronin
|
|
106
118
|
end
|
107
119
|
|
108
120
|
#
|
109
|
-
#
|
121
|
+
# @return [Array]
|
122
|
+
# The files to require when the Console starts.
|
110
123
|
#
|
111
124
|
def Console.auto_load
|
112
125
|
@@ronin_console_auto_load ||= []
|
113
126
|
end
|
114
127
|
|
115
128
|
#
|
116
|
-
#
|
129
|
+
# Adds a block to be ran from within the Console after it is
|
117
130
|
# started.
|
118
131
|
#
|
132
|
+
# @yield []
|
133
|
+
# The block to be ran from within the Console.
|
134
|
+
#
|
119
135
|
def Console.setup(&block)
|
120
136
|
Console.setup_blocks << block if block
|
121
137
|
end
|
122
138
|
|
123
139
|
#
|
124
|
-
# Starts a Console
|
125
|
-
#
|
140
|
+
# Starts a Console.
|
141
|
+
#
|
142
|
+
# @param [String] script
|
143
|
+
# The path to a script to run within the Console.
|
144
|
+
#
|
145
|
+
# @yield []
|
146
|
+
# The block to be ran within the Console, after it has been setup.
|
147
|
+
#
|
148
|
+
# @example
|
149
|
+
# Console.start
|
150
|
+
#
|
151
|
+
# @example
|
152
|
+
# console.start { @var = 'hello' }
|
126
153
|
#
|
127
154
|
def Console.start(script=nil,&block)
|
128
155
|
IRB.setup(script)
|
@@ -137,9 +164,13 @@ module Ronin
|
|
137
164
|
|
138
165
|
# configure the IRB context
|
139
166
|
irb.context.main.instance_eval do
|
140
|
-
require 'ronin
|
141
|
-
require 'ronin/
|
167
|
+
require 'ronin'
|
168
|
+
require 'ronin/ui/output'
|
169
|
+
|
170
|
+
# include the output helpers
|
171
|
+
include Ronin::UI::Output::Helpers
|
142
172
|
|
173
|
+
# setup irb completion
|
143
174
|
require 'irb/completion' if Ronin::UI::Console.completion
|
144
175
|
|
145
176
|
# require any of the auto-load paths
|
@@ -170,8 +201,8 @@ module Ronin
|
|
170
201
|
protected
|
171
202
|
|
172
203
|
#
|
173
|
-
#
|
174
|
-
# is started.
|
204
|
+
# @return [Array]
|
205
|
+
# The blocks to be ran from within the Console after it is started.
|
175
206
|
#
|
176
207
|
def Console.setup_blocks
|
177
208
|
@@console_setup_blocks ||= []
|