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.
Files changed (224) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +11 -0
  3. data/.github/workflows/ruby.yml +28 -0
  4. data/.ruby-version +1 -0
  5. data/.yardopts +1 -1
  6. data/ChangeLog.md +121 -33
  7. data/Gemfile +17 -18
  8. data/README.md +57 -33
  9. data/Rakefile +10 -3
  10. data/gemspec.yml +16 -7
  11. data/lib/ronin/binary.rb +21 -0
  12. data/lib/ronin/binary/hexdump.rb +20 -0
  13. data/lib/ronin/binary/hexdump/parser.rb +403 -0
  14. data/lib/ronin/binary/struct.rb +567 -0
  15. data/lib/ronin/binary/template.rb +454 -0
  16. data/lib/ronin/extensions.rb +5 -5
  17. data/lib/ronin/extensions/enumerable.rb +5 -5
  18. data/lib/ronin/extensions/file.rb +39 -33
  19. data/lib/ronin/extensions/ip_addr.rb +29 -31
  20. data/lib/ronin/extensions/kernel.rb +5 -5
  21. data/lib/ronin/extensions/meta.rb +5 -5
  22. data/lib/ronin/extensions/regexp.rb +50 -5
  23. data/lib/ronin/extensions/resolv.rb +7 -9
  24. data/lib/ronin/extensions/string.rb +10 -10
  25. data/lib/ronin/formatting.rb +5 -5
  26. data/lib/ronin/formatting/binary.rb +5 -5
  27. data/lib/ronin/formatting/digest.rb +5 -5
  28. data/lib/ronin/formatting/extensions.rb +5 -5
  29. data/lib/ronin/formatting/extensions/binary.rb +7 -5
  30. data/lib/ronin/formatting/extensions/binary/array.rb +61 -0
  31. data/lib/ronin/formatting/extensions/binary/base64.rb +106 -0
  32. data/lib/ronin/formatting/extensions/binary/file.rb +44 -11
  33. data/lib/ronin/formatting/extensions/binary/float.rb +65 -0
  34. data/lib/ronin/formatting/extensions/binary/integer.rb +66 -50
  35. data/lib/ronin/formatting/extensions/binary/string.rb +81 -205
  36. data/lib/ronin/formatting/extensions/digest.rb +5 -5
  37. data/lib/ronin/formatting/extensions/digest/file.rb +5 -5
  38. data/lib/ronin/formatting/extensions/digest/string.rb +5 -5
  39. data/lib/ronin/formatting/extensions/html.rb +5 -5
  40. data/lib/ronin/formatting/extensions/html/integer.rb +9 -13
  41. data/lib/ronin/formatting/extensions/html/string.rb +31 -39
  42. data/lib/ronin/formatting/extensions/http.rb +5 -5
  43. data/lib/ronin/formatting/extensions/http/integer.rb +6 -6
  44. data/lib/ronin/formatting/extensions/http/string.rb +7 -7
  45. data/lib/ronin/formatting/extensions/sql.rb +5 -5
  46. data/lib/ronin/formatting/extensions/sql/string.rb +22 -24
  47. data/lib/ronin/formatting/extensions/text.rb +5 -5
  48. data/lib/ronin/formatting/extensions/text/array.rb +13 -11
  49. data/lib/ronin/formatting/extensions/text/string.rb +70 -13
  50. data/lib/ronin/formatting/html.rb +5 -5
  51. data/lib/ronin/formatting/http.rb +5 -5
  52. data/lib/ronin/formatting/sql.rb +5 -5
  53. data/lib/ronin/formatting/text.rb +5 -5
  54. data/lib/ronin/fuzzing.rb +5 -5
  55. data/lib/ronin/fuzzing/extensions.rb +5 -5
  56. data/lib/ronin/fuzzing/extensions/string.rb +42 -213
  57. data/lib/ronin/fuzzing/fuzzer.rb +110 -0
  58. data/lib/ronin/fuzzing/fuzzing.rb +33 -26
  59. data/lib/ronin/fuzzing/mutator.rb +161 -0
  60. data/lib/ronin/fuzzing/repeater.rb +81 -0
  61. data/lib/ronin/fuzzing/template.rb +133 -0
  62. data/lib/ronin/mixin.rb +2 -2
  63. data/lib/ronin/network.rb +7 -5
  64. data/lib/ronin/network/dns.rb +64 -24
  65. data/lib/ronin/network/esmtp.rb +5 -5
  66. data/lib/ronin/network/extensions.rb +5 -5
  67. data/lib/ronin/network/extensions/dns.rb +5 -5
  68. data/lib/ronin/network/extensions/dns/net.rb +5 -5
  69. data/lib/ronin/network/extensions/esmtp.rb +5 -5
  70. data/lib/ronin/network/extensions/esmtp/net.rb +5 -5
  71. data/lib/ronin/network/extensions/http.rb +5 -5
  72. data/lib/ronin/network/extensions/http/net.rb +5 -5
  73. data/lib/ronin/network/extensions/http/uri/http.rb +5 -5
  74. data/lib/ronin/network/extensions/imap.rb +5 -5
  75. data/lib/ronin/network/extensions/imap/net.rb +5 -5
  76. data/lib/ronin/network/extensions/pop3.rb +5 -5
  77. data/lib/ronin/network/extensions/pop3/net.rb +5 -5
  78. data/lib/ronin/network/extensions/smtp.rb +5 -5
  79. data/lib/ronin/network/extensions/smtp/net.rb +5 -5
  80. data/lib/ronin/network/extensions/ssl.rb +5 -5
  81. data/lib/ronin/network/extensions/ssl/net.rb +5 -5
  82. data/lib/ronin/network/extensions/tcp.rb +5 -5
  83. data/lib/ronin/network/extensions/tcp/net.rb +5 -5
  84. data/lib/ronin/network/extensions/telnet.rb +5 -5
  85. data/lib/ronin/network/extensions/telnet/net.rb +5 -5
  86. data/lib/ronin/network/extensions/udp.rb +5 -5
  87. data/lib/ronin/network/extensions/udp/net.rb +5 -5
  88. data/lib/ronin/network/ftp.rb +149 -0
  89. data/lib/ronin/network/http.rb +5 -5
  90. data/lib/ronin/network/http/exceptions.rb +5 -5
  91. data/lib/ronin/network/http/exceptions/unknown_request.rb +5 -5
  92. data/lib/ronin/network/http/http.rb +65 -70
  93. data/lib/ronin/network/http/proxy.rb +5 -5
  94. data/lib/ronin/network/imap.rb +16 -15
  95. data/lib/ronin/network/mixins.rb +6 -5
  96. data/lib/ronin/network/mixins/dns.rb +5 -5
  97. data/lib/ronin/network/mixins/esmtp.rb +5 -5
  98. data/lib/ronin/network/mixins/ftp.rb +155 -0
  99. data/lib/ronin/network/mixins/http.rb +58 -587
  100. data/lib/ronin/network/mixins/imap.rb +5 -5
  101. data/lib/ronin/network/mixins/mixin.rb +5 -5
  102. data/lib/ronin/network/mixins/pop3.rb +5 -5
  103. data/lib/ronin/network/mixins/smtp.rb +5 -5
  104. data/lib/ronin/network/mixins/ssl.rb +5 -5
  105. data/lib/ronin/network/mixins/tcp.rb +43 -10
  106. data/lib/ronin/network/mixins/telnet.rb +5 -5
  107. data/lib/ronin/network/mixins/udp.rb +126 -6
  108. data/lib/ronin/network/mixins/unix.rb +279 -0
  109. data/lib/ronin/network/network.rb +5 -5
  110. data/lib/ronin/network/pop3.rb +10 -10
  111. data/lib/ronin/network/proxy.rb +578 -0
  112. data/lib/ronin/network/smtp.rb +5 -5
  113. data/lib/ronin/network/smtp/email.rb +6 -6
  114. data/lib/ronin/network/smtp/smtp.rb +12 -13
  115. data/lib/ronin/network/ssl.rb +16 -17
  116. data/lib/ronin/network/tcp.rb +7 -310
  117. data/lib/ronin/network/tcp/proxy.rb +417 -0
  118. data/lib/ronin/network/tcp/tcp.rb +452 -0
  119. data/lib/ronin/network/telnet.rb +34 -28
  120. data/lib/ronin/network/udp.rb +7 -271
  121. data/lib/ronin/network/udp/proxy.rb +191 -0
  122. data/lib/ronin/network/udp/udp.rb +452 -0
  123. data/lib/ronin/network/unix.rb +286 -0
  124. data/lib/ronin/path.rb +35 -39
  125. data/lib/ronin/spec/ui/output.rb +6 -12
  126. data/lib/ronin/support.rb +6 -5
  127. data/lib/ronin/support/inflector.rb +8 -12
  128. data/lib/ronin/support/support.rb +7 -5
  129. data/lib/ronin/support/version.rb +6 -6
  130. data/lib/ronin/templates.rb +5 -5
  131. data/lib/ronin/templates/erb.rb +5 -5
  132. data/lib/ronin/templates/template.rb +5 -5
  133. data/lib/ronin/ui/output.rb +5 -5
  134. data/lib/ronin/ui/output/helpers.rb +42 -28
  135. data/lib/ronin/ui/output/output.rb +17 -21
  136. data/lib/ronin/ui/output/terminal.rb +5 -5
  137. data/lib/ronin/ui/output/terminal/color.rb +15 -9
  138. data/lib/ronin/ui/output/terminal/raw.rb +5 -5
  139. data/lib/ronin/ui/shell.rb +8 -11
  140. data/lib/ronin/wordlist.rb +110 -30
  141. data/ronin-support.gemspec +39 -109
  142. data/spec/binary/hexdump/helpers/hexdumps.rb +13 -0
  143. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/ascii.bin +0 -0
  144. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_decimal_shorts.txt +0 -0
  145. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_hex_bytes.txt +0 -0
  146. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_hex_shorts.txt +0 -0
  147. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_octal_bytes.txt +0 -0
  148. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_octal_shorts.txt +0 -0
  149. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/hexdump_repeated.txt +0 -0
  150. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_decimal_bytes.txt +0 -0
  151. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_decimal_ints.txt +0 -0
  152. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_decimal_quads.txt +0 -0
  153. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_decimal_shorts.txt +0 -0
  154. data/spec/binary/hexdump/helpers/hexdumps/od_doubles.txt +17 -0
  155. data/spec/binary/hexdump/helpers/hexdumps/od_floats.txt +17 -0
  156. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_hex_bytes.txt +0 -0
  157. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_hex_ints.txt +0 -0
  158. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_hex_quads.txt +0 -0
  159. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_hex_shorts.txt +0 -0
  160. data/spec/binary/hexdump/helpers/hexdumps/od_named_chars.txt +17 -0
  161. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_octal_bytes.txt +0 -0
  162. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_octal_ints.txt +0 -0
  163. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_octal_quads.txt +0 -0
  164. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_octal_shorts.txt +0 -0
  165. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/od_repeated.txt +0 -0
  166. data/spec/{formatting/binary → binary/hexdump}/helpers/hexdumps/repeated.bin +0 -0
  167. data/spec/binary/hexdump/parser_spec.rb +302 -0
  168. data/spec/binary/struct_spec.rb +496 -0
  169. data/spec/binary/template_spec.rb +416 -0
  170. data/spec/extensions/enumerable_spec.rb +4 -4
  171. data/spec/extensions/file_spec.rb +12 -14
  172. data/spec/extensions/ip_addr_spec.rb +76 -50
  173. data/spec/extensions/kernel_spec.rb +7 -7
  174. data/spec/extensions/regexp_spec.rb +119 -59
  175. data/spec/extensions/resolv_spec.rb +2 -2
  176. data/spec/extensions/string_spec.rb +31 -30
  177. data/spec/formatting/binary/array_spec.rb +26 -0
  178. data/spec/formatting/binary/base64_spec.rb +50 -0
  179. data/spec/formatting/binary/float_spec.rb +36 -0
  180. data/spec/formatting/binary/integer_spec.rb +76 -50
  181. data/spec/formatting/binary/string_spec.rb +91 -198
  182. data/spec/formatting/digest/string_spec.rb +5 -5
  183. data/spec/formatting/html/integer_spec.rb +6 -6
  184. data/spec/formatting/html/string_spec.rb +10 -10
  185. data/spec/formatting/http/integer_spec.rb +3 -3
  186. data/spec/formatting/http/string_spec.rb +5 -5
  187. data/spec/formatting/sql/string_spec.rb +21 -19
  188. data/spec/formatting/text/array_spec.rb +15 -15
  189. data/spec/formatting/text/string_spec.rb +58 -28
  190. data/spec/fuzzing/extensions/string_spec.rb +87 -0
  191. data/spec/fuzzing/fuzzer_spec.rb +109 -0
  192. data/spec/fuzzing/fuzzing_spec.rb +24 -0
  193. data/spec/fuzzing/mutator_spec.rb +112 -0
  194. data/spec/fuzzing/repeater_spec.rb +57 -0
  195. data/spec/fuzzing/template_spec.rb +54 -0
  196. data/spec/mixin_spec.rb +10 -12
  197. data/spec/network/dns_spec.rb +89 -23
  198. data/spec/network/ftp_spec.rb +81 -0
  199. data/spec/network/http/http_spec.rb +237 -144
  200. data/spec/network/http/proxy_spec.rb +37 -37
  201. data/spec/network/network_spec.rb +2 -2
  202. data/spec/network/proxy_spec.rb +121 -0
  203. data/spec/network/shared/unix_server.rb +31 -0
  204. data/spec/network/smtp/email_spec.rb +14 -14
  205. data/spec/network/ssl_spec.rb +53 -3
  206. data/spec/network/tcp/proxy_spec.rb +118 -0
  207. data/spec/network/tcp/tcp_spec.rb +316 -0
  208. data/spec/network/telnet_spec.rb +67 -0
  209. data/spec/network/udp/udp_spec.rb +298 -0
  210. data/spec/network/unix_spec.rb +182 -0
  211. data/spec/path_spec.rb +43 -18
  212. data/spec/spec_helper.rb +2 -3
  213. data/spec/support/inflector_spec.rb +4 -4
  214. data/spec/support_spec.rb +1 -1
  215. data/spec/templates/erb_spec.rb +3 -3
  216. data/spec/templates/template_spec.rb +10 -10
  217. data/spec/ui/shell_spec.rb +15 -15
  218. data/spec/wordlist_spec.rb +80 -19
  219. metadata +176 -121
  220. data/.gemtest +0 -0
  221. data/spec/formatting/binary/helpers/hexdumps.rb +0 -16
  222. data/spec/fuzzing/string_spec.rb +0 -158
  223. data/spec/network/tcp_spec.rb +0 -247
  224. data/spec/network/udp_spec.rb +0 -248
@@ -1,20 +1,20 @@
1
1
  #
2
- # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
- # This file is part of Ronin Support.
4
+ # This file is part of ronin-support.
5
5
  #
6
- # Ronin Support is free software: you can redistribute it and/or modify
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
- # Ronin Support is distributed in the hope that it will be useful,
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 Ronin Support. If not, see <http://www.gnu.org/licenses/>.
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] messages
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(*messages)
85
- unless messages.empty?
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] data
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,*data)
110
- write(format % data)
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(format_message(message))
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(format_message(message))
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(format_message(message))
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(format_message(message))
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] message
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 format_message(message)
273
- if message.length == 1
274
- message[0]
286
+ def Helpers.format(arguments)
287
+ unless arguments.length == 1
288
+ arguments.first % arguments[1..-1]
275
289
  else
276
- message[0] % message[1..-1]
290
+ arguments.first
277
291
  end
278
292
  end
279
293
  end
@@ -1,20 +1,20 @@
1
1
  #
2
- # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
- # This file is part of Ronin Support.
4
+ # This file is part of ronin-support.
5
5
  #
6
- # Ronin Support is free software: you can redistribute it and/or modify
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
- # Ronin Support is distributed in the hope that it will be useful,
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 Ronin Support. If not, see <http://www.gnu.org/licenses/>.
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 || ENV['VERBOSE'])
30
- :verbose
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
- Terminal::Color
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 Output.verbose?
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 Output.quiet?
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 Output.silent?
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 Output.verbose!
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 Output.quiet!
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 Output.silent!
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 Output.handler
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 Output.handler=(new_handler)
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-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
- # This file is part of Ronin Support.
4
+ # This file is part of ronin-support.
5
5
  #
6
- # Ronin Support is free software: you can redistribute it and/or modify
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
- # Ronin Support is distributed in the hope that it will be useful,
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 Ronin Support. If not, see <http://www.gnu.org/licenses/>.
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-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
- # This file is part of Ronin Support.
4
+ # This file is part of ronin-support.
5
5
  #
6
- # Ronin Support is free software: you can redistribute it and/or modify
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
- # Ronin Support is distributed in the hope that it will be useful,
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 Ronin Support. If not, see <http://www.gnu.org/licenses/>.
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-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
- # This file is part of Ronin Support.
4
+ # This file is part of ronin-support.
5
5
  #
6
- # Ronin Support is free software: you can redistribute it and/or modify
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
- # Ronin Support is distributed in the hope that it will be useful,
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 Ronin Support. If not, see <http://www.gnu.org/licenses/>.
17
+ # along with ronin-support. If not, see <https://www.gnu.org/licenses/>.
18
18
  #
19
19
 
20
20
  module Ronin
@@ -1,20 +1,20 @@
1
1
  #
2
- # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
- # This file is part of Ronin Support.
4
+ # This file is part of ronin-support.
5
5
  #
6
- # Ronin Support is free software: you can redistribute it and/or modify
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
- # Ronin Support is distributed in the hope that it will be useful,
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 Ronin Support. If not, see <http://www.gnu.org/licenses/>.
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
- "[#{param[1]}]"
276
- when :rest
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