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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +14 -0
- data/.rubocop.yml +21 -0
- data/ChangeLog.md +35 -2
- data/Gemfile +20 -16
- data/README.md +42 -23
- data/Rakefile +2 -2
- data/bin/ronin +6 -7
- data/data/new/project/Gemfile.erb +9 -9
- data/gemspec.yml +7 -7
- 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/dns.rb +2 -2
- 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 +54 -22
- data/lib/ronin/cli/commands/hmac.rb +1 -1
- data/lib/ronin/cli/commands/host.rb +15 -15
- data/lib/ronin/cli/commands/http.rb +42 -25
- data/lib/ronin/cli/commands/ip.rb +5 -3
- 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 +37 -41
- 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 +16 -7
- data/man/ronin-cert-gen.1.md +11 -5
- 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 +31 -1
- data/man/ronin-decrypt.1.md +19 -1
- data/man/ronin-dns.1 +2 -2
- data/man/ronin-dns.1.md +2 -2
- data/man/ronin-email-addr.1 +3 -3
- data/man/ronin-email-addr.1.md +3 -3
- data/man/ronin-encode.1 +1 -1
- data/man/ronin-encode.1.md +1 -1
- data/man/ronin-encrypt.1 +31 -1
- data/man/ronin-encrypt.1.md +19 -1
- data/man/ronin-entropy.1 +1 -1
- data/man/ronin-entropy.1.md +1 -1
- data/man/ronin-escape.1 +2 -2
- data/man/ronin-escape.1.md +2 -2
- 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 +3 -3
- data/man/ronin-host.1.md +3 -3
- 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 +2 -2
- data/man/ronin-proxy.1.md +2 -2
- data/man/ronin-public-suffix-list.1 +11 -1
- data/man/ronin-public-suffix-list.1.md +9 -1
- data/man/ronin-quote.1 +2 -2
- data/man/ronin-quote.1.md +2 -2
- data/man/ronin-rot.1 +20 -3
- data/man/ronin-rot.1.md +14 -3
- data/man/ronin-sha1.1 +1 -1
- data/man/ronin-sha1.1.md +1 -1
- data/man/ronin-sha256.1 +2 -2
- data/man/ronin-sha256.1.md +2 -2
- 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 +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
|
-
# -
|
|
42
|
-
# -
|
|
43
|
-
#
|
|
44
|
-
# -
|
|
45
|
-
#
|
|
46
|
-
# -
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
# --
|
|
54
|
-
#
|
|
55
|
-
#
|
|
56
|
-
# --
|
|
57
|
-
#
|
|
58
|
-
# --
|
|
59
|
-
#
|
|
60
|
-
# -
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
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
|
-
|
|
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, --
|
|
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 :
|
|
58
|
+
option :modulo, short: '-n',
|
|
59
59
|
value: {
|
|
60
|
-
type:
|
|
61
|
-
usage:
|
|
60
|
+
type: Integer,
|
|
61
|
+
usage: 'NUM',
|
|
62
|
+
default: 13
|
|
62
63
|
},
|
|
63
64
|
desc: 'Number of characters to rotate' do |num|
|
|
64
|
-
@
|
|
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 :
|
|
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
|
-
@
|
|
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
|
-
|
|
105
|
-
Support::Crypto.rot(string,@
|
|
105
|
+
unless @alphabets.empty?
|
|
106
|
+
Support::Crypto.rot(string,@modulo, alphabets: @alphabets)
|
|
106
107
|
else
|
|
107
|
-
Support::Crypto.rot(string,@
|
|
108
|
+
Support::Crypto.rot(string,@modulo)
|
|
108
109
|
end
|
|
109
110
|
end
|
|
110
111
|
|
|
@@ -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:
|
|
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
|
@@ -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