ronin-recon 0.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +4 -0
- data/.github/workflows/ruby.yml +46 -0
- data/.gitignore +20 -0
- data/.rspec +1 -0
- data/.rubocop.yml +44 -0
- data/.ruby-version +1 -0
- data/.yardopts +1 -0
- data/COPYING.txt +165 -0
- data/ChangeLog.md +36 -0
- data/Gemfile +62 -0
- data/README.md +391 -0
- data/Rakefile +74 -0
- data/bin/ronin-recon +16 -0
- data/data/completions/ronin-recon +95 -0
- data/data/templates/worker.rb.erb +67 -0
- data/data/wordlists/raft-small-directories.txt.gz +0 -0
- data/data/wordlists/subdomains-1000.txt.gz +0 -0
- data/examples/recon.rb +24 -0
- data/gemspec.yml +57 -0
- data/lib/ronin/recon/builtin/dns/lookup.rb +65 -0
- data/lib/ronin/recon/builtin/dns/mailservers.rb +64 -0
- data/lib/ronin/recon/builtin/dns/nameservers.rb +61 -0
- data/lib/ronin/recon/builtin/dns/reverse_lookup.rb +63 -0
- data/lib/ronin/recon/builtin/dns/srv_enum.rb +178 -0
- data/lib/ronin/recon/builtin/dns/subdomain_enum.rb +105 -0
- data/lib/ronin/recon/builtin/dns/suffix_enum.rb +168 -0
- data/lib/ronin/recon/builtin/net/ip_range_enum.rb +65 -0
- data/lib/ronin/recon/builtin/net/port_scan.rb +84 -0
- data/lib/ronin/recon/builtin/net/service_id.rb +75 -0
- data/lib/ronin/recon/builtin/ssl/cert_enum.rb +109 -0
- data/lib/ronin/recon/builtin/ssl/cert_grab.rb +76 -0
- data/lib/ronin/recon/builtin/ssl/cert_sh.rb +77 -0
- data/lib/ronin/recon/builtin/web/dir_enum.rb +121 -0
- data/lib/ronin/recon/builtin/web/email_addresses.rb +70 -0
- data/lib/ronin/recon/builtin/web/spider.rb +93 -0
- data/lib/ronin/recon/builtin.rb +34 -0
- data/lib/ronin/recon/cli/command.rb +40 -0
- data/lib/ronin/recon/cli/commands/completion.rb +61 -0
- data/lib/ronin/recon/cli/commands/irb.rb +57 -0
- data/lib/ronin/recon/cli/commands/new.rb +203 -0
- data/lib/ronin/recon/cli/commands/run.rb +420 -0
- data/lib/ronin/recon/cli/commands/test.rb +99 -0
- data/lib/ronin/recon/cli/commands/worker.rb +114 -0
- data/lib/ronin/recon/cli/commands/workers.rb +80 -0
- data/lib/ronin/recon/cli/debug_option.rb +45 -0
- data/lib/ronin/recon/cli/printing.rb +122 -0
- data/lib/ronin/recon/cli/ruby_shell.rb +51 -0
- data/lib/ronin/recon/cli/worker_command.rb +105 -0
- data/lib/ronin/recon/cli.rb +50 -0
- data/lib/ronin/recon/config.rb +371 -0
- data/lib/ronin/recon/dns_worker.rb +41 -0
- data/lib/ronin/recon/engine.rb +639 -0
- data/lib/ronin/recon/exceptions.rb +45 -0
- data/lib/ronin/recon/graph.rb +127 -0
- data/lib/ronin/recon/importer.rb +224 -0
- data/lib/ronin/recon/input_file.rb +81 -0
- data/lib/ronin/recon/message/job_completed.rb +60 -0
- data/lib/ronin/recon/message/job_failed.rb +69 -0
- data/lib/ronin/recon/message/job_started.rb +60 -0
- data/lib/ronin/recon/message/shutdown.rb +38 -0
- data/lib/ronin/recon/message/value.rb +76 -0
- data/lib/ronin/recon/message/worker_started.rb +51 -0
- data/lib/ronin/recon/message/worker_stopped.rb +51 -0
- data/lib/ronin/recon/mixins/dns.rb +639 -0
- data/lib/ronin/recon/mixins/http.rb +58 -0
- data/lib/ronin/recon/mixins.rb +21 -0
- data/lib/ronin/recon/output_formats/dir.rb +94 -0
- data/lib/ronin/recon/output_formats/dot.rb +155 -0
- data/lib/ronin/recon/output_formats/graph_format.rb +48 -0
- data/lib/ronin/recon/output_formats/graphviz_format.rb +115 -0
- data/lib/ronin/recon/output_formats/pdf.rb +43 -0
- data/lib/ronin/recon/output_formats/png.rb +43 -0
- data/lib/ronin/recon/output_formats/svg.rb +43 -0
- data/lib/ronin/recon/output_formats.rb +48 -0
- data/lib/ronin/recon/registry.rb +35 -0
- data/lib/ronin/recon/root.rb +33 -0
- data/lib/ronin/recon/scope.rb +112 -0
- data/lib/ronin/recon/value/parser.rb +113 -0
- data/lib/ronin/recon/value.rb +110 -0
- data/lib/ronin/recon/value_status.rb +87 -0
- data/lib/ronin/recon/values/cert.rb +168 -0
- data/lib/ronin/recon/values/domain.rb +88 -0
- data/lib/ronin/recon/values/email_address.rb +114 -0
- data/lib/ronin/recon/values/host.rb +137 -0
- data/lib/ronin/recon/values/ip.rb +123 -0
- data/lib/ronin/recon/values/ip_range.rb +155 -0
- data/lib/ronin/recon/values/mailserver.rb +61 -0
- data/lib/ronin/recon/values/nameserver.rb +61 -0
- data/lib/ronin/recon/values/open_port.rb +190 -0
- data/lib/ronin/recon/values/url.rb +218 -0
- data/lib/ronin/recon/values/website.rb +200 -0
- data/lib/ronin/recon/values/wildcard.rb +140 -0
- data/lib/ronin/recon/values.rb +32 -0
- data/lib/ronin/recon/version.rb +26 -0
- data/lib/ronin/recon/web_worker.rb +35 -0
- data/lib/ronin/recon/worker.rb +433 -0
- data/lib/ronin/recon/worker_pool.rb +203 -0
- data/lib/ronin/recon/workers.rb +260 -0
- data/lib/ronin/recon.rb +22 -0
- data/man/ronin-recon-completion.1 +76 -0
- data/man/ronin-recon-completion.1.md +78 -0
- data/man/ronin-recon-irb.1 +27 -0
- data/man/ronin-recon-irb.1.md +26 -0
- data/man/ronin-recon-new.1 +58 -0
- data/man/ronin-recon-new.1.md +59 -0
- data/man/ronin-recon-run.1 +137 -0
- data/man/ronin-recon-run.1.md +115 -0
- data/man/ronin-recon-test.1 +53 -0
- data/man/ronin-recon-test.1.md +55 -0
- data/man/ronin-recon-worker.1 +32 -0
- data/man/ronin-recon-worker.1.md +34 -0
- data/man/ronin-recon-workers.1 +29 -0
- data/man/ronin-recon-workers.1.md +31 -0
- data/man/ronin-recon.1 +57 -0
- data/man/ronin-recon.1.md +57 -0
- data/ronin-recon.gemspec +62 -0
- data/scripts/setup +58 -0
- metadata +364 -0
@@ -0,0 +1,127 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-recon - A micro-framework and tool for performing reconnaissance.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-recon is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published
|
9
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# ronin-recon is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
18
|
+
# along with ronin-recon. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'set'
|
22
|
+
|
23
|
+
module Ronin
|
24
|
+
module Recon
|
25
|
+
#
|
26
|
+
# Represents a directed graph of discovered values and their parent values.
|
27
|
+
#
|
28
|
+
class Graph
|
29
|
+
|
30
|
+
# The nodes in the graph.
|
31
|
+
#
|
32
|
+
# @return [Set<Value>]
|
33
|
+
attr_reader :nodes
|
34
|
+
|
35
|
+
# The edges between nodes in the graph.
|
36
|
+
#
|
37
|
+
# @return [Hash{Value => Set<Value>}]
|
38
|
+
attr_reader :edges
|
39
|
+
|
40
|
+
#
|
41
|
+
# Initializes the graph.
|
42
|
+
#
|
43
|
+
# @api private
|
44
|
+
#
|
45
|
+
def initialize
|
46
|
+
@nodes = Set.new
|
47
|
+
@edges = {}
|
48
|
+
end
|
49
|
+
|
50
|
+
#
|
51
|
+
# Adds a value to the graph, if it already hasn't been added.
|
52
|
+
#
|
53
|
+
# @param [Values::Value] new_value
|
54
|
+
# The new value node to add.
|
55
|
+
#
|
56
|
+
# @return [Boolean]
|
57
|
+
# Indicates whether the value node was successfully added to the graph,
|
58
|
+
# or if the value node was already added to the graph.
|
59
|
+
#
|
60
|
+
# @api private
|
61
|
+
#
|
62
|
+
def add_node(new_value)
|
63
|
+
!@nodes.add?(new_value).nil?
|
64
|
+
end
|
65
|
+
|
66
|
+
#
|
67
|
+
# Adds a value to the graph, if it already hasn't been added.
|
68
|
+
#
|
69
|
+
# @param [Values::Value] new_value
|
70
|
+
# The new value node to add.
|
71
|
+
#
|
72
|
+
# @param [Value, nil] parent_value
|
73
|
+
# The parent value node of the new value node.
|
74
|
+
#
|
75
|
+
# @return [Boolean]
|
76
|
+
# Indicates whether the value node was successfully added to the graph,
|
77
|
+
# or if the value node was already added to the graph.
|
78
|
+
#
|
79
|
+
# @api private
|
80
|
+
#
|
81
|
+
def add_edge(new_value,parent_value)
|
82
|
+
if parent_value
|
83
|
+
node_parents = (@edges[new_value] ||= Set.new)
|
84
|
+
|
85
|
+
return !node_parents.add?(parent_value).nil?
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
#
|
90
|
+
# Determines if the value is in the graph.
|
91
|
+
#
|
92
|
+
# @param [Values::Value] value
|
93
|
+
# The value node.
|
94
|
+
#
|
95
|
+
# @return [Boolean]
|
96
|
+
# Indicates whether the value exists in the graph or not.
|
97
|
+
#
|
98
|
+
def include?(value)
|
99
|
+
@nodes.include?(value)
|
100
|
+
end
|
101
|
+
|
102
|
+
#
|
103
|
+
# Fetches the parent value nodes for the value.
|
104
|
+
#
|
105
|
+
# @param [Values::Value] value
|
106
|
+
# The value node to lookup.
|
107
|
+
#
|
108
|
+
# @return [Set<Value>, nil]
|
109
|
+
# The set of parent value nodes or `nil` if the value does not exist in
|
110
|
+
# the graph.
|
111
|
+
#
|
112
|
+
def [](value)
|
113
|
+
@edges[value]
|
114
|
+
end
|
115
|
+
|
116
|
+
#
|
117
|
+
# Determines if the graph is empty.
|
118
|
+
#
|
119
|
+
# @return [Boolean]
|
120
|
+
#
|
121
|
+
def empty?
|
122
|
+
@nodes.empty?
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,224 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-recon - A micro-framework and tool for performing reconnaissance.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-recon is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published
|
9
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# ronin-recon is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
18
|
+
# along with ronin-recon. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'ronin/recon/values'
|
22
|
+
|
23
|
+
require 'ronin/db'
|
24
|
+
|
25
|
+
module Ronin
|
26
|
+
module Recon
|
27
|
+
#
|
28
|
+
# Handles importing recon values into [ronin-db].
|
29
|
+
#
|
30
|
+
# [ronin-db]: https://github.com/ronin-rb/ronin-db#readme
|
31
|
+
#
|
32
|
+
# ## Examples
|
33
|
+
#
|
34
|
+
# require 'ronin/db'
|
35
|
+
# require 'ronin/recon/importer'
|
36
|
+
#
|
37
|
+
# Ronin::DB.connect
|
38
|
+
#
|
39
|
+
# values = [Ronin::Recon::Values::Domain.new('...'), ...]
|
40
|
+
#
|
41
|
+
# Ronin::Recon::Engine.run(values) do |engine|
|
42
|
+
# engine.on(:value) do |value|
|
43
|
+
# puts "Fond new value #{value}"
|
44
|
+
# Ronin::Recon::Importer.import_value(value)
|
45
|
+
# end
|
46
|
+
# end
|
47
|
+
#
|
48
|
+
module Importer
|
49
|
+
#
|
50
|
+
# Imports the connection between two values.
|
51
|
+
#
|
52
|
+
# @param [Values::Value] value
|
53
|
+
# A discovered recon value to import.
|
54
|
+
#
|
55
|
+
# @param [Values::Value] parent
|
56
|
+
# The parent value of the discovered recon value.
|
57
|
+
#
|
58
|
+
# @return [(Ronin::DB::Model, Ronin::DB::Model)]
|
59
|
+
# The imported value and the imported parent value.
|
60
|
+
#
|
61
|
+
def self.import_connection(value,parent)
|
62
|
+
imported_value = import_value(value)
|
63
|
+
imported_parent = import_value(parent)
|
64
|
+
|
65
|
+
if imported_value.kind_of?(DB::IPAddress) &&
|
66
|
+
imported_parent.kind_of?(DB::HostName)
|
67
|
+
imported_value.host_name_ip_addresses.find_or_create_by(
|
68
|
+
host_name: imported_parent
|
69
|
+
)
|
70
|
+
elsif imported_value.kind_of?(DB::Cert) &&
|
71
|
+
imported_parent.kind_of?(DB::OpenPort)
|
72
|
+
imported_parent.update(cert: imported_value)
|
73
|
+
end
|
74
|
+
|
75
|
+
return imported_value, imported_parent
|
76
|
+
end
|
77
|
+
|
78
|
+
#
|
79
|
+
# Imports a value into the database.
|
80
|
+
#
|
81
|
+
# @param [Values::Value] value
|
82
|
+
# A discovered recon value to import.
|
83
|
+
#
|
84
|
+
# @return [Ronin::DB::HostName,
|
85
|
+
# Ronin::DB::IPAddress,
|
86
|
+
# Ronin::DB::OpenPort,
|
87
|
+
# Ronin::DB::URL,
|
88
|
+
# Ronin::DB::Cert]
|
89
|
+
# The imported record.
|
90
|
+
#
|
91
|
+
def self.import_value(value)
|
92
|
+
case value
|
93
|
+
when Values::Host then import_host_name(value.name)
|
94
|
+
when Values::IP then import_ip_address(value.address)
|
95
|
+
when Values::OpenPort then import_open_port(value)
|
96
|
+
when Values::URL then import_url(value.uri)
|
97
|
+
when Values::Cert then import_cert(value.cert)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
#
|
102
|
+
# Imports a host value.
|
103
|
+
#
|
104
|
+
# @param [String] host_name
|
105
|
+
# The host name to import.
|
106
|
+
#
|
107
|
+
# @return [Ronin::DB::HostName]
|
108
|
+
# The imported host name record.
|
109
|
+
#
|
110
|
+
def self.import_host_name(host_name)
|
111
|
+
DB::HostName.transaction do
|
112
|
+
DB::HostName.find_or_import(host_name)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
#
|
117
|
+
# Imports a IP address.
|
118
|
+
#
|
119
|
+
# @param [String] address
|
120
|
+
# The IP address to import.
|
121
|
+
#
|
122
|
+
# @return [Ronin::DB::IPAddress]
|
123
|
+
# The imported IP address record.
|
124
|
+
#
|
125
|
+
def self.import_ip_address(address)
|
126
|
+
DB::IPAddress.transaction do
|
127
|
+
DB::IPAddress.find_or_import(address)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
#
|
132
|
+
# Imports a URL.
|
133
|
+
#
|
134
|
+
# @param [URI::HTTP, String] url
|
135
|
+
# The URL string to import.
|
136
|
+
#
|
137
|
+
# @return [Ronin::DB::URL]
|
138
|
+
# The imported URL record.
|
139
|
+
#
|
140
|
+
def self.import_url(url)
|
141
|
+
DB::URL.transaction do
|
142
|
+
DB::URL.find_or_import(url)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
#
|
147
|
+
# Imports a port number.
|
148
|
+
#
|
149
|
+
# @param [:tcp, :udp] protocol
|
150
|
+
# The protocol that the port uses.
|
151
|
+
#
|
152
|
+
# @param [Integer] number
|
153
|
+
# The port number to import.
|
154
|
+
#
|
155
|
+
# @return [Ronin::DB::Port]
|
156
|
+
# The imported port record.
|
157
|
+
#
|
158
|
+
def self.import_port(protocol,number)
|
159
|
+
DB::Port.transaction do
|
160
|
+
DB::Port.find_or_create_by(
|
161
|
+
protocol: protocol,
|
162
|
+
number: number
|
163
|
+
)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
#
|
168
|
+
# Imports a service name.
|
169
|
+
#
|
170
|
+
# @param [String] service
|
171
|
+
# The service name to import.
|
172
|
+
#
|
173
|
+
# @return [Ronin::DB::Service]
|
174
|
+
# The imported service record.
|
175
|
+
#
|
176
|
+
def self.import_service(service)
|
177
|
+
DB::Service.transaction do
|
178
|
+
DB::Service.find_or_import(service)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
#
|
183
|
+
# Imports an open port value.
|
184
|
+
#
|
185
|
+
# @param [Values::OpenPort] open_port
|
186
|
+
# The open port value to import.
|
187
|
+
#
|
188
|
+
# @return [Ronin::DB::Open_port]
|
189
|
+
# The imported open port record.
|
190
|
+
#
|
191
|
+
def self.import_open_port(open_port)
|
192
|
+
imported_ip_address = import_ip_address(open_port.address)
|
193
|
+
imported_port = import_port(open_port.protocol,open_port.number)
|
194
|
+
imported_service = if (service = open_port.service)
|
195
|
+
import_service(service)
|
196
|
+
end
|
197
|
+
imported_open_port = DB::OpenPort.transaction do
|
198
|
+
DB::OpenPort.find_or_create_by(
|
199
|
+
ip_address: imported_ip_address,
|
200
|
+
port: imported_port,
|
201
|
+
service: imported_service
|
202
|
+
)
|
203
|
+
end
|
204
|
+
|
205
|
+
return imported_open_port
|
206
|
+
end
|
207
|
+
|
208
|
+
#
|
209
|
+
# Imports a SSL/TLS certificate.
|
210
|
+
#
|
211
|
+
# @param [Ronin::Support::Crypto::Cert, OpenSSL::X509::Certificate] cert
|
212
|
+
# The SSL/TLS certificate to import.
|
213
|
+
#
|
214
|
+
# @return [Ronin::DB::Cert]
|
215
|
+
# The imported certificate.
|
216
|
+
#
|
217
|
+
def self.import_cert(cert)
|
218
|
+
DB::Cert.transaction do
|
219
|
+
DB::Cert.find_or_import(cert)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-recon - A micro-framework and tool for performing reconnaissance.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-recon is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published
|
9
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# ronin-recon is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
18
|
+
# along with ronin-recon. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'ronin/recon/value/parser'
|
22
|
+
|
23
|
+
module Ronin
|
24
|
+
module Recon
|
25
|
+
#
|
26
|
+
# Represents an input file of values to recon.
|
27
|
+
#
|
28
|
+
class InputFile
|
29
|
+
|
30
|
+
# The path to the input file.
|
31
|
+
#
|
32
|
+
# @return [String]
|
33
|
+
attr_reader :path
|
34
|
+
|
35
|
+
#
|
36
|
+
# Initializes the input file.
|
37
|
+
#
|
38
|
+
# @param [String] path
|
39
|
+
# The input file path.
|
40
|
+
#
|
41
|
+
def initialize(path)
|
42
|
+
@path = path
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# Opens the input file.
|
47
|
+
#
|
48
|
+
# @param [String] path
|
49
|
+
# The input file path.
|
50
|
+
#
|
51
|
+
# @see #initialize
|
52
|
+
#
|
53
|
+
def self.open(path)
|
54
|
+
new(path)
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# Enumerates over every value in the input file.
|
59
|
+
#
|
60
|
+
# @yield [value]
|
61
|
+
# If a block is given, it will be passed each parsed value.
|
62
|
+
#
|
63
|
+
# @yieldparam [Values::Domain, Values::Host, Values::IP, Values::IPRange, Values::Website] value
|
64
|
+
# A parsed value from the input file.
|
65
|
+
#
|
66
|
+
# @return [Enumerator]
|
67
|
+
# If no block is given, then an Enumerator will be returned.
|
68
|
+
#
|
69
|
+
def each
|
70
|
+
return enum_for unless block_given?
|
71
|
+
|
72
|
+
File.open(@path) do |file|
|
73
|
+
file.each_line(chomp: true) do |line|
|
74
|
+
yield Value.parse(line)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-recon - A micro-framework and tool for performing reconnaissance.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-recon is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published
|
9
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# ronin-recon is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
18
|
+
# along with ronin-recon. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
module Ronin
|
22
|
+
module Recon
|
23
|
+
module Message
|
24
|
+
#
|
25
|
+
# Indicates that a recon job has been completed.
|
26
|
+
#
|
27
|
+
# @api private
|
28
|
+
#
|
29
|
+
class JobCompleted
|
30
|
+
|
31
|
+
# The worker object.
|
32
|
+
#
|
33
|
+
# @return [Worker]
|
34
|
+
attr_reader :worker
|
35
|
+
|
36
|
+
# The input value object.
|
37
|
+
#
|
38
|
+
# @return [Values::Value]
|
39
|
+
attr_reader :value
|
40
|
+
|
41
|
+
#
|
42
|
+
# Initializes the message.
|
43
|
+
#
|
44
|
+
# @param [Worker] worker
|
45
|
+
# The worker object.
|
46
|
+
#
|
47
|
+
# @param [Values::Value] value
|
48
|
+
# The input value for the job.
|
49
|
+
#
|
50
|
+
def initialize(worker,value)
|
51
|
+
@worker = worker
|
52
|
+
@value = value
|
53
|
+
|
54
|
+
freeze
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-recon - A micro-framework and tool for performing reconnaissance.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-recon is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published
|
9
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# ronin-recon is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
18
|
+
# along with ronin-recon. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
module Ronin
|
22
|
+
module Recon
|
23
|
+
module Message
|
24
|
+
#
|
25
|
+
# Indicates that a job encountered an exception.
|
26
|
+
#
|
27
|
+
# @api private
|
28
|
+
#
|
29
|
+
class JobFailed
|
30
|
+
|
31
|
+
# The worker object.
|
32
|
+
#
|
33
|
+
# @return [Worker]
|
34
|
+
attr_reader :worker
|
35
|
+
|
36
|
+
# The input value object.
|
37
|
+
#
|
38
|
+
# @return [Values::Value]
|
39
|
+
attr_reader :value
|
40
|
+
|
41
|
+
# The exception.
|
42
|
+
#
|
43
|
+
# @return [StandardError]
|
44
|
+
attr_reader :exception
|
45
|
+
|
46
|
+
#
|
47
|
+
# Initializes the message.
|
48
|
+
#
|
49
|
+
# @param [Worker] worker
|
50
|
+
# The worker object.
|
51
|
+
#
|
52
|
+
# @param [Values::Value] value
|
53
|
+
# The input value object.
|
54
|
+
#
|
55
|
+
# @param [StandardError] exception
|
56
|
+
# The exception object.
|
57
|
+
#
|
58
|
+
def initialize(worker,value,exception)
|
59
|
+
@worker = worker
|
60
|
+
@value = value
|
61
|
+
@exception = exception
|
62
|
+
|
63
|
+
freeze
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-recon - A micro-framework and tool for performing reconnaissance.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-recon is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published
|
9
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# ronin-recon is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
18
|
+
# along with ronin-recon. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
module Ronin
|
22
|
+
module Recon
|
23
|
+
module Message
|
24
|
+
#
|
25
|
+
# Indicates that a worker has started a job.
|
26
|
+
#
|
27
|
+
# @api private
|
28
|
+
#
|
29
|
+
class JobStarted
|
30
|
+
|
31
|
+
# The worker object.
|
32
|
+
#
|
33
|
+
# @return [Worker]
|
34
|
+
attr_reader :worker
|
35
|
+
|
36
|
+
# The input value object.
|
37
|
+
#
|
38
|
+
# @return [Values::Value]
|
39
|
+
attr_reader :value
|
40
|
+
|
41
|
+
#
|
42
|
+
# Initializes the message.
|
43
|
+
#
|
44
|
+
# @param [Worker] worker
|
45
|
+
# The worker object.
|
46
|
+
#
|
47
|
+
# @param [Values::Value] value
|
48
|
+
# The input value object.
|
49
|
+
#
|
50
|
+
def initialize(worker,value)
|
51
|
+
@worker = worker
|
52
|
+
@value = value
|
53
|
+
|
54
|
+
freeze
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-recon - A micro-framework and tool for performing reconnaissance.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-recon is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published
|
9
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# ronin-recon is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU Lesser General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
18
|
+
# along with ronin-recon. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
module Ronin
|
22
|
+
module Recon
|
23
|
+
module Message
|
24
|
+
#
|
25
|
+
# Tells all workers to shutdown.
|
26
|
+
#
|
27
|
+
# @api private
|
28
|
+
#
|
29
|
+
class Shutdown
|
30
|
+
end
|
31
|
+
|
32
|
+
# The shutdown message.
|
33
|
+
#
|
34
|
+
# @api private
|
35
|
+
SHUTDOWN = Shutdown.new.freeze
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|