ronin 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +14 -0
  3. data/.rubocop.yml +21 -0
  4. data/ChangeLog.md +35 -2
  5. data/Gemfile +20 -16
  6. data/README.md +42 -23
  7. data/Rakefile +2 -2
  8. data/bin/ronin +6 -7
  9. data/data/new/project/Gemfile.erb +9 -9
  10. data/gemspec.yml +7 -7
  11. data/lib/ronin/cli/char_set_options.rb +1 -1
  12. data/lib/ronin/cli/cipher_command.rb +3 -1
  13. data/lib/ronin/cli/command.rb +3 -0
  14. data/lib/ronin/cli/commands/asn.rb +1 -1
  15. data/lib/ronin/cli/commands/banner_grab.rb +5 -3
  16. data/lib/ronin/cli/commands/cert_dump.rb +4 -7
  17. data/lib/ronin/cli/commands/cert_gen.rb +4 -4
  18. data/lib/ronin/cli/commands/cert_grab.rb +5 -6
  19. data/lib/ronin/cli/commands/decode.rb +14 -14
  20. data/lib/ronin/cli/commands/dns.rb +2 -2
  21. data/lib/ronin/cli/commands/encode.rb +14 -14
  22. data/lib/ronin/cli/commands/extract.rb +1 -1
  23. data/lib/ronin/cli/commands/grep.rb +7 -5
  24. data/lib/ronin/cli/commands/hexdump.rb +54 -22
  25. data/lib/ronin/cli/commands/hmac.rb +1 -1
  26. data/lib/ronin/cli/commands/host.rb +15 -15
  27. data/lib/ronin/cli/commands/http.rb +42 -25
  28. data/lib/ronin/cli/commands/ip.rb +5 -3
  29. data/lib/ronin/cli/commands/iprange.rb +2 -2
  30. data/lib/ronin/cli/commands/netcat.rb +32 -38
  31. data/lib/ronin/cli/commands/new/project.rb +19 -19
  32. data/lib/ronin/cli/commands/new/script.rb +12 -12
  33. data/lib/ronin/cli/commands/proxy.rb +37 -41
  34. data/lib/ronin/cli/commands/rot.rb +11 -10
  35. data/lib/ronin/cli/commands/strings.rb +1 -1
  36. data/lib/ronin/cli/commands/unhexdump.rb +1 -1
  37. data/lib/ronin/cli/dns.rb +3 -0
  38. data/lib/ronin/cli/file_processor_command.rb +3 -0
  39. data/lib/ronin/cli/host_and_port.rb +58 -0
  40. data/lib/ronin/cli/http_shell.rb +19 -16
  41. data/lib/ronin/cli/key_options.rb +3 -5
  42. data/lib/ronin/cli/method_options.rb +0 -2
  43. data/lib/ronin/cli/pattern_options.rb +5 -6
  44. data/lib/ronin/cli/printing/syntax_highlighting.rb +3 -0
  45. data/lib/ronin/cli/typo_options.rb +1 -1
  46. data/lib/ronin/cli/value_processor_command.rb +1 -1
  47. data/lib/ronin/config.rb +3 -3
  48. data/lib/ronin/version.rb +2 -2
  49. data/man/ronin-asn.1 +11 -1
  50. data/man/ronin-asn.1.md +9 -1
  51. data/man/ronin-banner-grab.1 +1 -1
  52. data/man/ronin-banner-grab.1.md +1 -1
  53. data/man/ronin-bitflip.1 +1 -1
  54. data/man/ronin-bitflip.1.md +1 -1
  55. data/man/ronin-cert-dump.1 +1 -1
  56. data/man/ronin-cert-dump.1.md +1 -1
  57. data/man/ronin-cert-gen.1 +16 -7
  58. data/man/ronin-cert-gen.1.md +11 -5
  59. data/man/ronin-cert-grab.1 +1 -1
  60. data/man/ronin-cert-grab.1.md +1 -1
  61. data/man/ronin-decode.1 +1 -1
  62. data/man/ronin-decode.1.md +1 -1
  63. data/man/ronin-decrypt.1 +31 -1
  64. data/man/ronin-decrypt.1.md +19 -1
  65. data/man/ronin-dns.1 +2 -2
  66. data/man/ronin-dns.1.md +2 -2
  67. data/man/ronin-email-addr.1 +3 -3
  68. data/man/ronin-email-addr.1.md +3 -3
  69. data/man/ronin-encode.1 +1 -1
  70. data/man/ronin-encode.1.md +1 -1
  71. data/man/ronin-encrypt.1 +31 -1
  72. data/man/ronin-encrypt.1.md +19 -1
  73. data/man/ronin-entropy.1 +1 -1
  74. data/man/ronin-entropy.1.md +1 -1
  75. data/man/ronin-escape.1 +2 -2
  76. data/man/ronin-escape.1.md +2 -2
  77. data/man/ronin-extract.1 +1 -1
  78. data/man/ronin-extract.1.md +1 -1
  79. data/man/ronin-grep.1 +1 -1
  80. data/man/ronin-grep.1.md +1 -1
  81. data/man/ronin-help.1 +1 -1
  82. data/man/ronin-help.1.md +1 -1
  83. data/man/ronin-hexdump.1 +2 -2
  84. data/man/ronin-hexdump.1.md +2 -2
  85. data/man/ronin-highlight.1 +1 -1
  86. data/man/ronin-highlight.1.md +1 -1
  87. data/man/ronin-hmac.1 +1 -1
  88. data/man/ronin-hmac.1.md +1 -1
  89. data/man/ronin-homoglyph.1 +1 -1
  90. data/man/ronin-homoglyph.1.md +1 -1
  91. data/man/ronin-host.1 +3 -3
  92. data/man/ronin-host.1.md +3 -3
  93. data/man/ronin-http.1 +1 -1
  94. data/man/ronin-http.1.md +1 -1
  95. data/man/ronin-ip.1 +1 -1
  96. data/man/ronin-ip.1.md +1 -1
  97. data/man/ronin-iprange.1 +1 -1
  98. data/man/ronin-iprange.1.md +1 -1
  99. data/man/ronin-irb.1 +1 -1
  100. data/man/ronin-irb.1.md +1 -1
  101. data/man/ronin-md5.1 +1 -1
  102. data/man/ronin-md5.1.md +1 -1
  103. data/man/ronin-netcat.1 +1 -1
  104. data/man/ronin-netcat.1.md +1 -1
  105. data/man/ronin-new-project.1 +1 -1
  106. data/man/ronin-new-project.1.md +1 -1
  107. data/man/ronin-new-script.1 +1 -1
  108. data/man/ronin-new-script.1.md +1 -1
  109. data/man/ronin-new.1 +1 -1
  110. data/man/ronin-new.1.md +1 -1
  111. data/man/ronin-proxy.1 +2 -2
  112. data/man/ronin-proxy.1.md +2 -2
  113. data/man/ronin-public-suffix-list.1 +11 -1
  114. data/man/ronin-public-suffix-list.1.md +9 -1
  115. data/man/ronin-quote.1 +2 -2
  116. data/man/ronin-quote.1.md +2 -2
  117. data/man/ronin-rot.1 +20 -3
  118. data/man/ronin-rot.1.md +14 -3
  119. data/man/ronin-sha1.1 +1 -1
  120. data/man/ronin-sha1.1.md +1 -1
  121. data/man/ronin-sha256.1 +2 -2
  122. data/man/ronin-sha256.1.md +2 -2
  123. data/man/ronin-sha512.1 +1 -1
  124. data/man/ronin-sha512.1.md +1 -1
  125. data/man/ronin-strings.1 +1 -1
  126. data/man/ronin-strings.1.md +1 -1
  127. data/man/ronin-tips.1 +1 -1
  128. data/man/ronin-tips.1.md +1 -1
  129. data/man/ronin-tld-list.1 +11 -1
  130. data/man/ronin-tld-list.1.md +9 -1
  131. data/man/ronin-typo.1 +1 -1
  132. data/man/ronin-typo.1.md +1 -1
  133. data/man/ronin-typosquat.1 +1 -1
  134. data/man/ronin-typosquat.1.md +1 -1
  135. data/man/ronin-unescape.1 +1 -1
  136. data/man/ronin-unescape.1.md +1 -1
  137. data/man/ronin-unhexdump.1 +1 -1
  138. data/man/ronin-unhexdump.1.md +1 -1
  139. data/man/ronin-unquote.1 +1 -1
  140. data/man/ronin-unquote.1.md +1 -1
  141. data/man/ronin-url.1 +1 -1
  142. data/man/ronin-url.1.md +1 -1
  143. data/man/ronin-xor.1 +1 -1
  144. data/man/ronin-xor.1.md +1 -1
  145. data/man/ronin.1 +1 -1
  146. data/man/ronin.1.md +1 -1
  147. data/ronin.gemspec +4 -3
  148. metadata +40 -2
@@ -17,6 +17,7 @@
17
17
  #
18
18
 
19
19
  require 'ronin/cli/command'
20
+ require 'ronin/cli/host_and_port'
20
21
  require 'ronin/core/cli/logging'
21
22
 
22
23
  require 'ronin/support/network/tcp/proxy'
@@ -30,7 +31,7 @@ module Ronin
30
31
  class CLI
31
32
  module Commands
32
33
  #
33
- # Starts a TCP/UDP intercept proxy.
34
+ # Starts a TCP/UDP/SSL/TLS intercept proxy server.
34
35
  #
35
36
  # ## Usage
36
37
  #
@@ -38,35 +39,26 @@ module Ronin
38
39
  #
39
40
  # ## Options
40
41
  #
41
- # -v, --[no-]verbose Enable verbose output.
42
- # -q, --[no-]quiet Disable verbose output.
43
- # --[no-]silent Silence all output.
44
- # -t, --[no-]tcp TCP Proxy.
45
- # Default: true
46
- # -S, --[no-]ssl SSL Proxy.
47
- # -T, --[no-]tls TLS Proxy.
48
- # -u, --[no-]udp UDP Proxy.
49
- # -x, --[no-]hexdump Enable hexdump output.
50
- # -r, --rewrite [/REGEXP/:STRING] Rewrite rules.
51
- # --rewrite-client [/REGEXP/:STRING]
52
- # Client rewrite rules.
53
- # --rewrite-server [/REGEXP/:STRING]
54
- # Server rewrite rules.
55
- # -i, --ignore [/REGEXP/ [...]] Ignore rules.
56
- # --ignore-client [/REGEXP/ [...]]
57
- # Client ignore rules.
58
- # --ignore-server [/REGEXP/ [...]]
59
- # Server ignore rules.
60
- # -C, --close [/REGEXP/ [...]] Close rules.
61
- # --close-client [/REGEXP/ [...]]
62
- # Client close rules.
63
- # --close-server [/REGEXP/ [...]]
64
- # Server close rules.
65
- # -R, --reset [/REGEXP/ [...]] Reset rules.
66
- # --reset-client [/REGEXP/ [...]]
67
- # Client reset rules.
68
- # --reset-server [/REGEXP/ [...]]
69
- # Server reset rules.
42
+ # -t, --tcp TCP Proxy
43
+ # -S, --ssl SSL Proxy
44
+ # -T, --tls TLS Proxy
45
+ # -u, --udp UDP Proxy
46
+ # -x, --[no-]hexdump Enable hexdump output
47
+ # -r, --rewrite /REGEXP/:STRING Rewrite rules
48
+ # --rewrite-client /REGEXP/:STRING
49
+ # Client rewrite rules
50
+ # --rewrite-server /REGEXP/:STRING
51
+ # Server rewrite rules
52
+ # -i, --ignore /REGEXP/ Ignore rules
53
+ # --ignore-client /REGEXP/ Client ignore rules
54
+ # --ignore-server /REGEXP/ Server ignore rules
55
+ # -C, --close /REGEXP/ Close rules
56
+ # --close-client /REGEXP/ Client close rules
57
+ # --close-server /REGEXP/ Server close rules
58
+ # -R, --reset /REGEXP/ Reset rules
59
+ # --reset-client /REGEXP/ Client reset rules
60
+ # --reset-server /REGEXP/ Server reset rules
61
+ # -h, --help Print help information
70
62
  #
71
63
  # ## Arguments
72
64
  #
@@ -74,8 +66,14 @@ module Ronin
74
66
  # listen on.
75
67
  # REMOTE_HOST:REMOTE_PORT The remote server to proxy data to.
76
68
  #
69
+ # ## Examples
70
+ #
71
+ # ronin proxy 8080 google.com:80
72
+ # ronin proxy --udp --hexdump 0.0.0.0:53 8.8.8.8:53
73
+ #
77
74
  class Proxy < Command
78
75
 
76
+ include HostAndPort
79
77
  include Core::CLI::Logging
80
78
 
81
79
  usage '[PROXY_HOST:]PROXY_PORT UPSTREAM_HOST:UPSTREAM_PORT'
@@ -115,7 +113,7 @@ module Ronin
115
113
 
116
114
  option :rewrite_client, value: {
117
115
  type: String,
118
- usage: '/REGEXP/:STRING',
116
+ usage: '/REGEXP/:STRING'
119
117
  },
120
118
  desc: 'Client rewrite rules' do |value|
121
119
  @rewrite_client << parse_rewrite_rule(value)
@@ -123,14 +121,14 @@ module Ronin
123
121
 
124
122
  option :rewrite_server, value: {
125
123
  type: String,
126
- usage: '/REGEXP/:STRING',
124
+ usage: '/REGEXP/:STRING'
127
125
  },
128
126
  desc: 'Server rewrite rules' do |value|
129
127
  @rewrite_server << parse_rewrite_rule(value)
130
128
  end
131
129
 
132
130
  option :ignore, short: '-i',
133
- value: {type: Regexp},
131
+ value: {type: Regexp},
134
132
  desc: 'Ignore rules' do |regexp|
135
133
  @ignore << regexp
136
134
  end
@@ -146,7 +144,7 @@ module Ronin
146
144
  end
147
145
 
148
146
  option :close, short: '-C',
149
- value: {type: Regexp},
147
+ value: {type: Regexp},
150
148
  desc: 'Close rules' do |regexp|
151
149
  @close << regexp
152
150
  end
@@ -183,7 +181,7 @@ module Ronin
183
181
  argument :upstream, usage: 'UPSTREAM_HOST:UPSTREAM_PORT',
184
182
  desc: 'The upstream server to proxy data to'
185
183
 
186
- description 'Starts a TCP/UDP/SSL/TLS intercept proxy'
184
+ description 'Starts a TCP/UDP/SSL/TLS intercept proxy server'
187
185
 
188
186
  examples [
189
187
  "8080 google.com:80",
@@ -294,14 +292,12 @@ module Ronin
294
292
  local, upstream = *args
295
293
 
296
294
  if local.include?(':')
297
- proxy_host, proxy_port = local.split(':',2)
298
- proxy_port = proxy_port.to_i
295
+ proxy_host, proxy_port = host_and_port(local)
299
296
  else
300
297
  proxy_port = local.to_i
301
298
  end
302
299
 
303
- upstream_host, upstream_port = upstream.split(':',2)
304
- upstream_port = upstream_port.to_i
300
+ upstream_host, upstream_port = host_and_port(upstream)
305
301
 
306
302
  if options[:hexdump]
307
303
  @hexdumper = Hexdump::Hexdump.new
@@ -430,7 +426,7 @@ module Ronin
430
426
  end
431
427
 
432
428
  regexp = Regexp.new(string[1...index])
433
- pattern = string[index+2..]
429
+ pattern = string[(index + 2)..]
434
430
 
435
431
  return regexp, pattern
436
432
  end
@@ -465,7 +461,7 @@ module Ronin
465
461
  def address(connection)
466
462
  case connection
467
463
  when Array
468
- socket, (host, port) = connection
464
+ _socket, (host, port) = connection
469
465
 
470
466
  "#{host}:#{port}"
471
467
  when TCPSocket, UDPSocket
@@ -37,7 +37,7 @@ module Ronin
37
37
  # -M, --multiline Process each line separately
38
38
  # --keep-newlines Preserves newlines at the end of each line
39
39
  # -A, --alphabet ABC... Alphabet characters
40
- # -n, --modulu NUM Number of characters to rotate
40
+ # -n, --modulo NUM Number of characters to rotate (Default: 13)
41
41
  # -h, --help Print help information
42
42
  #
43
43
  # ## Arguments
@@ -55,13 +55,14 @@ module Ronin
55
55
  @alphabets << str.chars
56
56
  end
57
57
 
58
- option :modulu, short: '-n',
58
+ option :modulo, short: '-n',
59
59
  value: {
60
- type: Integer,
61
- usage: 'NUM'
60
+ type: Integer,
61
+ usage: 'NUM',
62
+ default: 13
62
63
  },
63
64
  desc: 'Number of characters to rotate' do |num|
64
- @n = num
65
+ @modulo = num
65
66
  end
66
67
 
67
68
  description "Rotates each character of data within an alphabet"
@@ -71,7 +72,7 @@ module Ronin
71
72
  # The number of characters to rotate.
72
73
  #
73
74
  # @return [Integer]
74
- attr_reader :n
75
+ attr_reader :modulo
75
76
 
76
77
  # The alphabets to rotate within.
77
78
  #
@@ -87,7 +88,7 @@ module Ronin
87
88
  def initialize(**kwargs)
88
89
  super(**kwargs)
89
90
 
90
- @n = 13
91
+ @modulo = 13
91
92
  @alphabets = []
92
93
  end
93
94
 
@@ -101,10 +102,10 @@ module Ronin
101
102
  # The rotated string.
102
103
  #
103
104
  def process_string(string)
104
- if !@alphabets.empty?
105
- Support::Crypto.rot(string,@n, alphabets: @alphabets)
105
+ unless @alphabets.empty?
106
+ Support::Crypto.rot(string,@modulo, alphabets: @alphabets)
106
107
  else
107
- Support::Crypto.rot(string,@n)
108
+ Support::Crypto.rot(string,@modulo)
108
109
  end
109
110
  end
110
111
 
@@ -85,7 +85,7 @@ module Ronin
85
85
  description 'Prints all strings within a file/stream belonging to the given character set'
86
86
 
87
87
  examples [
88
- '--hex -n 32 file.bin',
88
+ '--hex -n 32 file.bin'
89
89
  ]
90
90
 
91
91
  man_page 'ronin-strings.1'
@@ -140,7 +140,7 @@ module Ronin
140
140
  desc: 'Numerical base of the hexdumped numbers'
141
141
 
142
142
  option :address_base, short: '-A',
143
- value: {type: BASES},
143
+ value: {type: BASES},
144
144
  desc: 'Numerical base of the address column'
145
145
 
146
146
  option :named_chars, long: '--[no-]named-chars',
data/lib/ronin/cli/dns.rb CHANGED
@@ -20,6 +20,9 @@ require 'ronin/support/network/dns'
20
20
 
21
21
  module Ronin
22
22
  class CLI
23
+ #
24
+ # Mixin for adding DNS support to commands.
25
+ #
23
26
  module DNS
24
27
  #
25
28
  # Adds the `-N,--nameserver HOST|IP` option to the command which is
@@ -20,6 +20,9 @@ require 'ronin/cli/command'
20
20
 
21
21
  module Ronin
22
22
  class CLI
23
+ #
24
+ # Base class for all commands which process files.
25
+ #
23
26
  class FileProcessorCommand < Command
24
27
 
25
28
  argument :file, required: false,
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ #
5
+ # Ronin is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Ronin is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with Ronin. If not, see <https://www.gnu.org/licenses/>.
17
+ #
18
+
19
+ require 'addressable'
20
+
21
+ module Ronin
22
+ class CLI
23
+ #
24
+ # Mixin which adds methods for parsing `host:port` pairs.
25
+ #
26
+ module HostAndPort
27
+ #
28
+ # Parses a `host:port` pair.
29
+ #
30
+ # @param [String] string
31
+ # The string containing the `host:port` pair.
32
+ #
33
+ # @return [(String, Integer)]
34
+ # The parsed host and port.
35
+ #
36
+ def host_and_port(string)
37
+ host, port = string.split(':',2)
38
+
39
+ return host, port.to_i
40
+ end
41
+
42
+ #
43
+ # Parses the host and port from the given URL.
44
+ #
45
+ # @param [String] url
46
+ # The URL to parse.
47
+ #
48
+ # @return [(String, Integer)]
49
+ # The host and port components of the URL.
50
+ #
51
+ def host_and_port_from_url(url)
52
+ uri = Addressable::URI.parse(url)
53
+
54
+ return uri.normalized_host, uri.inferred_port
55
+ end
56
+ end
57
+ end
58
+ end
@@ -23,6 +23,9 @@ require 'ronin/support/network/http'
23
23
 
24
24
  module Ronin
25
25
  class CLI
26
+ #
27
+ # The interactive HTTP shell for the `ronin http --shell` command.
28
+ #
26
29
  class HTTPShell < Core::CLI::CommandShell
27
30
 
28
31
  include Printing::HTTP
@@ -40,14 +43,14 @@ module Ronin
40
43
  #
41
44
  # Initializes the HTTP Shell.
42
45
  #
43
- # @param [URI::HTTP, String] base_url
46
+ # @param [Addressable::URI] base_url
44
47
  # The base URL to connect to.
45
48
  #
46
49
  # @param [Hash{Symbol => Object}] kwargs
47
50
  # Additional arguments for `Ronin::Support::Network::HTTP#connect_uri`.
48
51
  #
49
52
  def initialize(base_url, **kwargs)
50
- @base_url = URI(base_url)
53
+ @base_url = base_url
51
54
  @http = Support::Network::HTTP.connect_uri(@base_url,**kwargs)
52
55
 
53
56
  super()
@@ -62,6 +65,18 @@ module Ronin
62
65
  "#{@base_url}"
63
66
  end
64
67
 
68
+ command :cd, usage: 'PATH',
69
+ summary: 'Changes the base URL path'
70
+
71
+ #
72
+ # The `cd` shell command.
73
+ #
74
+ # @param [String] path
75
+ #
76
+ def cd(path)
77
+ @base_url.path = join(path)
78
+ end
79
+
65
80
  command :get, usage: 'PATH[?QUERY] [BODY]',
66
81
  summary: 'Performs a GET request'
67
82
 
@@ -151,7 +166,7 @@ module Ronin
151
166
  # The `delete` shell command.
152
167
  #
153
168
  # @param [String] path
154
- #
169
+ #
155
170
  def delete(path)
156
171
  request(:delete,path)
157
172
  end
@@ -253,18 +268,6 @@ module Ronin
253
268
  request(:unlock,path)
254
269
  end
255
270
 
256
- command :cd, usage: 'PATH',
257
- summary: 'Changes the base URL path'
258
-
259
- #
260
- # The `cd` shell command.
261
- #
262
- # @param [String] path
263
- #
264
- def cd(path)
265
- @base_url.path = join(path)
266
- end
267
-
268
271
  command :headers, usage: '[{set | unset} NAME [VALUE]]',
269
272
  summary: 'Manages the request headers'
270
273
 
@@ -340,7 +343,7 @@ module Ronin
340
343
  def request(method,path,**kwargs)
341
344
  path = join(path)
342
345
 
343
- @http.request(method,path) do |response|
346
+ @http.request(method,path,**kwargs) do |response|
344
347
  print_response(response)
345
348
  end
346
349
  end
@@ -44,11 +44,9 @@ module Ronin
44
44
  usage: 'FILE'
45
45
  },
46
46
  desc: 'The key file' do |path|
47
- begin
48
- @key = File.binread(path)
49
- rescue Errno::ENOENT
50
- raise(OptionParser::InvalidArgument,"no such file or directory: #{path.inspect}")
51
- end
47
+ @key = File.binread(path)
48
+ rescue Errno::ENOENT
49
+ raise(OptionParser::InvalidArgument,"no such file or directory: #{path.inspect}")
52
50
  end
53
51
  end
54
52
 
@@ -22,7 +22,6 @@ module Ronin
22
22
  # Allows adding options which call methods on a given object.
23
23
  #
24
24
  module MethodOptions
25
-
26
25
  # The method calls to apply to an object.
27
26
  #
28
27
  # @return [Array<Symbol, (Symbol, Array)>]
@@ -65,7 +64,6 @@ module Ronin
65
64
 
66
65
  return object
67
66
  end
68
-
69
67
  end
70
68
  end
71
69
  end
@@ -129,7 +129,6 @@ module Ronin
129
129
  desc: 'Searches for all version numbers' do
130
130
  @pattern = VERSION_NUMBER
131
131
  end
132
-
133
132
  end
134
133
 
135
134
  #
@@ -182,13 +181,13 @@ module Ronin
182
181
  end
183
182
 
184
183
  command.option :uri, desc: 'Searches for all URIs' do
185
- @pattern = URI
186
- end
184
+ @pattern = URI
185
+ end
187
186
 
188
187
  command.option :url, short: '-U',
189
188
  desc: 'Searches for all URLs' do
190
189
  @pattern = URL
191
- end
190
+ end
192
191
  end
193
192
 
194
193
  #
@@ -320,11 +319,11 @@ module Ronin
320
319
  @pattern = FUNCTION_NAME
321
320
  end
322
321
 
323
- command.option :single_quoted_string, desc: 'Searches for all single-quoted strings' do
322
+ command.option :single_quoted_string, desc: 'Searches for all single-quoted strings' do
324
323
  @pattern = SINGLE_QUOTED_STRING
325
324
  end
326
325
 
327
- command.option :double_quoted_string, desc: 'Searches for all double-quoted strings' do
326
+ command.option :double_quoted_string, desc: 'Searches for all double-quoted strings' do
328
327
  @pattern = DOUBLE_QUOTED_STRING
329
328
  end
330
329
 
@@ -22,6 +22,9 @@ require 'rouge'
22
22
  module Ronin
23
23
  class CLI
24
24
  module Printing
25
+ #
26
+ # Mixin that adds syntax highlighting to commands.
27
+ #
25
28
  module SyntaxHighlighting
26
29
  include CommandKit::Colors
27
30
 
@@ -73,7 +73,7 @@ module Ronin
73
73
  # @return [Ronin::Support::Text::Typo::Generator]
74
74
  #
75
75
  def typo_generator
76
- @type_generator ||= Support::Text::Typo.generator(**@typo_kwargs)
76
+ @typo_generator ||= Support::Text::Typo.generator(**@typo_kwargs)
77
77
  end
78
78
  end
79
79
  end
@@ -40,7 +40,7 @@ module Ronin
40
40
  # @return [Array<String>]
41
41
  attr_reader :files
42
42
 
43
- #
43
+ #
44
44
  # Initializes the command.
45
45
  #
46
46
  # @param [Hash{Symbol => Object}] kwargs
data/lib/ronin/config.rb CHANGED
@@ -60,7 +60,7 @@ module Ronin
60
60
  #
61
61
  # @api semipublic
62
62
  #
63
- def Config.load(name=nil)
63
+ def self.load(name=nil)
64
64
  dir, file = if name then [CONFIG_DIR, "#{name}.rb"]
65
65
  else [PATH, 'config.rb']
66
66
  end
@@ -80,12 +80,12 @@ module Ronin
80
80
  #
81
81
  # @api semipublic
82
82
  #
83
- def Config.tmp_dir(sub_path=nil)
83
+ def self.tmp_dir(sub_path=nil)
84
84
  if sub_path
85
85
  sub_path = File.expand_path(File.join('',sub_path))
86
86
  path = File.join(TMP_DIR,sub_path)
87
87
 
88
- FileUtils.mkdir_p(path) unless File.exist?(path)
88
+ FileUtils.mkdir_p(path) unless File.directory?(path)
89
89
  return path
90
90
  end
91
91
 
data/lib/ronin/version.rb CHANGED
@@ -17,6 +17,6 @@
17
17
  #
18
18
 
19
19
  module Ronin
20
- # ronin version
21
- VERSION = '2.0.0'
20
+ # ronin version
21
+ VERSION = '2.0.2'
22
22
  end
data/man/ronin-asn.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-asn 1 "May 2022" Ronin "User Manuals"
3
+ .TH ronin-asn 1 "2023-02-01" Ronin "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -109,6 +109,16 @@ Enumerate over all IP addresses for all ASN records belonging to the given ISP:
109
109
  ronin asn \-\-enum\-ips \-N EDGECAST
110
110
  .fi
111
111
  .LP
112
+ .SH ENVIRONMENT
113
+ .LP
114
+ .TP
115
+ \fIHOME\fP
116
+ Alternate location for the user\[cq]s home directory\.
117
+ .LP
118
+ .TP
119
+ \fIXDG\[ru]CONFIG\[ru]HOME\fP
120
+ Alternate location for the \fB~/.config\fR directory\.
121
+ .LP
112
122
  .SH FILES
113
123
  .LP
114
124
  .TP
data/man/ronin-asn.1.md CHANGED
@@ -1,4 +1,4 @@
1
- # ronin-asn 1 "May 2022" Ronin "User Manuals"
1
+ # ronin-asn 1 "2023-02-01" Ronin "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
@@ -75,6 +75,14 @@ Enumerate over all IP addresses for all ASN records belonging to the given ISP:
75
75
 
76
76
  ronin asn --enum-ips -N EDGECAST
77
77
 
78
+ ## ENVIRONMENT
79
+
80
+ *HOME*
81
+ Alternate location for the user's home directory.
82
+
83
+ *XDG_CONFIG_HOME*
84
+ Alternate location for the `~/.config` directory.
85
+
78
86
  ## FILES
79
87
 
80
88
  `~/.cache/ronin/ronin-support/ip2asn-combined.tsv.gz`
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-banner-grab 1 "May 2022" Ronin "User Manuals"
3
+ .TH ronin-banner-grab 1 "2023-02-01" Ronin "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -1,4 +1,4 @@
1
- # ronin-banner-grab 1 "May 2022" Ronin "User Manuals"
1
+ # ronin-banner-grab 1 "2023-02-01" Ronin "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
data/man/ronin-bitflip.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-bitflip 1 "May 2022" Ronin "User Manuals"
3
+ .TH ronin-bitflip 1 "2023-02-01" Ronin "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -1,4 +1,4 @@
1
- # ronin-bitflip 1 "May 2022" Ronin "User Manuals"
1
+ # ronin-bitflip 1 "2023-02-01" Ronin "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-cert-dump 1 "May 2022" Ronin "User Manuals"
3
+ .TH ronin-cert-dump 1 "2023-02-01" Ronin "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -1,4 +1,4 @@
1
- # ronin-cert-dump 1 "May 2022" Ronin "User Manuals"
1
+ # ronin-cert-dump 1 "2023-02-01" Ronin "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4