ronin 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +58 -25
- data/Manifest.txt +15 -16
- data/README.txt +16 -11
- data/Rakefile +9 -7
- data/TODO.txt +6 -1
- data/lib/ronin.rb +1 -1
- data/lib/ronin/arch.rb +7 -15
- data/lib/ronin/author.rb +1 -1
- data/lib/ronin/cache.rb +1 -1
- data/lib/ronin/cache/cache.rb +1 -1
- data/lib/ronin/cache/config.rb +1 -1
- data/lib/ronin/cache/exceptions.rb +1 -1
- data/lib/ronin/cache/exceptions/extension_not_found.rb +1 -1
- data/lib/ronin/cache/exceptions/overlay_cached.rb +1 -1
- data/lib/ronin/cache/exceptions/overlay_not_found.rb +1 -1
- data/lib/ronin/cache/extension.rb +15 -190
- data/lib/ronin/cache/extension_cache.rb +2 -2
- data/lib/ronin/cache/maintainer.rb +1 -1
- data/lib/ronin/cache/overlay.rb +8 -7
- data/lib/ronin/cache/overlay_cache.rb +1 -1
- data/lib/ronin/cache/ronin.rb +1 -1
- data/lib/ronin/chars.rb +1 -1
- data/lib/ronin/chars/char_set.rb +1 -1
- data/lib/ronin/chars/chars.rb +1 -1
- data/lib/ronin/code/emittable.rb +1 -1
- data/lib/ronin/code/reference.rb +1 -1
- data/lib/ronin/code/symbol_table.rb +1 -1
- data/lib/ronin/code/token.rb +1 -1
- data/lib/ronin/config.rb +16 -9
- data/lib/ronin/database.rb +2 -113
- data/lib/ronin/database/database.rb +124 -0
- data/lib/ronin/{exceptions/unknown_context.rb → database/exceptions.rb} +2 -5
- data/lib/ronin/{exceptions/context_not_found.rb → database/exceptions/invalid_config.rb} +4 -2
- data/lib/ronin/extensions.rb +1 -1
- data/lib/ronin/extensions/hash.rb +1 -1
- data/lib/ronin/extensions/meta.rb +1 -1
- data/lib/ronin/extensions/string.rb +1 -1
- data/lib/ronin/extensions/uri.rb +1 -1
- data/lib/ronin/extensions/uri/http.rb +1 -1
- data/lib/ronin/extensions/uri/query_params.rb +1 -1
- data/lib/ronin/formatting.rb +1 -1
- data/lib/ronin/formatting/binary.rb +1 -1
- data/lib/ronin/formatting/digest.rb +1 -1
- data/lib/ronin/formatting/extensions.rb +1 -1
- data/lib/ronin/formatting/extensions/binary.rb +1 -1
- data/lib/ronin/formatting/extensions/binary/integer.rb +1 -1
- data/lib/ronin/formatting/extensions/binary/string.rb +1 -1
- data/lib/ronin/formatting/extensions/digest.rb +1 -1
- data/lib/ronin/formatting/extensions/digest/string.rb +1 -1
- data/lib/ronin/formatting/extensions/html.rb +1 -1
- data/lib/ronin/formatting/extensions/html/string.rb +1 -1
- data/lib/ronin/formatting/extensions/http.rb +1 -1
- data/lib/ronin/formatting/extensions/http/string.rb +1 -1
- data/lib/ronin/formatting/extensions/text.rb +1 -1
- data/lib/ronin/formatting/extensions/text/string.rb +1 -1
- data/lib/ronin/formatting/html.rb +1 -1
- data/lib/ronin/formatting/http.rb +1 -1
- data/lib/ronin/formatting/text.rb +1 -1
- data/lib/ronin/{pending_context.rb → has_license.rb} +21 -22
- data/lib/ronin/hexdump.rb +1 -1
- data/lib/ronin/hexdump/extensions.rb +1 -1
- data/lib/ronin/hexdump/extensions/file.rb +1 -1
- data/lib/ronin/hexdump/extensions/kernel.rb +1 -1
- data/lib/ronin/hexdump/hexdump.rb +1 -1
- data/lib/ronin/license.rb +10 -15
- data/lib/ronin/model.rb +14 -12
- data/lib/ronin/models.rb +2 -2
- data/lib/ronin/network.rb +1 -1
- data/lib/ronin/network/esmtp.rb +1 -1
- data/lib/ronin/network/extensions.rb +1 -1
- data/lib/ronin/network/extensions/esmtp.rb +1 -1
- data/lib/ronin/network/extensions/esmtp/net.rb +1 -1
- data/lib/ronin/network/extensions/http.rb +1 -1
- data/lib/ronin/network/extensions/http/net.rb +1 -1
- data/lib/ronin/network/extensions/imap.rb +1 -1
- data/lib/ronin/network/extensions/imap/net.rb +1 -1
- data/lib/ronin/network/extensions/pop3.rb +1 -1
- data/lib/ronin/network/extensions/pop3/net.rb +1 -1
- data/lib/ronin/network/extensions/smtp.rb +1 -1
- data/lib/ronin/network/extensions/smtp/net.rb +1 -1
- data/lib/ronin/network/extensions/tcp.rb +1 -1
- data/lib/ronin/network/extensions/tcp/net.rb +17 -1
- data/lib/ronin/network/extensions/telnet.rb +1 -1
- data/lib/ronin/network/extensions/telnet/net.rb +1 -1
- data/lib/ronin/network/extensions/udp.rb +1 -1
- data/lib/ronin/network/extensions/udp/net.rb +1 -1
- data/lib/ronin/network/http.rb +1 -1
- data/lib/ronin/network/http/exceptions.rb +1 -1
- data/lib/ronin/network/http/exceptions/unknown_request.rb +1 -1
- data/lib/ronin/network/imap.rb +1 -1
- data/lib/ronin/network/pop3.rb +1 -1
- data/lib/ronin/network/smtp.rb +1 -1
- data/lib/ronin/network/smtp/email.rb +1 -1
- data/lib/ronin/network/smtp/smtp.rb +1 -1
- data/lib/ronin/network/tcp.rb +1 -1
- data/lib/ronin/network/telnet.rb +1 -1
- data/lib/ronin/network/udp.rb +1 -1
- data/lib/ronin/objectify.rb +24 -0
- data/lib/ronin/{exceptions/invalid_database_config.rb → objectify/exceptions.rb} +3 -5
- data/lib/ronin/{exceptions → objectify/exceptions}/object_context_not_found.rb +1 -1
- data/lib/ronin/{exceptions → objectify/exceptions}/unknown_object_context.rb +1 -1
- data/lib/ronin/{object_context.rb → objectify/objectify.rb} +54 -45
- data/lib/ronin/path.rb +1 -1
- data/lib/ronin/platform.rb +3 -1
- data/lib/ronin/product.rb +2 -1
- data/lib/ronin/ronin.rb +10 -10
- data/lib/ronin/rpc.rb +1 -1
- data/lib/ronin/rpc/call.rb +1 -1
- data/lib/ronin/rpc/client.rb +1 -1
- data/lib/ronin/rpc/console.rb +1 -1
- data/lib/ronin/rpc/exceptions.rb +1 -1
- data/lib/ronin/rpc/exceptions/not_implemented.rb +1 -1
- data/lib/ronin/rpc/exceptions/response_missing.rb +1 -1
- data/lib/ronin/rpc/response.rb +1 -1
- data/lib/ronin/rpc/service.rb +1 -1
- data/lib/ronin/rpc/shell.rb +1 -1
- data/lib/ronin/sessions.rb +1 -1
- data/lib/ronin/sessions/esmtp.rb +6 -8
- data/lib/ronin/sessions/http.rb +1 -1
- data/lib/ronin/sessions/imap.rb +6 -8
- data/lib/ronin/sessions/pop3.rb +6 -8
- data/lib/ronin/sessions/session.rb +1 -1
- data/lib/ronin/sessions/smtp.rb +6 -8
- data/lib/ronin/sessions/tcp.rb +48 -36
- data/lib/ronin/sessions/telnet.rb +7 -10
- data/lib/ronin/sessions/udp.rb +28 -29
- data/lib/ronin/sessions/web.rb +5 -7
- data/lib/ronin/target.rb +1 -0
- data/lib/ronin/translators/translator.rb +1 -1
- data/lib/ronin/ui/command_line.rb +1 -1
- data/lib/ronin/ui/command_line/command.rb +1 -1
- data/lib/ronin/ui/command_line/command_line.rb +7 -2
- data/lib/ronin/ui/command_line/commands.rb +2 -2
- data/lib/ronin/ui/command_line/commands/add.rb +8 -8
- data/lib/ronin/ui/command_line/commands/default.rb +1 -1
- data/lib/ronin/ui/command_line/commands/extension.rb +13 -26
- data/lib/ronin/ui/command_line/commands/help.rb +1 -1
- data/lib/ronin/ui/command_line/commands/install.rb +7 -7
- data/lib/ronin/ui/command_line/commands/list.rb +13 -7
- data/lib/ronin/ui/command_line/commands/overlay.rb +1 -1
- data/lib/ronin/ui/command_line/commands/remove.rb +4 -4
- data/lib/ronin/ui/command_line/commands/uninstall.rb +4 -4
- data/lib/ronin/ui/command_line/commands/update.rb +3 -3
- data/lib/ronin/ui/command_line/exceptions.rb +1 -1
- data/lib/ronin/ui/command_line/exceptions/unknown_command.rb +1 -1
- data/lib/ronin/ui/command_line/options.rb +1 -1
- data/lib/ronin/ui/command_line/param_parser.rb +73 -0
- data/lib/ronin/ui/console.rb +1 -1
- data/lib/ronin/ui/shell.rb +1 -1
- data/lib/ronin/version.rb +2 -2
- data/lib/ronin/web.rb +1 -1
- data/lib/ronin/web/web.rb +1 -1
- data/spec/chars/char_set_spec.rb +116 -118
- data/spec/chars/chars_spec.rb +54 -63
- data/spec/formatting/{binary_spec.rb → binary/integer_spec.rb} +0 -19
- data/spec/formatting/binary/string_spec.rb +32 -0
- data/spec/{object_context/object_context_spec.rb → objectify/objectify_spec.rb} +5 -3
- data/spec/path_spec.rb +21 -23
- data/spec/translators/translator_spec.rb +38 -40
- data/spec/ui/command_line/param_parser_spec.rb +58 -0
- data/static/extension.rb +9 -0
- metadata +43 -24
- data/lib/ronin/context.rb +0 -236
- data/spec/context/context_spec.rb +0 -84
- data/spec/context/helpers/book_context.rb +0 -15
- data/spec/context/helpers/book_review_context.rb +0 -21
- data/spec/context/helpers/contexts/neuromancer_review.rb +0 -15
- data/spec/context/helpers/contexts/snow_crash.rb +0 -8
- data/static/extension.rb.erb +0 -16
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -101,7 +101,12 @@ module Ronin
|
|
101
101
|
argv = argv[1..-1]
|
102
102
|
|
103
103
|
if CommandLine.has_command?(cmd)
|
104
|
-
|
104
|
+
begin
|
105
|
+
CommandLine.commands_by_name[cmd].run(*argv)
|
106
|
+
rescue => excp
|
107
|
+
STDERR.puts excp
|
108
|
+
exit -1
|
109
|
+
end
|
105
110
|
else
|
106
111
|
CommandLine.fail("unknown command #{cmd.dump}")
|
107
112
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -33,4 +33,4 @@ require 'ronin/ui/command_line/commands/help'
|
|
33
33
|
|
34
34
|
require 'reverse_require'
|
35
35
|
|
36
|
-
|
36
|
+
require_for 'ronin', 'ronin/ui/command_line/commands'
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -35,11 +35,11 @@ module Ronin
|
|
35
35
|
opts.usage = 'PATH [options]'
|
36
36
|
|
37
37
|
opts.options do
|
38
|
-
opts.on('-m','--media MEDIA','Spedify the media-type of the
|
38
|
+
opts.on('-m','--media MEDIA','Spedify the media-type of the overlay') do |media|
|
39
39
|
@media = media
|
40
40
|
end
|
41
41
|
|
42
|
-
opts.on('-U','--uri URI','Specify the source URI of the
|
42
|
+
opts.on('-U','--uri URI','Specify the source URI of the overlay') do |uri|
|
43
43
|
@uri = uri
|
44
44
|
end
|
45
45
|
|
@@ -49,22 +49,22 @@ module Ronin
|
|
49
49
|
end
|
50
50
|
|
51
51
|
opts.arguments(
|
52
|
-
'PATH' => 'Add the
|
52
|
+
'PATH' => 'Add the overlay located at the specified PATH'
|
53
53
|
)
|
54
54
|
|
55
|
-
opts.summary('Add a local
|
55
|
+
opts.summary('Add a local overlay located at the specified PATH to the Overlay cache')
|
56
56
|
end
|
57
57
|
|
58
58
|
def arguments(*args)
|
59
59
|
unless args.length == 1
|
60
|
-
fail('only one
|
60
|
+
fail('only one overlay path maybe specified')
|
61
61
|
end
|
62
62
|
|
63
63
|
path = args.first
|
64
64
|
|
65
65
|
Cache::Overlay.save_cache do
|
66
|
-
Cache::Overlay.add(path,@media,@uri) do |
|
67
|
-
puts "Overlay #{
|
66
|
+
Cache::Overlay.add(path,@media,@uri) do |overlay|
|
67
|
+
puts "Overlay #{overlay.name.dump} added."
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -42,13 +42,7 @@ module Ronin
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def define_options(opts)
|
45
|
-
opts.usage = '[
|
46
|
-
|
47
|
-
opts.options do
|
48
|
-
opts.on('-u','--uses NAME','Name of an other extension to use') do |name|
|
49
|
-
@uses << name
|
50
|
-
end
|
51
|
-
end
|
45
|
+
opts.usage = 'PATH [...]'
|
52
46
|
|
53
47
|
opts.arguments(
|
54
48
|
'PATH' => 'The PATH of the Extension to be created'
|
@@ -58,24 +52,17 @@ module Ronin
|
|
58
52
|
end
|
59
53
|
|
60
54
|
def arguments(*args)
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
FileUtils.mkdir_p(File.join(lib_dir,File.basename(path)))
|
73
|
-
|
74
|
-
File.open(extension_path,'w') do |file|
|
75
|
-
template_path = File.join(Config::STATIC_DIR,'extension.rb.erb')
|
76
|
-
template = ERB.new(File.read(template_path))
|
77
|
-
|
78
|
-
file.write(template.result(binding))
|
55
|
+
args.each do |path|
|
56
|
+
path = File.expand_path(path)
|
57
|
+
extension_path = File.join(path,Cache::Extension::EXTENSION_FILE)
|
58
|
+
lib_dir = File.join(path,Cache::Extension::LIB_DIR)
|
59
|
+
template_path = File.join(Config::STATIC_DIR,'extension.rb')
|
60
|
+
|
61
|
+
FileUtils.mkdir_p(path)
|
62
|
+
FileUtils.mkdir_p(lib_dir)
|
63
|
+
FileUtils.touch(File.join(lib_dir,File.basename(path) + '.rb'))
|
64
|
+
FileUtils.mkdir_p(File.join(lib_dir,File.basename(path)))
|
65
|
+
FileUtils.cp(template_path,extension_path)
|
79
66
|
end
|
80
67
|
end
|
81
68
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -35,28 +35,28 @@ module Ronin
|
|
35
35
|
opts.usage = 'URI [options]'
|
36
36
|
|
37
37
|
opts.options do
|
38
|
-
opts.on('-m','--media [MEDIA]','Spedify the media-type of the
|
38
|
+
opts.on('-m','--media [MEDIA]','Spedify the media-type of the overlay') do |media|
|
39
39
|
@media = media
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
opts.arguments(
|
44
|
-
'URI' => 'The URI of the
|
44
|
+
'URI' => 'The URI of the overlay to install'
|
45
45
|
)
|
46
46
|
|
47
|
-
opts.summary('Installs the
|
47
|
+
opts.summary('Installs the overlay located at the specified URI')
|
48
48
|
end
|
49
49
|
|
50
50
|
def arguments(args)
|
51
51
|
unless args.length == 1
|
52
|
-
fail('only one
|
52
|
+
fail('only one overlay URI maybe specified')
|
53
53
|
end
|
54
54
|
|
55
55
|
uri = args.first
|
56
56
|
|
57
57
|
Cache::Overlay.save_cache do
|
58
|
-
Cache::Overlay.install(:uri => uri, :media => @media) do |
|
59
|
-
puts "Overlay #{
|
58
|
+
Cache::Overlay.install(:uri => uri, :media => @media) do |overlay|
|
59
|
+
puts "Overlay #{overlay.name.dump} has been installed."
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -44,13 +44,13 @@ module Ronin
|
|
44
44
|
'NAME' => 'Overlay to display'
|
45
45
|
)
|
46
46
|
|
47
|
-
opts.summary('Display all or the specified repositories within the
|
47
|
+
opts.summary('Display all or the specified repositories within the Overlay cache')
|
48
48
|
end
|
49
49
|
|
50
50
|
def arguments(*args)
|
51
51
|
if args.empty?
|
52
52
|
# list all repositories by name
|
53
|
-
Cache::Overlay.each { |
|
53
|
+
Cache::Overlay.each { |overlay| puts " #{overlay}" }
|
54
54
|
return
|
55
55
|
end
|
56
56
|
|
@@ -77,12 +77,18 @@ module Ronin
|
|
77
77
|
puts " Website: #{overlay.website}"
|
78
78
|
end
|
79
79
|
|
80
|
-
|
81
|
-
puts "
|
80
|
+
unless overlay.extensions.empty?
|
81
|
+
puts " Extensions:\n\n"
|
82
|
+
overlay.each_extension { |ext| puts " #{ext}" }
|
82
83
|
end
|
83
84
|
|
84
|
-
|
85
|
-
|
85
|
+
if overlay.description
|
86
|
+
puts " Description:\n\n #{overlay.description}\n\n"
|
87
|
+
else
|
88
|
+
puts "\n"
|
89
|
+
end
|
90
|
+
else
|
91
|
+
puts "\n"
|
86
92
|
end
|
87
93
|
end
|
88
94
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -41,7 +41,7 @@ module Ronin
|
|
41
41
|
end
|
42
42
|
|
43
43
|
opts.arguments(
|
44
|
-
'NAME' => 'The
|
44
|
+
'NAME' => 'The overlay to remove'
|
45
45
|
)
|
46
46
|
|
47
47
|
opts.summary('Remove the specified repositories')
|
@@ -50,8 +50,8 @@ module Ronin
|
|
50
50
|
def arguments(*args)
|
51
51
|
args.each do |name|
|
52
52
|
Cache::Overlay.save_cache do
|
53
|
-
Cache::Overlay.remove(name) do |
|
54
|
-
puts "Removing #{
|
53
|
+
Cache::Overlay.remove(name) do |overlay|
|
54
|
+
puts "Removing #{overlay.name.dump} ..."
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -41,7 +41,7 @@ module Ronin
|
|
41
41
|
end
|
42
42
|
|
43
43
|
opts.arguments(
|
44
|
-
'NAME' => 'The
|
44
|
+
'NAME' => 'The overlay to uninstall'
|
45
45
|
)
|
46
46
|
|
47
47
|
opts.summary('Uninstall the specified repositories')
|
@@ -50,8 +50,8 @@ module Ronin
|
|
50
50
|
def arguments(*args)
|
51
51
|
args.each do |name|
|
52
52
|
Cache::Overlay.save_cache do
|
53
|
-
Cache::Overlay.uninstall(name) do |
|
54
|
-
puts "Uninstalling #{
|
53
|
+
Cache::Overlay.uninstall(name) do |overlay|
|
54
|
+
puts "Uninstalling #{overlay.name.dump} ..."
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -41,7 +41,7 @@ module Ronin
|
|
41
41
|
end
|
42
42
|
|
43
43
|
opts.arguments(
|
44
|
-
'NAME' => 'The
|
44
|
+
'NAME' => 'The overlay to update'
|
45
45
|
)
|
46
46
|
|
47
47
|
opts.summary('Updates all or the specified repositories')
|
@@ -49,7 +49,7 @@ module Ronin
|
|
49
49
|
|
50
50
|
def arguments(*args)
|
51
51
|
if args.empty?
|
52
|
-
Cache::Overlay.each { |
|
52
|
+
Cache::Overlay.each { |overlay| overlay.update }
|
53
53
|
else
|
54
54
|
args.each { |name| Cache::Overlay.update(name) }
|
55
55
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Ronin - A Ruby platform designed for information security and data
|
4
4
|
# exploration tasks.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2006-
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# This program is free software; you can redistribute it and/or modify
|
9
9
|
# it under the terms of the GNU General Public License as published by
|
@@ -0,0 +1,73 @@
|
|
1
|
+
#
|
2
|
+
#--
|
3
|
+
# Ronin - A Ruby platform designed for information security and data
|
4
|
+
# exploration tasks.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
+
#
|
8
|
+
# This program is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of the GNU General Public License as published by
|
10
|
+
# the Free Software Foundation; either version 2 of the License, or
|
11
|
+
# (at your option) any later version.
|
12
|
+
#
|
13
|
+
# This program is distributed in the hope that it will be useful,
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# GNU General Public License for more details.
|
17
|
+
#
|
18
|
+
# You should have received a copy of the GNU General Public License
|
19
|
+
# along with this program; if not, write to the Free Software
|
20
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
+
#++
|
22
|
+
#
|
23
|
+
|
24
|
+
require 'uri'
|
25
|
+
|
26
|
+
module Ronin
|
27
|
+
module UI
|
28
|
+
module CommandLine
|
29
|
+
module ParamParser
|
30
|
+
# Hash of format patterns and their parsers
|
31
|
+
FORMATS = {
|
32
|
+
/^[0-9]+$/ => lambda { |value| value.to_i },
|
33
|
+
/^0x[0-9a-fA-F]+$/ => lambda { |value| value.hex },
|
34
|
+
/^[a-zA-Z][a-zA-Z0-9]*:\/\// => lambda { |value| URI(value) },
|
35
|
+
'true' => lambda { |value| true },
|
36
|
+
'false' => lambda { |value| false }
|
37
|
+
}
|
38
|
+
|
39
|
+
# The params Hash
|
40
|
+
attr_reader :params
|
41
|
+
|
42
|
+
#
|
43
|
+
# Creates an empty +params+ Hash.
|
44
|
+
#
|
45
|
+
def initialize
|
46
|
+
@params = {}
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# Parses the specified _name_and_value_ string of the form
|
51
|
+
# "name=value" and extracts both the _name_ and the _value_, saving
|
52
|
+
# both the _name_ and _value_ within the +params+ Hash. If the
|
53
|
+
# extracted _value_ matches one of the patterns within +FORMATS+,
|
54
|
+
# then the associated parser will first parse the _value_.
|
55
|
+
#
|
56
|
+
def parse_param(name_and_value)
|
57
|
+
name, value = name_and_value.split('=',2)
|
58
|
+
|
59
|
+
if value
|
60
|
+
FORMATS.each do |pattern,parser|
|
61
|
+
if value.match(pattern)
|
62
|
+
value = parser.call(value)
|
63
|
+
break
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
@params[name.to_sym] = value
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|