ronin 2.0.0.beta1 → 2.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +72 -4
- data/data/new/project/Rakefile +3 -3
- data/data/new/project/project.rb.erb +1 -1
- data/gemspec.yml +12 -6
- data/lib/ronin/cli/char_set_options.rb +81 -68
- data/lib/ronin/cli/commands/dns.rb +3 -95
- data/lib/ronin/cli/commands/extract.rb +17 -7
- data/lib/ronin/cli/commands/grep.rb +17 -7
- data/lib/ronin/cli/commands/hexdump.rb +8 -2
- data/lib/ronin/cli/commands/host.rb +6 -88
- data/lib/ronin/cli/commands/http.rb +11 -11
- data/lib/ronin/cli/commands/public_suffix_list.rb +16 -2
- data/lib/ronin/cli/commands/tld_list.rb +16 -2
- data/lib/ronin/cli/dns.rb +136 -0
- data/lib/ronin/cli/pattern_options.rb +200 -85
- data/lib/ronin/cli.rb +5 -0
- data/lib/ronin/version.rb +1 -1
- data/man/ronin-extract.1 +52 -12
- data/man/ronin-extract.1.md +42 -12
- data/man/ronin-grep.1 +52 -12
- data/man/ronin-grep.1.md +42 -12
- data/man/ronin-http.1 +2 -2
- data/man/ronin-http.1.md +1 -1
- data/ronin.gemspec +2 -1
- metadata +15 -25
- data/spec/cli/command_spec.rb +0 -10
- data/spec/cli/commands/decode_spec.rb +0 -152
- data/spec/cli/commands/encode_spec.rb +0 -152
- data/spec/cli/commands/escape_spec.rb +0 -128
- data/spec/cli/commands/quote_spec.rb +0 -76
- data/spec/cli/commands/unescape_spec.rb +0 -128
- data/spec/cli/commands/unquote_spec.rb +0 -80
- data/spec/cli/fixtures/file.txt +0 -3
- data/spec/cli/fixtures/file2.txt +0 -3
- data/spec/cli/key_options_spec.rb +0 -56
- data/spec/cli/method_options_spec.rb +0 -71
- data/spec/cli/string_methods_command_spec.rb +0 -25
- data/spec/cli/string_processor_command_spec.rb +0 -258
- data/spec/cli/value_processor_command_spec.rb +0 -127
- data/spec/spec_helper.rb +0 -5
- data/spec/version_spec.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27384193981443a863258e9b0335f1a840bdca4fcc4220929d6def90b54bc580
|
4
|
+
data.tar.gz: abf2ec16390c3b8944dbe1986347bb1a9172658cdc401a79192d2c1d4409e662
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c390480d0b3ca44061e8c051588f464d1a0f913002fe907e1767b402ed436b770d8ac96d57de7bbdb05ee0f2f40535ab0b6558c9f0577568622086b241e6f3d
|
7
|
+
data.tar.gz: a10be869d6e24324dd85a194246c24a5c920b66349862b133515b152b807e599c02ac33e2f311e4a01143dd99717f2d7ad60a39909c5e818b64cac5b4b9aa3c0
|
data/README.md
CHANGED
@@ -13,7 +13,18 @@
|
|
13
13
|
|
14
14
|
## Description
|
15
15
|
|
16
|
-
[Ronin][
|
16
|
+
[Ronin][website] is a free and Open Source [Ruby] toolkit for security research
|
17
|
+
and development. Ronin contains many different [CLI commands](#snopsis) and
|
18
|
+
[Ruby libraries][ronin-rb] for a variety of security tasks, such as
|
19
|
+
encoding/decoding data, filter IPs/hosts/URLs, querying ASNs, querying DNS,
|
20
|
+
HTTP, [scanning for web vulnerabilities][ronin-vulns-synopsis],
|
21
|
+
[spidering websites][ronin-web-spider],
|
22
|
+
[install 3rd party repositories][ronin-repos-synopsis] of
|
23
|
+
[exploits][ronin-exploits] and/or
|
24
|
+
[payloads][ronin-payloads], [run exploits][ronin-exploits-synopsis],
|
25
|
+
[write new exploits][ronin-exploits-examples],
|
26
|
+
[managing local databases][ronin-db-synopsis],
|
27
|
+
[fuzzing data][ronin-fuzzer], and much more.
|
17
28
|
|
18
29
|
### Who is Ronin for?
|
19
30
|
|
@@ -139,8 +150,24 @@ Open the Ronin Ruby REPL:
|
|
139
150
|
$ ronin irb
|
140
151
|
```
|
141
152
|
|
153
|
+
### See Also
|
154
|
+
|
155
|
+
* [ronin-repos](https://github.com/ronin-rb/ronin-repos#synopsis)
|
156
|
+
* [ronin-db](https://github.com/ronin-rb/ronin-db#synopsis)
|
157
|
+
* [ronin-web](https://github.com/ronin-rb/ronin-web#synopsis)
|
158
|
+
* [ronin-fuzzer](https://github.com/ronin-rb/ronin-fuzzer#synopsis)
|
159
|
+
* [ronin-payloads](https://github.com/ronin-rb/ronin-payloads#synopsis)
|
160
|
+
* [ronin-exploits](https://github.com/ronin-rb/ronin-exploits#synopsis)
|
161
|
+
* [ronin-vulns](https://github.com/ronin-rb/ronin-vulns#synopsis)
|
162
|
+
|
142
163
|
## Requirements
|
143
164
|
|
165
|
+
* [gcc] / [clang]
|
166
|
+
* [make]
|
167
|
+
* [git]
|
168
|
+
* [libsqlite3]
|
169
|
+
* [libxml2]
|
170
|
+
* [libxslt]
|
144
171
|
* [Ruby] >= 3.0.0
|
145
172
|
* [open_namespace] ~> 0.4
|
146
173
|
* [rouge] ~> 3.0
|
@@ -160,10 +187,36 @@ $ ronin irb
|
|
160
187
|
|
161
188
|
## Install
|
162
189
|
|
190
|
+
### Bash Script
|
191
|
+
|
192
|
+
```shell
|
193
|
+
curl -o ronin-install.sh https://raw.githubusercontent.com/ronin-rb/scripts/main/ronin-install.sh && bash ronin-install.sh
|
194
|
+
```
|
195
|
+
|
196
|
+
### Manually
|
197
|
+
|
163
198
|
```shell
|
164
199
|
$ gem install ronin
|
165
200
|
```
|
166
201
|
|
202
|
+
### Docker
|
203
|
+
|
204
|
+
If you prefer using [Docker], there are also [Docker images] available:
|
205
|
+
|
206
|
+
```shell
|
207
|
+
docker pull roninrb/ronin
|
208
|
+
docker run -it ronin
|
209
|
+
```
|
210
|
+
|
211
|
+
Additionally, if you want to mount your home directory into the docker image:
|
212
|
+
|
213
|
+
```shell
|
214
|
+
docker run --mount type=bind,source="$HOME",target=/home/ronin -it ronin
|
215
|
+
```
|
216
|
+
|
217
|
+
[Docker]: https://www.docker.com/
|
218
|
+
[Docker images]: https://hub.docker.com/r/roninrb/ronin
|
219
|
+
|
167
220
|
## Development
|
168
221
|
|
169
222
|
1. [Fork It!](https://github.com/ronin-rb/ronin/fork)
|
@@ -192,7 +245,16 @@ GNU General Public License for more details.
|
|
192
245
|
You should have received a copy of the GNU General Public License
|
193
246
|
along with Ronin. If not, see <https://www.gnu.org/licenses/>.
|
194
247
|
|
195
|
-
[
|
248
|
+
[website]: https://ronin-rb.dev/
|
249
|
+
[ronin-rb]: https://github.com/ronin-rb/
|
250
|
+
|
251
|
+
[gcc]: http://gcc.gnu.org/
|
252
|
+
[clang]: http://clang.llvm.org/
|
253
|
+
[git]: https://git-scm.com/
|
254
|
+
[make]: https://www.gnu.org/software/automake/
|
255
|
+
[libxml2]: https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home
|
256
|
+
[libxslt]: http://xmlsoft.org/libxslt/index.html
|
257
|
+
[libsqlite3]: https://www.sqlite.org/index.html
|
196
258
|
[Ruby]: https://www.ruby-lang.org
|
197
259
|
[open_namespace]: https://github.com/postmodern/open_namespace#readme
|
198
260
|
[rouge]: https://github.com/rouge-ruby/rouge#readme
|
@@ -201,14 +263,20 @@ along with Ronin. If not, see <https://www.gnu.org/licenses/>.
|
|
201
263
|
|
202
264
|
[ronin-support]: https://github.com/ronin-rb/ronin-support#readme
|
203
265
|
[ronin-repos]: https://github.com/ronin-rb/ronin-repos#readme
|
266
|
+
[ronin-repos-synopsis]: https://github.com/ronin-rb/ronin-repos#synopsis
|
204
267
|
[ronin-core]: https://github.com/ronin-rb/ronin-core#readme
|
205
268
|
[ronin-db]: https://github.com/ronin-rb/ronin-db#readme
|
269
|
+
[ronin-db-synopsis]: https://github.com/ronin-rb/ronin-db#synopsis
|
206
270
|
[ronin-fuzzer]: https://github.com/ronin-rb/ronin-fuzzer#readme
|
207
271
|
[ronin-web]: https://github.com/ronin-rb/ronin-web#readme
|
272
|
+
[ronin-web-server]: https://github.com/ronin-rb/ronin-web-server#readme
|
273
|
+
[ronin-web-spider]: https://github.com/ronin-rb/ronin-web-spider#readme
|
274
|
+
[ronin-web-user_agents]: https://github.com/ronin-rb/ronin-web-user_agents#readme
|
208
275
|
[ronin-code-asm]: https://github.com/ronin-rb/ronin-code-asm#readme
|
209
276
|
[ronin-code-sql]: https://github.com/ronin-rb/ronin-code-sql#readme
|
210
277
|
[ronin-payloads]: https://github.com/ronin-rb/ronin-payloads#readme
|
211
278
|
[ronin-exploits]: https://github.com/ronin-rb/ronin-exploits#readme
|
279
|
+
[ronin-exploits-synopsis]: https://github.com/ronin-rb/ronin-exploits#synopsis
|
280
|
+
[ronin-exploits-examples]: https://github.com/ronin-rb/ronin-exploits#examples
|
212
281
|
[ronin-vulns]: https://github.com/ronin-rb/ronin-vulns#readme
|
213
|
-
|
214
|
-
[git]: https://git-scm.com/
|
282
|
+
[ronin-vulns-synopsis]: https://github.com/ronin-rb/ronin-vulns#synopsis
|
data/data/new/project/Rakefile
CHANGED
@@ -4,14 +4,14 @@ require 'rake'
|
|
4
4
|
# Example rake tasks:
|
5
5
|
#
|
6
6
|
# task :foo do
|
7
|
-
# # code here
|
7
|
+
# # code goes here
|
8
8
|
# end
|
9
9
|
#
|
10
10
|
# Namespaces:
|
11
11
|
#
|
12
12
|
# namespace :foo do
|
13
13
|
# task :bar do
|
14
|
-
# # code here
|
14
|
+
# # code goes here
|
15
15
|
# end
|
16
16
|
#
|
17
17
|
# # other tasks ...
|
@@ -33,7 +33,7 @@ require 'rake'
|
|
33
33
|
#
|
34
34
|
# file 'foo.txt' do
|
35
35
|
# File.open('foo.txt','w') do |file|
|
36
|
-
# # code here
|
36
|
+
# # code goes here
|
37
37
|
# end
|
38
38
|
# end
|
39
39
|
#
|
data/gemspec.yml
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
name: ronin
|
2
2
|
summary: A Ruby toolkit for security research and development.
|
3
3
|
description:
|
4
|
-
Ronin is a Ruby toolkit for security research and
|
4
|
+
Ronin is a free and Open Source Ruby toolkit for security research and
|
5
|
+
development.Ronin contains many different CLI commands and Ruby libraries for
|
6
|
+
a variety of security tasks, such as encoding/decoding data, filter
|
7
|
+
IPs/hosts/URLs, querying ASNs, querying DNS, HTTP, scanning for web
|
8
|
+
vulnerabilities, spidering websites, install 3rd party repositories of
|
9
|
+
exploits and/or payloads, run exploits, generating new exploits, managing
|
10
|
+
local databases, fuzzing data, and much more.
|
5
11
|
|
6
12
|
license: GPL-3.0
|
7
13
|
authors: Postmodern
|
@@ -24,10 +30,10 @@ post_install_message: |
|
|
24
30
|
*************************************************************************
|
25
31
|
|
26
32
|
metadata:
|
27
|
-
documentation_uri: https://
|
33
|
+
documentation_uri: https://ronin-rb.dev/docs/ronin
|
28
34
|
source_code_uri: https://github.com/ronin-rb/ronin
|
29
35
|
bug_tracker_uri: https://github.com/ronin-rb/ronin/issues
|
30
|
-
changelog_uri: https://github.com/ronin-rb/ronin/blob/
|
36
|
+
changelog_uri: https://github.com/ronin-rb/ronin/blob/main/ChangeLog.md
|
31
37
|
rubygems_mfa_required: 'true'
|
32
38
|
|
33
39
|
generated_files:
|
@@ -90,16 +96,16 @@ dependencies:
|
|
90
96
|
async-io: ~> 1.0
|
91
97
|
wordlist: ~> 1.0
|
92
98
|
# Ronin dependencies:
|
93
|
-
ronin-support: ~> 1.0.0.
|
99
|
+
ronin-support: ~> 1.0.0.beta2
|
94
100
|
ronin-core: ~> 0.1.0.beta1
|
95
101
|
ronin-repos: ~> 0.1.0.beta1
|
96
102
|
ronin-db: ~> 0.1.0.beta1
|
97
103
|
ronin-fuzzer: ~> 0.1.0.beta1
|
98
|
-
ronin-web: ~> 1.0.0.
|
104
|
+
ronin-web: ~> 1.0.0.beta2
|
99
105
|
ronin-code-asm: ~> 1.0.0.beta1
|
100
106
|
ronin-code-sql: ~> 2.0.0.beta1
|
101
107
|
ronin-payloads: ~> 0.1.0.beta1
|
102
|
-
ronin-exploits: ~> 1.0.0.
|
108
|
+
ronin-exploits: ~> 1.0.0.beta2
|
103
109
|
ronin-vulns: ~> 0.1.0.beta1
|
104
110
|
|
105
111
|
development_dependencies:
|
@@ -24,6 +24,7 @@ module Ronin
|
|
24
24
|
# Adds common character set options to a command.
|
25
25
|
#
|
26
26
|
# ## Options
|
27
|
+
#
|
27
28
|
# -N, --numeric Searches for numeric characters (0-9)
|
28
29
|
# -O, --octal Searches for octal characters (0-7)
|
29
30
|
# -X, --upper-hex Searches for uppercase hexadecimal (0-9, A-F)
|
@@ -53,30 +54,67 @@ module Ronin
|
|
53
54
|
# The command including {CharSetOptions}.
|
54
55
|
#
|
55
56
|
def self.included(command)
|
57
|
+
define_char_sets(command)
|
58
|
+
|
59
|
+
command.option :chars, short: '-c',
|
60
|
+
value: {
|
61
|
+
type: String,
|
62
|
+
usage: 'CHARS'
|
63
|
+
},
|
64
|
+
desc: 'Searches for all chars in the custom char-set' do |string|
|
65
|
+
@char_set = Chars::CharSet.new(*string.chars)
|
66
|
+
end
|
67
|
+
|
68
|
+
command.option :include_chars, short: '-i',
|
69
|
+
value: {
|
70
|
+
type: String,
|
71
|
+
usage: 'CHARS',
|
72
|
+
},
|
73
|
+
desc: 'Include the additional chars to the char-set' do |string|
|
74
|
+
@char_set += Chars::CharSet.new(*string.chars)
|
75
|
+
end
|
76
|
+
|
77
|
+
command.option :exclude_chars, short: '-e',
|
78
|
+
value: {
|
79
|
+
type: String,
|
80
|
+
usage: 'CHARS'
|
81
|
+
},
|
82
|
+
desc: 'Exclude the additional chars from the char-set' do |string|
|
83
|
+
@char_set -= Chars::CharSet.new(*string.chars)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
#
|
88
|
+
# Define options for each major character set.
|
89
|
+
#
|
90
|
+
# @param [Class<Command>] command
|
91
|
+
# The command including {CharSetOptions}.
|
92
|
+
#
|
93
|
+
def self.define_char_sets(command)
|
56
94
|
command.option :numeric, short: '-N',
|
57
|
-
|
58
|
-
|
59
|
-
|
95
|
+
desc: 'Searches for numeric characters (0-9)' do
|
96
|
+
@char_set = Chars::NUMERIC
|
97
|
+
end
|
60
98
|
|
61
99
|
command.option :octal, short: '-O',
|
62
|
-
|
63
|
-
|
64
|
-
|
100
|
+
desc: 'Searches for octal characters (0-7)' do
|
101
|
+
@char_set = Chars::OCTAL
|
102
|
+
end
|
65
103
|
|
66
104
|
command.option :upper_hex, short: '-X',
|
67
|
-
|
68
|
-
|
69
|
-
|
105
|
+
desc: 'Searches for uppercase hexadecimal (0-9, A-F)' do
|
106
|
+
@char_set = Chars::UPPERCASE_HEXADECIMAL
|
107
|
+
end
|
70
108
|
|
71
109
|
command.option :lower_hex, short: '-x',
|
72
|
-
|
73
|
-
|
74
|
-
|
110
|
+
desc: 'Searches for lowercase hexadecimal (0-9, a-f)' do
|
111
|
+
@char_set = Chars::LOWERCASE_HEXADECIMAL
|
112
|
+
end
|
75
113
|
|
76
114
|
command.option :hex, short: '-H',
|
77
|
-
|
78
|
-
|
79
|
-
|
115
|
+
desc: 'Searches for hexadecimal chars (0-9, a-f, A-F)' do
|
116
|
+
@char_set = Chars::HEXADECIMAL
|
117
|
+
end
|
80
118
|
|
81
119
|
command.option :upper_alpha, desc: 'Searches for uppercase alpha chars (A-Z)' do
|
82
120
|
@char_set = Chars::UPPERCASE_ALPHA
|
@@ -87,82 +125,57 @@ module Ronin
|
|
87
125
|
end
|
88
126
|
|
89
127
|
command.option :alpha, short: '-A',
|
90
|
-
|
91
|
-
|
92
|
-
|
128
|
+
desc: 'Searches for alpha chars (a-z, A-Z)' do
|
129
|
+
@char_set = Chars::ALPHA
|
130
|
+
end
|
93
131
|
|
94
132
|
command.option :alpha_num, desc: 'Searches for alpha-numeric chars (a-z, A-Z, 0-9)' do
|
95
133
|
@char_set = Chars::ALPHA_NUMERIC
|
96
134
|
end
|
97
135
|
|
98
136
|
command.option :punct, short: '-P',
|
99
|
-
|
100
|
-
|
101
|
-
|
137
|
+
desc: 'Searches for punctuation chars' do
|
138
|
+
@char_set = Chars::PUNCTUATION
|
139
|
+
end
|
102
140
|
|
103
141
|
command.option :symbols, short: '-S',
|
104
|
-
|
105
|
-
|
106
|
-
|
142
|
+
desc: 'Searches for symbolic chars' do
|
143
|
+
@char_set = Chars::SYMBOLS
|
144
|
+
end
|
107
145
|
|
108
146
|
command.option :space, short: '-s',
|
109
|
-
|
110
|
-
|
111
|
-
|
147
|
+
desc: 'Searches for all whitespace chars' do
|
148
|
+
@char_set = Chars::SPACE
|
149
|
+
end
|
112
150
|
|
113
151
|
command.option :visible, short: '-v',
|
114
|
-
|
115
|
-
|
116
|
-
|
152
|
+
desc: 'Searches for all visible chars' do
|
153
|
+
@char_set = Chars::VISIBLE
|
154
|
+
end
|
117
155
|
|
118
156
|
command.option :printable, short: '-p',
|
119
|
-
|
120
|
-
|
121
|
-
|
157
|
+
desc: 'Searches for all printable chars' do
|
158
|
+
@char_set = Chars::PRINTABLE
|
159
|
+
end
|
122
160
|
|
123
161
|
command.option :control, short: '-C',
|
124
|
-
|
125
|
-
|
126
|
-
|
162
|
+
desc: 'Searches for all control chars (\x00-\x1f, \x7f)' do
|
163
|
+
@char_set = Chars::CONTROL
|
164
|
+
end
|
127
165
|
|
128
166
|
command.option :signed_ascii, short: '-a',
|
129
|
-
|
130
|
-
|
131
|
-
|
167
|
+
desc: 'Searches for all signed ASCII chars (\x00-\x7f)' do
|
168
|
+
@char_set = Chars::SIGNED_ASCII
|
169
|
+
end
|
132
170
|
|
133
171
|
command.option :ascii, desc: 'Searches for all ASCII chars (\x00-\xff)' do
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
command.option :chars, short: '-c',
|
138
|
-
value: {
|
139
|
-
type: String,
|
140
|
-
usage: 'CHARS'
|
141
|
-
},
|
142
|
-
desc: 'Searches for all chars in the custom char-set' do |string|
|
143
|
-
@char_set = Chars::CharSet.new(*string.chars)
|
144
|
-
end
|
145
|
-
|
146
|
-
command.option :include_chars, short: '-i',
|
147
|
-
value: {
|
148
|
-
type: String,
|
149
|
-
usage: 'CHARS',
|
150
|
-
},
|
151
|
-
desc: 'Include the additional chars to the char-set' do |string|
|
152
|
-
@char_set += Chars::CharSet.new(*string.chars)
|
153
|
-
end
|
154
|
-
|
155
|
-
command.option :exclude_chars, short: '-e',
|
156
|
-
value: {
|
157
|
-
type: String,
|
158
|
-
usage: 'CHARS'
|
159
|
-
},
|
160
|
-
desc: 'Exclude the additional chars from the char-set' do |string|
|
161
|
-
@char_set -= Chars::CharSet.new(*string.chars)
|
162
|
-
end
|
172
|
+
@char_set = Chars::ASCII
|
173
|
+
end
|
163
174
|
end
|
164
175
|
|
165
176
|
# The set character set.
|
177
|
+
#
|
178
|
+
# @return [Chars::CharSet, nil]
|
166
179
|
attr_reader :char_set
|
167
180
|
|
168
181
|
#
|
@@ -17,6 +17,7 @@
|
|
17
17
|
#
|
18
18
|
|
19
19
|
require 'ronin/cli/value_processor_command'
|
20
|
+
require 'ronin/cli/dns'
|
20
21
|
require 'ronin/support/network/dns'
|
21
22
|
|
22
23
|
module Ronin
|
@@ -43,16 +44,9 @@ module Ronin
|
|
43
44
|
#
|
44
45
|
class Dns < ValueProcessorCommand
|
45
46
|
|
46
|
-
|
47
|
+
include DNS
|
47
48
|
|
48
|
-
|
49
|
-
value: {
|
50
|
-
type: String,
|
51
|
-
usage: 'HOST|IP'
|
52
|
-
},
|
53
|
-
desc: 'Send DNS queries to the nameserver' do |ip|
|
54
|
-
@nameservers << ip
|
55
|
-
end
|
49
|
+
usage '[options] HOST'
|
56
50
|
|
57
51
|
option :type, short: '-t',
|
58
52
|
value: {
|
@@ -82,29 +76,6 @@ module Ronin
|
|
82
76
|
|
83
77
|
man_page 'ronin-dns.1'
|
84
78
|
|
85
|
-
#
|
86
|
-
# Initializes the `ronin dns` command.
|
87
|
-
#
|
88
|
-
def initialize(**kwargs)
|
89
|
-
super(**kwargs)
|
90
|
-
|
91
|
-
@nameservers = []
|
92
|
-
end
|
93
|
-
|
94
|
-
#
|
95
|
-
# The resolver to use.
|
96
|
-
#
|
97
|
-
# @return [Ronin::Network::DNS::Resolver]
|
98
|
-
# The DNS resolver.
|
99
|
-
#
|
100
|
-
def resolver
|
101
|
-
@resolver ||= unless @nameservers.empty?
|
102
|
-
Support::Network::DNS.resolver(nameservers: @nameservers)
|
103
|
-
else
|
104
|
-
Support::Network::DNS.resolver
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
79
|
#
|
109
80
|
# Queries the given host.
|
110
81
|
#
|
@@ -114,69 +85,6 @@ module Ronin
|
|
114
85
|
print_records(query_records(host))
|
115
86
|
end
|
116
87
|
|
117
|
-
#
|
118
|
-
# Queries the records for the given host name.
|
119
|
-
#
|
120
|
-
# @param [String] host
|
121
|
-
# The host name to query.
|
122
|
-
#
|
123
|
-
# @return [Array<Resolv::DNS::Resource>]
|
124
|
-
# The returned DNS resource records.
|
125
|
-
#
|
126
|
-
def query_records(host)
|
127
|
-
if options[:type]
|
128
|
-
resolver.get_records(host,options[:type].downcase)
|
129
|
-
else
|
130
|
-
resolver.get_a_records(host) + resolver.get_aaaa_records(host)
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
#
|
135
|
-
# Prints multiple DNS records.
|
136
|
-
#
|
137
|
-
# @param [Array<Resolv::DNS::Resource>] records
|
138
|
-
# The DNS resource records to print.
|
139
|
-
#
|
140
|
-
def print_records(records)
|
141
|
-
records.each do |record|
|
142
|
-
print_record(record)
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
#
|
147
|
-
# Prints a DNS record.
|
148
|
-
#
|
149
|
-
# @param [Resolv::DNS::Resource] record
|
150
|
-
# The DNS resource record to print.
|
151
|
-
#
|
152
|
-
def print_record(record)
|
153
|
-
case record
|
154
|
-
when Resolv::DNS::Resource::IN::A,
|
155
|
-
Resolv::DNS::Resource::IN::AAAA
|
156
|
-
puts record.address
|
157
|
-
when Resolv::DNS::Resource::IN::NS,
|
158
|
-
Resolv::DNS::Resource::IN::CNAME,
|
159
|
-
Resolv::DNS::Resource::IN::PTR
|
160
|
-
puts record.name
|
161
|
-
when Resolv::DNS::Resource::IN::MX
|
162
|
-
puts record.exchange
|
163
|
-
when Resolv::DNS::Resource::IN::TXT
|
164
|
-
puts record.strings.join
|
165
|
-
when Resolv::DNS::Resource::IN::HINFO
|
166
|
-
puts "#{record.cpu} #{record.os}"
|
167
|
-
when Resolv::DNS::Resource::IN::LOC
|
168
|
-
puts "#{record.latitude} #{record.longitude}"
|
169
|
-
when Resolv::DNS::Resource::IN::MINFO
|
170
|
-
puts "#{record.emailbx}@#{record.rmailbx}"
|
171
|
-
when Resolv::DNS::Resource::IN::SOA
|
172
|
-
puts "#{record.mname} #{record.rname} #{record.serial} #{record.refresh} #{record.retry} #{record.expire} #{record.ttl}"
|
173
|
-
when Resolv::DNS::Resource::IN::SRV
|
174
|
-
puts "#{record.port} #{record.priority} #{record.weight} #{record.target}"
|
175
|
-
when Resolv::DNS::Resource::IN::WKS
|
176
|
-
puts "#{record.address} #{record.protocol}"
|
177
|
-
end
|
178
|
-
end
|
179
|
-
|
180
88
|
end
|
181
89
|
end
|
182
90
|
end
|
@@ -49,7 +49,7 @@ module Ronin
|
|
49
49
|
# --phone-number Searches for all phone numbers
|
50
50
|
# --ssn Searches for all Social Security Numbers (SSNs)
|
51
51
|
# --amex-cc Searches for all AMEX Credit Card numbers
|
52
|
-
# --discover-cc Searches for all
|
52
|
+
# --discover-cc Searches for all Discover Card numbers
|
53
53
|
# --mastercard-cc Searches for all MasterCard numbers
|
54
54
|
# --visa-cc Searches for all VISA Credit Card numbers
|
55
55
|
# --visa-mastercard-cc Searches for all VISA MasterCard numbers
|
@@ -65,7 +65,9 @@ module Ronin
|
|
65
65
|
# --relative-path Searches for all relative paths
|
66
66
|
# --absolute-path Searches for all absolute paths
|
67
67
|
# -P, --path Searches for all paths
|
68
|
+
# --identifier Searches for all identifier names
|
68
69
|
# --variable-name Searches for all variable names
|
70
|
+
# --variable-assignment Searches for all variable assignments
|
69
71
|
# --function-name Searches for all function names
|
70
72
|
# --md5 Searches for all MD5 hashes
|
71
73
|
# --sha1 Searches for all SHA1 hashes
|
@@ -73,19 +75,27 @@ module Ronin
|
|
73
75
|
# --sha512 Searches for all SHA512 hashes
|
74
76
|
# --hash Searches for all hashes
|
75
77
|
# --ssh-private-key Searches for all SSH private key data
|
76
|
-
# --
|
78
|
+
# --dsa-private-key Searches for all DSA private key data
|
79
|
+
# --ec-private-key Searches for all EC private key data
|
80
|
+
# --rsa-private-key Searches for all RSA private key data
|
77
81
|
# -K, --private-key Searches for all private key data
|
78
|
-
# --
|
79
|
-
# --dsa-public-key Searches for all DSA public key data
|
80
|
-
# --ec-public-key Searches for all EC public key data
|
82
|
+
# --ssh-public-key Searches for all SSH public key data
|
81
83
|
# --public-key Searches for all public key data
|
82
84
|
# --aws-access-key-id Searches for all AWS access key IDs
|
83
|
-
# --aws-secret-access-key Searches for all AWS secret access
|
84
|
-
# -A, --api-key
|
85
|
+
# --aws-secret-access-key Searches for all AWS secret access keys
|
86
|
+
# -A, --api-key Searches for all API keys
|
85
87
|
# --single-quoted-string Searches for all single-quoted strings
|
86
88
|
# --double-quoted-string Searches for all double-quoted strings
|
87
89
|
# -S, --string Searches for all quoted strings
|
88
90
|
# -B, --base64 Searches for all Base64 strings
|
91
|
+
# --c-comment Searches for all C comments
|
92
|
+
# --cpp-comment Searches for all C++ comments
|
93
|
+
# --java-comment Searches for all Java comments
|
94
|
+
# --javascript-comment Searches for all JavaScript comments
|
95
|
+
# --shell-comment Searches for all Shell comments
|
96
|
+
# --ruby-comment Searches for all Ruby comments
|
97
|
+
# --python-comment Searches for all Python comments
|
98
|
+
# --comment Searches for all comments
|
89
99
|
# -e, --regexp /REGEXP/ Custom regular expression to search for
|
90
100
|
# -h, --help Print help information
|
91
101
|
#
|
@@ -51,7 +51,7 @@ module Ronin
|
|
51
51
|
# --phone-number Searches for all phone numbers
|
52
52
|
# --ssn Searches for all Social Security Numbers (SSNs)
|
53
53
|
# --amex-cc Searches for all AMEX Credit Card numbers
|
54
|
-
# --discover-cc Searches for all
|
54
|
+
# --discover-cc Searches for all Discover Card numbers
|
55
55
|
# --mastercard-cc Searches for all MasterCard numbers
|
56
56
|
# --visa-cc Searches for all VISA Credit Card numbers
|
57
57
|
# --visa-mastercard-cc Searches for all VISA MasterCard numbers
|
@@ -67,7 +67,9 @@ module Ronin
|
|
67
67
|
# --relative-path Searches for all relative paths
|
68
68
|
# --absolute-path Searches for all absolute paths
|
69
69
|
# -P, --path Searches for all paths
|
70
|
+
# --identifier Searches for all identifier names
|
70
71
|
# --variable-name Searches for all variable names
|
72
|
+
# --variable-assignment Searches for all variable assignments
|
71
73
|
# --function-name Searches for all function names
|
72
74
|
# --md5 Searches for all MD5 hashes
|
73
75
|
# --sha1 Searches for all SHA1 hashes
|
@@ -75,19 +77,27 @@ module Ronin
|
|
75
77
|
# --sha512 Searches for all SHA512 hashes
|
76
78
|
# --hash Searches for all hashes
|
77
79
|
# --ssh-private-key Searches for all SSH private key data
|
78
|
-
# --
|
80
|
+
# --dsa-private-key Searches for all DSA private key data
|
81
|
+
# --ec-private-key Searches for all EC private key data
|
82
|
+
# --rsa-private-key Searches for all RSA private key data
|
79
83
|
# -K, --private-key Searches for all private key data
|
80
|
-
# --
|
81
|
-
# --dsa-public-key Searches for all DSA public key data
|
82
|
-
# --ec-public-key Searches for all EC public key data
|
84
|
+
# --ssh-public-key Searches for all SSH public key data
|
83
85
|
# --public-key Searches for all public key data
|
84
86
|
# --aws-access-key-id Searches for all AWS access key IDs
|
85
|
-
# --aws-secret-access-key Searches for all AWS secret access
|
86
|
-
# -A, --api-key
|
87
|
+
# --aws-secret-access-key Searches for all AWS secret access keys
|
88
|
+
# -A, --api-key Searches for all API keys
|
87
89
|
# --single-quoted-string Searches for all single-quoted strings
|
88
90
|
# --double-quoted-string Searches for all double-quoted strings
|
89
91
|
# -S, --string Searches for all quoted strings
|
90
92
|
# -B, --base64 Searches for all Base64 strings
|
93
|
+
# --c-comment Searches for all C comments
|
94
|
+
# --cpp-comment Searches for all C++ comments
|
95
|
+
# --java-comment Searches for all Java comments
|
96
|
+
# --javascript-comment Searches for all JavaScript comments
|
97
|
+
# --shell-comment Searches for all Shell comments
|
98
|
+
# --ruby-comment Searches for all Ruby comments
|
99
|
+
# --python-comment Searches for all Python comments
|
100
|
+
# --comment Searches for all comments
|
91
101
|
# -e, --regexp /REGEXP/ Custom regular expression to search for
|
92
102
|
# -o, --only-matching Only print the matching data
|
93
103
|
# -n, --line-number Print the line number for each line
|