ronin-support 0.4.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +11 -0
- data/.github/workflows/ruby.yml +28 -0
- data/.ruby-version +1 -0
- data/.yardopts +1 -1
- data/ChangeLog.md +121 -33
- data/Gemfile +17 -18
- data/README.md +57 -33
- data/Rakefile +10 -3
- data/gemspec.yml +16 -7
- data/lib/ronin/binary.rb +21 -0
- data/lib/ronin/binary/hexdump.rb +20 -0
- data/lib/ronin/binary/hexdump/parser.rb +403 -0
- data/lib/ronin/binary/struct.rb +567 -0
- data/lib/ronin/binary/template.rb +454 -0
- data/lib/ronin/extensions.rb +5 -5
- data/lib/ronin/extensions/enumerable.rb +5 -5
- data/lib/ronin/extensions/file.rb +39 -33
- data/lib/ronin/extensions/ip_addr.rb +29 -31
- data/lib/ronin/extensions/kernel.rb +5 -5
- data/lib/ronin/extensions/meta.rb +5 -5
- data/lib/ronin/extensions/regexp.rb +50 -5
- data/lib/ronin/extensions/resolv.rb +7 -9
- data/lib/ronin/extensions/string.rb +10 -10
- data/lib/ronin/formatting.rb +5 -5
- data/lib/ronin/formatting/binary.rb +5 -5
- data/lib/ronin/formatting/digest.rb +5 -5
- data/lib/ronin/formatting/extensions.rb +5 -5
- data/lib/ronin/formatting/extensions/binary.rb +7 -5
- data/lib/ronin/formatting/extensions/binary/array.rb +61 -0
- data/lib/ronin/formatting/extensions/binary/base64.rb +106 -0
- data/lib/ronin/formatting/extensions/binary/file.rb +44 -11
- data/lib/ronin/formatting/extensions/binary/float.rb +65 -0
- data/lib/ronin/formatting/extensions/binary/integer.rb +66 -50
- data/lib/ronin/formatting/extensions/binary/string.rb +81 -205
- data/lib/ronin/formatting/extensions/digest.rb +5 -5
- data/lib/ronin/formatting/extensions/digest/file.rb +5 -5
- data/lib/ronin/formatting/extensions/digest/string.rb +5 -5
- data/lib/ronin/formatting/extensions/html.rb +5 -5
- data/lib/ronin/formatting/extensions/html/integer.rb +9 -13
- data/lib/ronin/formatting/extensions/html/string.rb +31 -39
- data/lib/ronin/formatting/extensions/http.rb +5 -5
- data/lib/ronin/formatting/extensions/http/integer.rb +6 -6
- data/lib/ronin/formatting/extensions/http/string.rb +7 -7
- data/lib/ronin/formatting/extensions/sql.rb +5 -5
- data/lib/ronin/formatting/extensions/sql/string.rb +22 -24
- data/lib/ronin/formatting/extensions/text.rb +5 -5
- data/lib/ronin/formatting/extensions/text/array.rb +13 -11
- data/lib/ronin/formatting/extensions/text/string.rb +70 -13
- data/lib/ronin/formatting/html.rb +5 -5
- data/lib/ronin/formatting/http.rb +5 -5
- data/lib/ronin/formatting/sql.rb +5 -5
- data/lib/ronin/formatting/text.rb +5 -5
- data/lib/ronin/fuzzing.rb +5 -5
- data/lib/ronin/fuzzing/extensions.rb +5 -5
- data/lib/ronin/fuzzing/extensions/string.rb +42 -213
- data/lib/ronin/fuzzing/fuzzer.rb +110 -0
- data/lib/ronin/fuzzing/fuzzing.rb +33 -26
- data/lib/ronin/fuzzing/mutator.rb +161 -0
- data/lib/ronin/fuzzing/repeater.rb +81 -0
- data/lib/ronin/fuzzing/template.rb +133 -0
- data/lib/ronin/mixin.rb +2 -2
- data/lib/ronin/network.rb +7 -5
- data/lib/ronin/network/dns.rb +64 -24
- data/lib/ronin/network/esmtp.rb +5 -5
- data/lib/ronin/network/extensions.rb +5 -5
- data/lib/ronin/network/extensions/dns.rb +5 -5
- data/lib/ronin/network/extensions/dns/net.rb +5 -5
- data/lib/ronin/network/extensions/esmtp.rb +5 -5
- data/lib/ronin/network/extensions/esmtp/net.rb +5 -5
- data/lib/ronin/network/extensions/http.rb +5 -5
- data/lib/ronin/network/extensions/http/net.rb +5 -5
- data/lib/ronin/network/extensions/http/uri/http.rb +5 -5
- data/lib/ronin/network/extensions/imap.rb +5 -5
- data/lib/ronin/network/extensions/imap/net.rb +5 -5
- data/lib/ronin/network/extensions/pop3.rb +5 -5
- data/lib/ronin/network/extensions/pop3/net.rb +5 -5
- data/lib/ronin/network/extensions/smtp.rb +5 -5
- data/lib/ronin/network/extensions/smtp/net.rb +5 -5
- data/lib/ronin/network/extensions/ssl.rb +5 -5
- data/lib/ronin/network/extensions/ssl/net.rb +5 -5
- data/lib/ronin/network/extensions/tcp.rb +5 -5
- data/lib/ronin/network/extensions/tcp/net.rb +5 -5
- data/lib/ronin/network/extensions/telnet.rb +5 -5
- data/lib/ronin/network/extensions/telnet/net.rb +5 -5
- data/lib/ronin/network/extensions/udp.rb +5 -5
- data/lib/ronin/network/extensions/udp/net.rb +5 -5
- data/lib/ronin/network/ftp.rb +149 -0
- data/lib/ronin/network/http.rb +5 -5
- data/lib/ronin/network/http/exceptions.rb +5 -5
- data/lib/ronin/network/http/exceptions/unknown_request.rb +5 -5
- data/lib/ronin/network/http/http.rb +65 -70
- data/lib/ronin/network/http/proxy.rb +5 -5
- data/lib/ronin/network/imap.rb +16 -15
- data/lib/ronin/network/mixins.rb +6 -5
- data/lib/ronin/network/mixins/dns.rb +5 -5
- data/lib/ronin/network/mixins/esmtp.rb +5 -5
- data/lib/ronin/network/mixins/ftp.rb +155 -0
- data/lib/ronin/network/mixins/http.rb +58 -587
- data/lib/ronin/network/mixins/imap.rb +5 -5
- data/lib/ronin/network/mixins/mixin.rb +5 -5
- data/lib/ronin/network/mixins/pop3.rb +5 -5
- data/lib/ronin/network/mixins/smtp.rb +5 -5
- data/lib/ronin/network/mixins/ssl.rb +5 -5
- data/lib/ronin/network/mixins/tcp.rb +43 -10
- data/lib/ronin/network/mixins/telnet.rb +5 -5
- data/lib/ronin/network/mixins/udp.rb +126 -6
- data/lib/ronin/network/mixins/unix.rb +279 -0
- data/lib/ronin/network/network.rb +5 -5
- data/lib/ronin/network/pop3.rb +10 -10
- data/lib/ronin/network/proxy.rb +578 -0
- data/lib/ronin/network/smtp.rb +5 -5
- data/lib/ronin/network/smtp/email.rb +6 -6
- data/lib/ronin/network/smtp/smtp.rb +12 -13
- data/lib/ronin/network/ssl.rb +16 -17
- data/lib/ronin/network/tcp.rb +7 -310
- data/lib/ronin/network/tcp/proxy.rb +417 -0
- data/lib/ronin/network/tcp/tcp.rb +452 -0
- data/lib/ronin/network/telnet.rb +34 -28
- data/lib/ronin/network/udp.rb +7 -271
- data/lib/ronin/network/udp/proxy.rb +191 -0
- data/lib/ronin/network/udp/udp.rb +452 -0
- data/lib/ronin/network/unix.rb +286 -0
- data/lib/ronin/path.rb +35 -39
- data/lib/ronin/spec/ui/output.rb +6 -12
- data/lib/ronin/support.rb +6 -5
- data/lib/ronin/support/inflector.rb +8 -12
- data/lib/ronin/support/support.rb +7 -5
- data/lib/ronin/support/version.rb +6 -6
- data/lib/ronin/templates.rb +5 -5
- data/lib/ronin/templates/erb.rb +5 -5
- data/lib/ronin/templates/template.rb +5 -5
- data/lib/ronin/ui/output.rb +5 -5
- data/lib/ronin/ui/output/helpers.rb +42 -28
- data/lib/ronin/ui/output/output.rb +17 -21
- data/lib/ronin/ui/output/terminal.rb +5 -5
- data/lib/ronin/ui/output/terminal/color.rb +15 -9
- data/lib/ronin/ui/output/terminal/raw.rb +5 -5
- data/lib/ronin/ui/shell.rb +8 -11
- data/lib/ronin/wordlist.rb +110 -30
- data/ronin-support.gemspec +39 -109
- data/spec/binary/hexdump/helpers/hexdumps.rb +13 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/ascii.bin +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_decimal_shorts.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_hex_bytes.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_hex_shorts.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_octal_bytes.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_octal_shorts.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_repeated.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_decimal_bytes.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_decimal_ints.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_decimal_quads.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_decimal_shorts.txt +0 -0
- data/spec/binary/hexdump/helpers/hexdumps/od_doubles.txt +17 -0
- data/spec/binary/hexdump/helpers/hexdumps/od_floats.txt +17 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_hex_bytes.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_hex_ints.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_hex_quads.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_hex_shorts.txt +0 -0
- data/spec/binary/hexdump/helpers/hexdumps/od_named_chars.txt +17 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_octal_bytes.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_octal_ints.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_octal_quads.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_octal_shorts.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_repeated.txt +0 -0
- data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/repeated.bin +0 -0
- data/spec/binary/hexdump/parser_spec.rb +302 -0
- data/spec/binary/struct_spec.rb +496 -0
- data/spec/binary/template_spec.rb +416 -0
- data/spec/extensions/enumerable_spec.rb +4 -4
- data/spec/extensions/file_spec.rb +12 -14
- data/spec/extensions/ip_addr_spec.rb +76 -50
- data/spec/extensions/kernel_spec.rb +7 -7
- data/spec/extensions/regexp_spec.rb +119 -59
- data/spec/extensions/resolv_spec.rb +2 -2
- data/spec/extensions/string_spec.rb +31 -30
- data/spec/formatting/binary/array_spec.rb +26 -0
- data/spec/formatting/binary/base64_spec.rb +50 -0
- data/spec/formatting/binary/float_spec.rb +36 -0
- data/spec/formatting/binary/integer_spec.rb +76 -50
- data/spec/formatting/binary/string_spec.rb +91 -198
- data/spec/formatting/digest/string_spec.rb +5 -5
- data/spec/formatting/html/integer_spec.rb +6 -6
- data/spec/formatting/html/string_spec.rb +10 -10
- data/spec/formatting/http/integer_spec.rb +3 -3
- data/spec/formatting/http/string_spec.rb +5 -5
- data/spec/formatting/sql/string_spec.rb +21 -19
- data/spec/formatting/text/array_spec.rb +15 -15
- data/spec/formatting/text/string_spec.rb +58 -28
- data/spec/fuzzing/extensions/string_spec.rb +87 -0
- data/spec/fuzzing/fuzzer_spec.rb +109 -0
- data/spec/fuzzing/fuzzing_spec.rb +24 -0
- data/spec/fuzzing/mutator_spec.rb +112 -0
- data/spec/fuzzing/repeater_spec.rb +57 -0
- data/spec/fuzzing/template_spec.rb +54 -0
- data/spec/mixin_spec.rb +10 -12
- data/spec/network/dns_spec.rb +89 -23
- data/spec/network/ftp_spec.rb +81 -0
- data/spec/network/http/http_spec.rb +237 -144
- data/spec/network/http/proxy_spec.rb +37 -37
- data/spec/network/network_spec.rb +2 -2
- data/spec/network/proxy_spec.rb +121 -0
- data/spec/network/shared/unix_server.rb +31 -0
- data/spec/network/smtp/email_spec.rb +14 -14
- data/spec/network/ssl_spec.rb +53 -3
- data/spec/network/tcp/proxy_spec.rb +118 -0
- data/spec/network/tcp/tcp_spec.rb +316 -0
- data/spec/network/telnet_spec.rb +67 -0
- data/spec/network/udp/udp_spec.rb +298 -0
- data/spec/network/unix_spec.rb +182 -0
- data/spec/path_spec.rb +43 -18
- data/spec/spec_helper.rb +2 -3
- data/spec/support/inflector_spec.rb +4 -4
- data/spec/support_spec.rb +1 -1
- data/spec/templates/erb_spec.rb +3 -3
- data/spec/templates/template_spec.rb +10 -10
- data/spec/ui/shell_spec.rb +15 -15
- data/spec/wordlist_spec.rb +80 -19
- metadata +176 -121
- data/.gemtest +0 -0
- data/spec/formatting/binary/helpers/hexdumps.rb +0 -16
- data/spec/fuzzing/string_spec.rb +0 -158
- data/spec/network/tcp_spec.rb +0 -247
- data/spec/network/udp_spec.rb +0 -248
@@ -1,20 +1,20 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2006-
|
2
|
+
# Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
# This file is part of
|
4
|
+
# This file is part of ronin-support.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# ronin-support is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU Lesser General Public License as published
|
8
8
|
# by the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# ronin-support is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU Lesser General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU Lesser General Public License
|
17
|
-
# along with
|
17
|
+
# along with ronin-support. If not, see <https://www.gnu.org/licenses/>.
|
18
18
|
#
|
19
19
|
|
20
20
|
require 'ronin/ui/output/output'
|
@@ -71,7 +71,7 @@ module Ronin
|
|
71
71
|
#
|
72
72
|
# Prints one or more messages.
|
73
73
|
#
|
74
|
-
# @param [Array]
|
74
|
+
# @param [Array] arguments
|
75
75
|
# The messages to print.
|
76
76
|
#
|
77
77
|
# @example
|
@@ -81,11 +81,27 @@ module Ronin
|
|
81
81
|
#
|
82
82
|
# @api public
|
83
83
|
#
|
84
|
-
def puts(*
|
85
|
-
|
86
|
-
messages.each { |message| write("#{message}#{$/}") }
|
87
|
-
else
|
84
|
+
def puts(*arguments)
|
85
|
+
if arguments.empty?
|
88
86
|
write($/)
|
87
|
+
return nil
|
88
|
+
end
|
89
|
+
|
90
|
+
arguments.each do |argument|
|
91
|
+
if argument.kind_of?(Array)
|
92
|
+
argument.each { |element| puts(element) }
|
93
|
+
else
|
94
|
+
str = case argument
|
95
|
+
when nil
|
96
|
+
if RUBY_VERSION > '1.9' then ''
|
97
|
+
else 'nil'
|
98
|
+
end
|
99
|
+
else
|
100
|
+
argument.to_s
|
101
|
+
end
|
102
|
+
|
103
|
+
write("#{str}#{$/}")
|
104
|
+
end
|
89
105
|
end
|
90
106
|
|
91
107
|
return nil
|
@@ -97,7 +113,7 @@ module Ronin
|
|
97
113
|
# @param [String] format
|
98
114
|
# The format string.
|
99
115
|
#
|
100
|
-
# @param [Array]
|
116
|
+
# @param [Array] arguments
|
101
117
|
# The data to format.
|
102
118
|
#
|
103
119
|
# @return [nil]
|
@@ -106,8 +122,8 @@ module Ronin
|
|
106
122
|
#
|
107
123
|
# @api public
|
108
124
|
#
|
109
|
-
def printf(format,*
|
110
|
-
write(format %
|
125
|
+
def printf(format,*arguments)
|
126
|
+
write(format % arguments)
|
111
127
|
return nil
|
112
128
|
end
|
113
129
|
|
@@ -123,7 +139,7 @@ module Ronin
|
|
123
139
|
# @example
|
124
140
|
# print_info "Connecting ..."
|
125
141
|
#
|
126
|
-
# @example Print a formatted message
|
142
|
+
# @example Print a formatted message:
|
127
143
|
# print_info "Connected to %s", host
|
128
144
|
#
|
129
145
|
# @since 0.3.0
|
@@ -132,7 +148,7 @@ module Ronin
|
|
132
148
|
#
|
133
149
|
def print_info(*message)
|
134
150
|
unless Output.silent?
|
135
|
-
Output.handler.print_info(
|
151
|
+
Output.handler.print_info(Helpers.format(message))
|
136
152
|
return true
|
137
153
|
end
|
138
154
|
|
@@ -148,7 +164,7 @@ module Ronin
|
|
148
164
|
# @return [Boolean]
|
149
165
|
# Specifies whether the messages were successfully printed.
|
150
166
|
#
|
151
|
-
# @example Print a formatted message
|
167
|
+
# @example Print a formatted message:
|
152
168
|
# print_debug "vars: %p %p", vars[0], vars[1]
|
153
169
|
#
|
154
170
|
# @since 0.3.0
|
@@ -157,7 +173,7 @@ module Ronin
|
|
157
173
|
#
|
158
174
|
def print_debug(*message)
|
159
175
|
if (Output.verbose? && !(Output.silent?))
|
160
|
-
Output.handler.print_debug(
|
176
|
+
Output.handler.print_debug(Helpers.format(message))
|
161
177
|
return true
|
162
178
|
end
|
163
179
|
|
@@ -176,7 +192,7 @@ module Ronin
|
|
176
192
|
# @example
|
177
193
|
# print_warning "Detecting a restricted character in the buffer"
|
178
194
|
#
|
179
|
-
# @example Print a formatted message
|
195
|
+
# @example Print a formatted message:
|
180
196
|
# print_warning "Malformed input detected: %p", user_input
|
181
197
|
#
|
182
198
|
# @since 0.3.0
|
@@ -185,7 +201,7 @@ module Ronin
|
|
185
201
|
#
|
186
202
|
def print_warning(*message)
|
187
203
|
unless Output.silent?
|
188
|
-
Output.handler.print_warning(
|
204
|
+
Output.handler.print_warning(Helpers.format(message))
|
189
205
|
return true
|
190
206
|
end
|
191
207
|
|
@@ -204,7 +220,7 @@ module Ronin
|
|
204
220
|
# @example
|
205
221
|
# print_error "Could not connect!"
|
206
222
|
#
|
207
|
-
# @example Print a formatted message
|
223
|
+
# @example Print a formatted message:
|
208
224
|
# print_error "%p: %s", error.class, error.message
|
209
225
|
#
|
210
226
|
# @since 0.3.0
|
@@ -213,7 +229,7 @@ module Ronin
|
|
213
229
|
#
|
214
230
|
def print_error(*message)
|
215
231
|
unless Output.silent?
|
216
|
-
Output.handler.print_error(
|
232
|
+
Output.handler.print_error(Helpers.format(message))
|
217
233
|
return true
|
218
234
|
end
|
219
235
|
|
@@ -259,21 +275,19 @@ module Ronin
|
|
259
275
|
#
|
260
276
|
# Formats a message to be printed.
|
261
277
|
#
|
262
|
-
# @param [Array]
|
278
|
+
# @param [Array] arguments
|
263
279
|
# The message and additional Objects to format.
|
264
280
|
#
|
265
281
|
# @return [String]
|
266
282
|
# The formatted message.
|
267
283
|
#
|
268
|
-
# @since 1.0.0
|
269
|
-
#
|
270
284
|
# @api private
|
271
285
|
#
|
272
|
-
def
|
273
|
-
|
274
|
-
|
286
|
+
def Helpers.format(arguments)
|
287
|
+
unless arguments.length == 1
|
288
|
+
arguments.first % arguments[1..-1]
|
275
289
|
else
|
276
|
-
|
290
|
+
arguments.first
|
277
291
|
end
|
278
292
|
end
|
279
293
|
end
|
@@ -1,20 +1,20 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2006-
|
2
|
+
# Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
# This file is part of
|
4
|
+
# This file is part of ronin-support.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# ronin-support is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU Lesser General Public License as published
|
8
8
|
# by the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# ronin-support is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU Lesser General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU Lesser General Public License
|
17
|
-
# along with
|
17
|
+
# along with ronin-support. If not, see <https://www.gnu.org/licenses/>.
|
18
18
|
#
|
19
19
|
|
20
20
|
require 'ronin/ui/output/terminal/raw'
|
@@ -26,16 +26,12 @@ module Ronin
|
|
26
26
|
# Controls {Output} from Ronin.
|
27
27
|
#
|
28
28
|
module Output
|
29
|
-
@mode = if ($VERBOSE || $DEBUG
|
30
|
-
|
31
|
-
else
|
32
|
-
:quiet
|
29
|
+
@mode = if ($VERBOSE || $DEBUG) then :verbose
|
30
|
+
else :quiet
|
33
31
|
end
|
34
32
|
|
35
|
-
@handler = if $stdout.tty?
|
36
|
-
|
37
|
-
else
|
38
|
-
Terminal::Raw
|
33
|
+
@handler = if $stdout.tty? then Terminal::Color
|
34
|
+
else Terminal::Raw
|
39
35
|
end
|
40
36
|
|
41
37
|
#
|
@@ -46,7 +42,7 @@ module Ronin
|
|
46
42
|
#
|
47
43
|
# @api semipublic
|
48
44
|
#
|
49
|
-
def
|
45
|
+
def self.verbose?
|
50
46
|
@mode == :verbose
|
51
47
|
end
|
52
48
|
|
@@ -58,7 +54,7 @@ module Ronin
|
|
58
54
|
#
|
59
55
|
# @api semipublic
|
60
56
|
#
|
61
|
-
def
|
57
|
+
def self.quiet?
|
62
58
|
@mode == :quiet
|
63
59
|
end
|
64
60
|
|
@@ -70,7 +66,7 @@ module Ronin
|
|
70
66
|
#
|
71
67
|
# @api semipublic
|
72
68
|
#
|
73
|
-
def
|
69
|
+
def self.silent?
|
74
70
|
@mode == :silent
|
75
71
|
end
|
76
72
|
|
@@ -83,7 +79,7 @@ module Ronin
|
|
83
79
|
#
|
84
80
|
# @api semipublic
|
85
81
|
#
|
86
|
-
def
|
82
|
+
def self.verbose!
|
87
83
|
@mode = :verbose
|
88
84
|
return self
|
89
85
|
end
|
@@ -97,7 +93,7 @@ module Ronin
|
|
97
93
|
#
|
98
94
|
# @api semipublic
|
99
95
|
#
|
100
|
-
def
|
96
|
+
def self.quiet!
|
101
97
|
@mode = :quiet
|
102
98
|
return self
|
103
99
|
end
|
@@ -109,7 +105,7 @@ module Ronin
|
|
109
105
|
#
|
110
106
|
# @since 1.0.0
|
111
107
|
#
|
112
|
-
def
|
108
|
+
def self.silent!
|
113
109
|
@mode = :silent
|
114
110
|
return self
|
115
111
|
end
|
@@ -122,7 +118,7 @@ module Ronin
|
|
122
118
|
#
|
123
119
|
# @api semipublic
|
124
120
|
#
|
125
|
-
def
|
121
|
+
def self.handler
|
126
122
|
@handler
|
127
123
|
end
|
128
124
|
|
@@ -138,7 +134,7 @@ module Ronin
|
|
138
134
|
#
|
139
135
|
# @api semipublic
|
140
136
|
#
|
141
|
-
def
|
137
|
+
def self.handler=(new_handler)
|
142
138
|
@handler = new_handler
|
143
139
|
end
|
144
140
|
end
|
@@ -1,20 +1,20 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2006-
|
2
|
+
# Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
# This file is part of
|
4
|
+
# This file is part of ronin-support.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# ronin-support is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU Lesser General Public License as published
|
8
8
|
# by the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# ronin-support is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU Lesser General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU Lesser General Public License
|
17
|
-
# along with
|
17
|
+
# along with ronin-support. If not, see <https://www.gnu.org/licenses/>.
|
18
18
|
#
|
19
19
|
|
20
20
|
require 'ronin/ui/output/terminal/raw'
|
@@ -1,20 +1,20 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2006-
|
2
|
+
# Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
# This file is part of
|
4
|
+
# This file is part of ronin-support.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# ronin-support is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU Lesser General Public License as published
|
8
8
|
# by the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# ronin-support is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU Lesser General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU Lesser General Public License
|
17
|
-
# along with
|
17
|
+
# along with ronin-support. If not, see <https://www.gnu.org/licenses/>.
|
18
18
|
#
|
19
19
|
|
20
20
|
module Ronin
|
@@ -38,6 +38,12 @@ module Ronin
|
|
38
38
|
# ANSI Red code
|
39
39
|
RED = "\e[31m"
|
40
40
|
|
41
|
+
# ANSI Bright code
|
42
|
+
BRIGHT = "\e[1m"
|
43
|
+
|
44
|
+
# ANSI Bright-Off code
|
45
|
+
BRIGHT_OFF = "\e[21m"
|
46
|
+
|
41
47
|
# ANSI Clear code
|
42
48
|
CLEAR = "\e[0m"
|
43
49
|
|
@@ -66,7 +72,7 @@ module Ronin
|
|
66
72
|
# @api private
|
67
73
|
#
|
68
74
|
def self.print_info(message)
|
69
|
-
$stdout.puts "#{GREEN}[-] #{message}#{CLEAR}"
|
75
|
+
$stdout.puts "#{GREEN}#{BRIGHT}[-]#{BRIGHT_OFF} #{message}#{CLEAR}"
|
70
76
|
end
|
71
77
|
|
72
78
|
#
|
@@ -80,7 +86,7 @@ module Ronin
|
|
80
86
|
# @api private
|
81
87
|
#
|
82
88
|
def self.print_debug(message)
|
83
|
-
$stdout.puts "#{CYAN}[=] #{message}#{CLEAR}"
|
89
|
+
$stdout.puts "#{CYAN}#{BRIGHT}[=]#{BRIGHT_OFF} #{message}#{CLEAR}"
|
84
90
|
end
|
85
91
|
|
86
92
|
#
|
@@ -94,7 +100,7 @@ module Ronin
|
|
94
100
|
# @api private
|
95
101
|
#
|
96
102
|
def self.print_warning(message)
|
97
|
-
$stdout.puts "#{YELLOW}[*] #{message}#{CLEAR}"
|
103
|
+
$stdout.puts "#{YELLOW}#{BRIGHT}[*]#{BRIGHT_OFF} #{message}#{CLEAR}"
|
98
104
|
end
|
99
105
|
|
100
106
|
#
|
@@ -108,7 +114,7 @@ module Ronin
|
|
108
114
|
# @api private
|
109
115
|
#
|
110
116
|
def self.print_error(message)
|
111
|
-
$stdout.puts "#{RED}[!] #{message}#{CLEAR}"
|
117
|
+
$stdout.puts "#{RED}#{BRIGHT}[!]#{BRIGHT_OFF} #{message}#{CLEAR}"
|
112
118
|
end
|
113
119
|
|
114
120
|
end
|
@@ -1,20 +1,20 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2006-
|
2
|
+
# Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
# This file is part of
|
4
|
+
# This file is part of ronin-support.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# ronin-support is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU Lesser General Public License as published
|
8
8
|
# by the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# ronin-support is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU Lesser General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU Lesser General Public License
|
17
|
-
# along with
|
17
|
+
# along with ronin-support. If not, see <https://www.gnu.org/licenses/>.
|
18
18
|
#
|
19
19
|
|
20
20
|
module Ronin
|
data/lib/ronin/ui/shell.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2006-
|
2
|
+
# Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
|
3
3
|
#
|
4
|
-
# This file is part of
|
4
|
+
# This file is part of ronin-support.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# ronin-support is free software: you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU Lesser General Public License as published
|
8
8
|
# by the Free Software Foundation, either version 3 of the License, or
|
9
9
|
# (at your option) any later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# ronin-support is distributed in the hope that it will be useful,
|
12
12
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
13
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
14
|
# GNU Lesser General Public License for more details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU Lesser General Public License
|
17
|
-
# along with
|
17
|
+
# along with ronin-support. If not, see <https://www.gnu.org/licenses/>.
|
18
18
|
#
|
19
19
|
|
20
20
|
require 'ronin/ui/output/helpers'
|
@@ -271,12 +271,9 @@ module Ronin
|
|
271
271
|
command_method = method(name)
|
272
272
|
arguments = command_method.parameters.map do |param|
|
273
273
|
case param[0]
|
274
|
-
when :opt
|
275
|
-
|
276
|
-
|
277
|
-
"[#{param[1]} ...]"
|
278
|
-
else
|
279
|
-
param[1]
|
274
|
+
when :opt then "[#{param[1]}]"
|
275
|
+
when :rest then "[#{param[1]} ...]"
|
276
|
+
else param[1]
|
280
277
|
end
|
281
278
|
end
|
282
279
|
|