ronin 2.0.0.beta5 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +14 -0
- data/.rubocop.yml +21 -0
- data/ChangeLog.md +18 -2
- data/Gemfile +6 -2
- data/Rakefile +9 -2
- data/bin/ronin +6 -7
- data/data/new/project/Gemfile.erb +9 -9
- data/gemspec.yml +12 -12
- data/lib/ronin/cli/char_set_options.rb +1 -1
- data/lib/ronin/cli/cipher_command.rb +3 -1
- data/lib/ronin/cli/command.rb +3 -0
- data/lib/ronin/cli/commands/asn.rb +1 -1
- data/lib/ronin/cli/commands/banner_grab.rb +5 -3
- data/lib/ronin/cli/commands/cert_dump.rb +4 -7
- data/lib/ronin/cli/commands/cert_gen.rb +4 -4
- data/lib/ronin/cli/commands/cert_grab.rb +5 -6
- data/lib/ronin/cli/commands/decode.rb +14 -14
- data/lib/ronin/cli/commands/encode.rb +14 -14
- data/lib/ronin/cli/commands/extract.rb +1 -1
- data/lib/ronin/cli/commands/grep.rb +7 -5
- data/lib/ronin/cli/commands/hexdump.rb +53 -22
- data/lib/ronin/cli/commands/hmac.rb +1 -1
- data/lib/ronin/cli/commands/host.rb +2 -2
- data/lib/ronin/cli/commands/http.rb +48 -26
- data/lib/ronin/cli/commands/ip.rb +2 -2
- data/lib/ronin/cli/commands/iprange.rb +2 -2
- data/lib/ronin/cli/commands/netcat.rb +32 -38
- data/lib/ronin/cli/commands/new/project.rb +19 -19
- data/lib/ronin/cli/commands/new/script.rb +12 -12
- data/lib/ronin/cli/commands/proxy.rb +10 -10
- data/lib/ronin/cli/commands/rot.rb +11 -10
- data/lib/ronin/cli/commands/strings.rb +1 -1
- data/lib/ronin/cli/commands/unhexdump.rb +1 -1
- data/lib/ronin/cli/dns.rb +3 -0
- data/lib/ronin/cli/file_processor_command.rb +3 -0
- data/lib/ronin/cli/host_and_port.rb +58 -0
- data/lib/ronin/cli/http_shell.rb +19 -16
- data/lib/ronin/cli/key_options.rb +3 -5
- data/lib/ronin/cli/method_options.rb +0 -2
- data/lib/ronin/cli/pattern_options.rb +5 -6
- data/lib/ronin/cli/printing/syntax_highlighting.rb +3 -0
- data/lib/ronin/cli/typo_options.rb +1 -1
- data/lib/ronin/cli/value_processor_command.rb +1 -1
- data/lib/ronin/config.rb +3 -3
- data/lib/ronin/version.rb +2 -2
- data/man/ronin-asn.1 +11 -1
- data/man/ronin-asn.1.md +9 -1
- data/man/ronin-banner-grab.1 +1 -1
- data/man/ronin-banner-grab.1.md +1 -1
- data/man/ronin-bitflip.1 +1 -1
- data/man/ronin-bitflip.1.md +1 -1
- data/man/ronin-cert-dump.1 +1 -1
- data/man/ronin-cert-dump.1.md +1 -1
- data/man/ronin-cert-gen.1 +1 -1
- data/man/ronin-cert-gen.1.md +1 -1
- data/man/ronin-cert-grab.1 +1 -1
- data/man/ronin-cert-grab.1.md +1 -1
- data/man/ronin-decode.1 +1 -1
- data/man/ronin-decode.1.md +1 -1
- data/man/ronin-decrypt.1 +1 -1
- data/man/ronin-decrypt.1.md +1 -1
- data/man/ronin-dns.1 +1 -1
- data/man/ronin-dns.1.md +1 -1
- data/man/ronin-email-addr.1 +1 -1
- data/man/ronin-email-addr.1.md +1 -1
- data/man/ronin-encode.1 +1 -1
- data/man/ronin-encode.1.md +1 -1
- data/man/ronin-encrypt.1 +1 -1
- data/man/ronin-encrypt.1.md +1 -1
- data/man/ronin-entropy.1 +1 -1
- data/man/ronin-entropy.1.md +1 -1
- data/man/ronin-escape.1 +1 -1
- data/man/ronin-escape.1.md +1 -1
- data/man/ronin-extract.1 +1 -1
- data/man/ronin-extract.1.md +1 -1
- data/man/ronin-grep.1 +1 -1
- data/man/ronin-grep.1.md +1 -1
- data/man/ronin-help.1 +1 -1
- data/man/ronin-help.1.md +1 -1
- data/man/ronin-hexdump.1 +2 -2
- data/man/ronin-hexdump.1.md +2 -2
- data/man/ronin-highlight.1 +1 -1
- data/man/ronin-highlight.1.md +1 -1
- data/man/ronin-hmac.1 +1 -1
- data/man/ronin-hmac.1.md +1 -1
- data/man/ronin-homoglyph.1 +1 -1
- data/man/ronin-homoglyph.1.md +1 -1
- data/man/ronin-host.1 +2 -2
- data/man/ronin-host.1.md +2 -2
- data/man/ronin-http.1 +1 -1
- data/man/ronin-http.1.md +1 -1
- data/man/ronin-ip.1 +1 -1
- data/man/ronin-ip.1.md +1 -1
- data/man/ronin-iprange.1 +1 -1
- data/man/ronin-iprange.1.md +1 -1
- data/man/ronin-irb.1 +1 -1
- data/man/ronin-irb.1.md +1 -1
- data/man/ronin-md5.1 +1 -1
- data/man/ronin-md5.1.md +1 -1
- data/man/ronin-netcat.1 +1 -1
- data/man/ronin-netcat.1.md +1 -1
- data/man/ronin-new-project.1 +1 -1
- data/man/ronin-new-project.1.md +1 -1
- data/man/ronin-new-script.1 +1 -1
- data/man/ronin-new-script.1.md +1 -1
- data/man/ronin-new.1 +1 -1
- data/man/ronin-new.1.md +1 -1
- data/man/ronin-proxy.1 +1 -1
- data/man/ronin-proxy.1.md +1 -1
- data/man/ronin-public-suffix-list.1 +11 -1
- data/man/ronin-public-suffix-list.1.md +9 -1
- data/man/ronin-quote.1 +1 -1
- data/man/ronin-quote.1.md +1 -1
- data/man/ronin-rot.1 +4 -3
- data/man/ronin-rot.1.md +4 -3
- data/man/ronin-sha1.1 +1 -1
- data/man/ronin-sha1.1.md +1 -1
- data/man/ronin-sha256.1 +1 -1
- data/man/ronin-sha256.1.md +1 -1
- data/man/ronin-sha512.1 +1 -1
- data/man/ronin-sha512.1.md +1 -1
- data/man/ronin-strings.1 +1 -1
- data/man/ronin-strings.1.md +1 -1
- data/man/ronin-tips.1 +1 -1
- data/man/ronin-tips.1.md +1 -1
- data/man/ronin-tld-list.1 +11 -1
- data/man/ronin-tld-list.1.md +9 -1
- data/man/ronin-typo.1 +1 -1
- data/man/ronin-typo.1.md +1 -1
- data/man/ronin-typosquat.1 +1 -1
- data/man/ronin-typosquat.1.md +1 -1
- data/man/ronin-unescape.1 +1 -1
- data/man/ronin-unescape.1.md +1 -1
- data/man/ronin-unhexdump.1 +1 -1
- data/man/ronin-unhexdump.1.md +1 -1
- data/man/ronin-unquote.1 +1 -1
- data/man/ronin-unquote.1.md +1 -1
- data/man/ronin-url.1 +1 -1
- data/man/ronin-url.1.md +1 -1
- data/man/ronin-xor.1 +1 -1
- data/man/ronin-xor.1.md +1 -1
- data/man/ronin.1 +1 -1
- data/man/ronin.1.md +1 -1
- data/ronin.gemspec +4 -3
- metadata +62 -24
data/lib/ronin/cli/dns.rb
CHANGED
@@ -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
|
data/lib/ronin/cli/http_shell.rb
CHANGED
@@ -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
|
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 =
|
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
|
-
|
48
|
-
|
49
|
-
|
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
|
-
|
186
|
-
|
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
|
-
|
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,
|
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,
|
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
|
|
data/lib/ronin/config.rb
CHANGED
@@ -60,7 +60,7 @@ module Ronin
|
|
60
60
|
#
|
61
61
|
# @api semipublic
|
62
62
|
#
|
63
|
-
def
|
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
|
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.
|
88
|
+
FileUtils.mkdir_p(path) unless File.directory?(path)
|
89
89
|
return path
|
90
90
|
end
|
91
91
|
|
data/lib/ronin/version.rb
CHANGED
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 "
|
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 "
|
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`
|
data/man/ronin-banner-grab.1
CHANGED
data/man/ronin-banner-grab.1.md
CHANGED
data/man/ronin-bitflip.1
CHANGED
data/man/ronin-bitflip.1.md
CHANGED
data/man/ronin-cert-dump.1
CHANGED
data/man/ronin-cert-dump.1.md
CHANGED
data/man/ronin-cert-gen.1
CHANGED
data/man/ronin-cert-gen.1.md
CHANGED
data/man/ronin-cert-grab.1
CHANGED
data/man/ronin-cert-grab.1.md
CHANGED
data/man/ronin-decode.1
CHANGED
data/man/ronin-decode.1.md
CHANGED
data/man/ronin-decrypt.1
CHANGED
data/man/ronin-decrypt.1.md
CHANGED
data/man/ronin-dns.1
CHANGED
data/man/ronin-dns.1.md
CHANGED
data/man/ronin-email-addr.1
CHANGED
data/man/ronin-email-addr.1.md
CHANGED
data/man/ronin-encode.1
CHANGED
data/man/ronin-encode.1.md
CHANGED
data/man/ronin-encrypt.1
CHANGED
data/man/ronin-encrypt.1.md
CHANGED
data/man/ronin-entropy.1
CHANGED
data/man/ronin-entropy.1.md
CHANGED
data/man/ronin-escape.1
CHANGED
data/man/ronin-escape.1.md
CHANGED
data/man/ronin-extract.1
CHANGED
data/man/ronin-extract.1.md
CHANGED
data/man/ronin-grep.1
CHANGED
data/man/ronin-grep.1.md
CHANGED
data/man/ronin-help.1
CHANGED
data/man/ronin-help.1.md
CHANGED
data/man/ronin-hexdump.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-hexdump 1 "
|
3
|
+
.TH ronin-hexdump 1 "2023-02-01" Ronin "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
@@ -182,7 +182,7 @@ will be used for the character grouping width\.
|
|
182
182
|
.LP
|
183
183
|
.TP
|
184
184
|
\fB-r\fR, \fB--[no-]repeating\fR
|
185
|
-
Allows consecutive repeating lines in hexdump output\. By default consecutive
|
185
|
+
Allows consecutive repeating lines in hexdump output\. By default consecutive
|
186
186
|
repeating lines of data are omitted by a single \fB*\fR line\.
|
187
187
|
.LP
|
188
188
|
.TP
|
data/man/ronin-hexdump.1.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# ronin-hexdump 1 "
|
1
|
+
# ronin-hexdump 1 "2023-02-01" Ronin "User Manuals"
|
2
2
|
|
3
3
|
## SYNOPSIS
|
4
4
|
|
@@ -104,7 +104,7 @@ Hexdumps data in a variety of encodings and formats.
|
|
104
104
|
will be used for the character grouping width.
|
105
105
|
|
106
106
|
`-r`, `--[no-]repeating`
|
107
|
-
Allows consecutive repeating lines in hexdump output. By default consecutive
|
107
|
+
Allows consecutive repeating lines in hexdump output. By default consecutive
|
108
108
|
repeating lines of data are omitted by a single `*` line.
|
109
109
|
|
110
110
|
`-b`, `--base` `2`|`8`|`10`|`16`
|