ronin-masscan 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 +47 -0
- data/.gitignore +14 -0
- data/.rspec +1 -0
- data/.rubocop.yml +11 -0
- data/.ruby-version +1 -0
- data/.yardopts +1 -0
- data/COPYING.txt +165 -0
- data/ChangeLog.md +10 -0
- data/Gemfile +40 -0
- data/README.md +204 -0
- data/Rakefile +43 -0
- data/bin/ronin-masscan +34 -0
- data/data/completions/ronin-masscan +83 -0
- data/data/templates/script.rb.erb +43 -0
- data/gemspec.yml +42 -0
- data/lib/ronin/masscan/cli/command.rb +40 -0
- data/lib/ronin/masscan/cli/commands/completion.rb +61 -0
- data/lib/ronin/masscan/cli/commands/convert.rb +133 -0
- data/lib/ronin/masscan/cli/commands/dump.rb +194 -0
- data/lib/ronin/masscan/cli/commands/grep.rb +235 -0
- data/lib/ronin/masscan/cli/commands/import.rb +94 -0
- data/lib/ronin/masscan/cli/commands/new.rb +203 -0
- data/lib/ronin/masscan/cli/commands/print.rb +162 -0
- data/lib/ronin/masscan/cli/commands/scan.rb +206 -0
- data/lib/ronin/masscan/cli/filtering_options.rb +312 -0
- data/lib/ronin/masscan/cli/importable.rb +68 -0
- data/lib/ronin/masscan/cli/port_list.rb +102 -0
- data/lib/ronin/masscan/cli.rb +50 -0
- data/lib/ronin/masscan/converter.rb +129 -0
- data/lib/ronin/masscan/converters/csv.rb +108 -0
- data/lib/ronin/masscan/converters/json.rb +142 -0
- data/lib/ronin/masscan/converters.rb +54 -0
- data/lib/ronin/masscan/exceptions.rb +47 -0
- data/lib/ronin/masscan/importer.rb +214 -0
- data/lib/ronin/masscan/root.rb +28 -0
- data/lib/ronin/masscan/version.rb +26 -0
- data/lib/ronin/masscan.rb +114 -0
- data/man/ronin-masscan-completion.1 +76 -0
- data/man/ronin-masscan-completion.1.md +78 -0
- data/man/ronin-masscan-convert.1 +37 -0
- data/man/ronin-masscan-convert.1.md +40 -0
- data/man/ronin-masscan-dump.1 +116 -0
- data/man/ronin-masscan-dump.1.md +94 -0
- data/man/ronin-masscan-grep.1 +56 -0
- data/man/ronin-masscan-grep.1.md +59 -0
- data/man/ronin-masscan-import.1 +52 -0
- data/man/ronin-masscan-import.1.md +57 -0
- data/man/ronin-masscan-new.1 +78 -0
- data/man/ronin-masscan-new.1.md +70 -0
- data/man/ronin-masscan-print.1 +53 -0
- data/man/ronin-masscan-print.1.md +56 -0
- data/man/ronin-masscan-scan.1 +86 -0
- data/man/ronin-masscan-scan.1.md +84 -0
- data/man/ronin-masscan.1 +61 -0
- data/man/ronin-masscan.1.md +58 -0
- data/ronin-masscan.gemspec +62 -0
- data/scripts/setup +161 -0
- metadata +168 -0
@@ -0,0 +1,214 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-masscan - A Ruby library and CLI for working with masscan.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-masscan 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-masscan 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-masscan. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'ronin/db'
|
22
|
+
require 'masscan/output_file'
|
23
|
+
|
24
|
+
module Ronin
|
25
|
+
module Masscan
|
26
|
+
#
|
27
|
+
# Handles importing masscan output files file into [ronin-db].
|
28
|
+
#
|
29
|
+
# [ronin-db]: https://github.com/ronin-rb/ronin-db#readme
|
30
|
+
#
|
31
|
+
# ## Examples
|
32
|
+
#
|
33
|
+
# require 'ronin/masscan/importer'
|
34
|
+
#
|
35
|
+
# Ronin::DB.connect
|
36
|
+
# Ronin::Masscan::Importer.import_file('masscan.scan') do |record|
|
37
|
+
# puts "Imported #{record.inspect}!"
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
module Importer
|
41
|
+
#
|
42
|
+
# Imports a masscan output file into the database.
|
43
|
+
#
|
44
|
+
# @param [String] path
|
45
|
+
# The path to the masscan output file.
|
46
|
+
#
|
47
|
+
# @param [Hash{Symbol => Object}] kwargs
|
48
|
+
# Additional keyword arguments for `Masscan::OutputFile#initialize`.
|
49
|
+
#
|
50
|
+
# @option kwargs [:binary, :list, :json, :ndjson] :format
|
51
|
+
# The format of the output file. If not given, the format will be
|
52
|
+
# inferred from the file extension.
|
53
|
+
#
|
54
|
+
# @yield [imported]
|
55
|
+
# The given block will be passed each imported database record.
|
56
|
+
#
|
57
|
+
# @yieldparam [Ronin::DB::IPAddress, Ronin::DB::Port, Ronin::DB::OpenPort] imported
|
58
|
+
#
|
59
|
+
# @raise [ArgumentError]
|
60
|
+
# The output format was not given and it cannot be inferred.
|
61
|
+
#
|
62
|
+
def self.import_file(path,**kwargs,&block)
|
63
|
+
output_file = ::Masscan::OutputFile.new(path,**kwargs)
|
64
|
+
|
65
|
+
import(output_file,&block)
|
66
|
+
end
|
67
|
+
|
68
|
+
#
|
69
|
+
# Imports the masscan output file.
|
70
|
+
#
|
71
|
+
# @param [::Masscan::OutputFile] output_file
|
72
|
+
#
|
73
|
+
# @yield [imported]
|
74
|
+
# The given block will be passed each imported database record.
|
75
|
+
#
|
76
|
+
# @yieldparam [Ronin::DB::IPAddress, Ronin::DB::Port, Ronin::DB::OpenPort] imported
|
77
|
+
#
|
78
|
+
def self.import(output_file,&block)
|
79
|
+
return enum_for(__method__,output_file).to_a unless block
|
80
|
+
|
81
|
+
output_file.each do |record|
|
82
|
+
case record
|
83
|
+
when ::Masscan::Status
|
84
|
+
import_status(record,&block)
|
85
|
+
when ::Masscan::Banner
|
86
|
+
# TODO: somehow import the banner data
|
87
|
+
else
|
88
|
+
raise(NotImplementedError,"unable to import masscan record: #{record.inspect}")
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
#
|
94
|
+
# Imports a `Masscan::Status` record into the database.
|
95
|
+
#
|
96
|
+
# @param [::Masscan::Status] status
|
97
|
+
# The `Masscan::Status` record.
|
98
|
+
#
|
99
|
+
# @yield [imported]
|
100
|
+
# The given block will be passed each imported database record.
|
101
|
+
#
|
102
|
+
# @yieldparam [Ronin::DB::IPAddress, Ronin::DB::Port, Ronin::DB::OpenPort] imported
|
103
|
+
# An imported IP address, port number, or open port record.
|
104
|
+
#
|
105
|
+
# @return [Ronin::DB::OpenPort, Ronin::DB::IPAddress, nil]
|
106
|
+
# The imported open port, or an IP address if the status was an ICMP
|
107
|
+
# probe, or `nil` if the status did not represent an open port.
|
108
|
+
#
|
109
|
+
def self.import_status(status,&block)
|
110
|
+
# only import open ports
|
111
|
+
if status.status == :open
|
112
|
+
if status.protocol == :icmp
|
113
|
+
# only import the IP address for ICMP statuses
|
114
|
+
import_ip_address(status.ip,&block)
|
115
|
+
else
|
116
|
+
import_open_port_status(status,&block)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
#
|
122
|
+
# Imports an open port `Masscan::Status` record into the database.
|
123
|
+
#
|
124
|
+
# @param [::Masscan::Status] status
|
125
|
+
# The `Masscan::Status` record.
|
126
|
+
#
|
127
|
+
# @yield [imported]
|
128
|
+
# The given block will be passed each imported database record.
|
129
|
+
#
|
130
|
+
# @yieldparam [Ronin::DB::IPAddress, Ronin::DB::Port, Ronin::DB::OpenPort] imported
|
131
|
+
# An imported IP address, port number, or open port record.
|
132
|
+
#
|
133
|
+
# @return [Ronin::DB::OpenPort]
|
134
|
+
# The imported open port.
|
135
|
+
#
|
136
|
+
def self.import_open_port_status(status,&block)
|
137
|
+
imported_ip_address = import_ip_address(status.ip,&block)
|
138
|
+
imported_port = import_port(status.port,status.protocol,&block)
|
139
|
+
imported_open_port = DB::OpenPort.transaction do
|
140
|
+
DB::OpenPort.find_or_create_by(
|
141
|
+
ip_address: imported_ip_address,
|
142
|
+
port: imported_port
|
143
|
+
)
|
144
|
+
end
|
145
|
+
|
146
|
+
imported_open_port.update(last_scanned_at: status.timestamp)
|
147
|
+
|
148
|
+
yield imported_open_port if block_given?
|
149
|
+
return imported_open_port
|
150
|
+
end
|
151
|
+
|
152
|
+
#
|
153
|
+
# Imports an IP address into the database.
|
154
|
+
#
|
155
|
+
# @param [IPAddr] ip_addr
|
156
|
+
# The IP address object to import.
|
157
|
+
#
|
158
|
+
# @yield [imported]
|
159
|
+
# The given block will be passed the imported IP address record.
|
160
|
+
#
|
161
|
+
# @yieldparam [Ronin::DB::IPAddress] imported
|
162
|
+
# The imported IP address record.
|
163
|
+
#
|
164
|
+
# @return [Ronin::DB::IPAddress]
|
165
|
+
# The imported IP address record.
|
166
|
+
#
|
167
|
+
def self.import_ip_address(ip_addr,&block)
|
168
|
+
ip_version = if ip_addr.ipv6? then 6
|
169
|
+
else 4
|
170
|
+
end
|
171
|
+
|
172
|
+
imported_ip_address = DB::IPAddress.transaction do
|
173
|
+
DB::IPAddress.find_or_create_by(
|
174
|
+
version: ip_version,
|
175
|
+
address: ip_addr.to_s
|
176
|
+
)
|
177
|
+
end
|
178
|
+
|
179
|
+
yield imported_ip_address if block_given?
|
180
|
+
return imported_ip_address
|
181
|
+
end
|
182
|
+
|
183
|
+
#
|
184
|
+
# Imports the port.
|
185
|
+
#
|
186
|
+
# @param [Integer] port
|
187
|
+
# The port number to import.
|
188
|
+
#
|
189
|
+
# @param [:tcp, :udp] protocol
|
190
|
+
# The protocol of the port.
|
191
|
+
#
|
192
|
+
# @yield [imported]
|
193
|
+
# The given block will be passed the imported port record.
|
194
|
+
#
|
195
|
+
# @yieldparam [Ronin::DB::Port] imported
|
196
|
+
# The imported port record.
|
197
|
+
#
|
198
|
+
# @return [Ronin::DB::Port]
|
199
|
+
# The imported port record.
|
200
|
+
#
|
201
|
+
def self.import_port(port,protocol,&block)
|
202
|
+
imported_port = DB::Port.transaction do
|
203
|
+
DB::Port.find_or_create_by(
|
204
|
+
protocol: protocol,
|
205
|
+
number: port
|
206
|
+
)
|
207
|
+
end
|
208
|
+
|
209
|
+
yield imported_port if block_given?
|
210
|
+
return imported_port
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-masscan - A Ruby library and CLI for working with masscan.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-masscan 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-masscan 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-masscan. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
module Ronin
|
22
|
+
module Masscan
|
23
|
+
# Path to `ronin-masscan` root directory.
|
24
|
+
#
|
25
|
+
# @api private
|
26
|
+
ROOT = File.expand_path(File.join(__dir__,'..','..','..'))
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-masscan - A Ruby library and CLI for working with masscan.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-masscan 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-masscan 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-masscan. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
module Ronin
|
22
|
+
module Masscan
|
23
|
+
# ronin-masscan version
|
24
|
+
VERSION = '0.1.0.rc1'
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-masscan - A Ruby library and CLI for working with masscan.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-masscan 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-masscan 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-masscan. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'ronin/masscan/exceptions'
|
22
|
+
require 'ronin/masscan/importer'
|
23
|
+
require 'ronin/core/home'
|
24
|
+
require 'masscan/command'
|
25
|
+
require 'masscan/output_file'
|
26
|
+
|
27
|
+
require 'tempfile'
|
28
|
+
require 'fileutils'
|
29
|
+
|
30
|
+
module Ronin
|
31
|
+
#
|
32
|
+
# Top-level methods for `ronin-masscan`.
|
33
|
+
#
|
34
|
+
module Masscan
|
35
|
+
# The `~/.cache/ronin-masscan` cache directory.
|
36
|
+
#
|
37
|
+
# @api private
|
38
|
+
CACHE_DIR = Core::Home.cache_dir('ronin-masscan')
|
39
|
+
|
40
|
+
#
|
41
|
+
# Runs `masscan` and parses the saved output data.
|
42
|
+
#
|
43
|
+
# @param [Array<#to_s>] ips
|
44
|
+
# The IP addresses to scan.
|
45
|
+
#
|
46
|
+
# @param [Hash{Symbol => Object}] kwargs
|
47
|
+
# Additional keyword arguments for `masscan`.
|
48
|
+
#
|
49
|
+
# @return [::Masscan::OutputFile]
|
50
|
+
# If the `masscan` command was sucessful, the parsed masscan data will be
|
51
|
+
# returned.
|
52
|
+
#
|
53
|
+
# @raise [NotInstalled]
|
54
|
+
# The `masscan` command is not installed.
|
55
|
+
#
|
56
|
+
# @raise [ScanFailed]
|
57
|
+
# The `masscan` scan failed.
|
58
|
+
#
|
59
|
+
# @see https://rubydoc.info/gems/ruby-masscan/Masscan/OutputFile
|
60
|
+
#
|
61
|
+
# @api public
|
62
|
+
#
|
63
|
+
def self.scan(*ips,**kwargs,&block)
|
64
|
+
masscan = ::Masscan::Command.new(ips: ips, **kwargs,&block)
|
65
|
+
|
66
|
+
masscan.ips ||= ips
|
67
|
+
|
68
|
+
unless masscan.output_file
|
69
|
+
FileUtils.mkdir_p(CACHE_DIR)
|
70
|
+
tempfile = Tempfile.new(['masscan', '.json'], CACHE_DIR)
|
71
|
+
|
72
|
+
masscan.output_file = tempfile.path
|
73
|
+
end
|
74
|
+
|
75
|
+
status = masscan.run_command
|
76
|
+
|
77
|
+
case status
|
78
|
+
when nil
|
79
|
+
raise(NotInstalled,"the masscan command is not installed")
|
80
|
+
when false
|
81
|
+
raise(ScanFailed,"masscan scan failed: #{masscan.command_argv.join(' ')}")
|
82
|
+
else
|
83
|
+
parse(masscan.output_file)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
#
|
88
|
+
# Parses a masscan output file.
|
89
|
+
#
|
90
|
+
# @param [String] path
|
91
|
+
# The path to the output file.
|
92
|
+
#
|
93
|
+
# @param [Hash{Symbol => Object}] kwargs
|
94
|
+
# Additional keyword arguments for `::Masscan::OutputFile.new`.
|
95
|
+
#
|
96
|
+
# @option kwargs [:binary, :list, :json, :ndjson] :format
|
97
|
+
# The format of the output file. If not specified, the format will be
|
98
|
+
# inferred from the path's file extension.
|
99
|
+
#
|
100
|
+
# @return [::Masscan::OutputFile]
|
101
|
+
# The parsed masscan output file.
|
102
|
+
#
|
103
|
+
# @raise [ArgumentError]
|
104
|
+
# The output format was not given and it cannot be inferred.
|
105
|
+
#
|
106
|
+
# @see https://rubydoc.info/gems/ruby-masscan/Masscan/OutputFile
|
107
|
+
#
|
108
|
+
# @api public
|
109
|
+
#
|
110
|
+
def self.parse(path,**kwargs)
|
111
|
+
::Masscan::OutputFile.new(path,**kwargs)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
.\" Generated by kramdown-man 1.0.1
|
2
|
+
.\" https://github.com/postmodern/kramdown-man#readme
|
3
|
+
.TH ronin-masscan-completion 1 "2024-01-01" Ronin Masscan "User Manuals"
|
4
|
+
.SH NAME
|
5
|
+
.PP
|
6
|
+
ronin\-masscan\-completion \- Manages shell completion rules for \fBronin\-masscan\fR
|
7
|
+
.SH SYNOPSIS
|
8
|
+
.PP
|
9
|
+
\fBronin\-masscan completion\fR \[lB]\fIoptions\fP\[rB]
|
10
|
+
.SH DESCRIPTION
|
11
|
+
.PP
|
12
|
+
The \fBronin\-masscan completion\fR command can print, install, or uninstall shell
|
13
|
+
completion rules for the \fBronin\-masscan\fR command\.
|
14
|
+
.PP
|
15
|
+
Supports installing completion rules for Bash or Zsh shells\.
|
16
|
+
Completion rules for the Fish shell is currently not supported\.
|
17
|
+
.SS ZSH SUPPORT
|
18
|
+
.PP
|
19
|
+
Zsh users will have to add the following lines to their \fB\[ti]\[sl]\.zshrc\fR file in
|
20
|
+
order to enable Zsh\[cq]s Bash completion compatibility layer:
|
21
|
+
.PP
|
22
|
+
.RS 4
|
23
|
+
.EX
|
24
|
+
autoload \-Uz \[pl]X compinit && compinit
|
25
|
+
autoload \-Uz \[pl]X bashcompinit && bashcompinit
|
26
|
+
.EE
|
27
|
+
.RE
|
28
|
+
.SH OPTIONS
|
29
|
+
.TP
|
30
|
+
\fB\-\-print\fR
|
31
|
+
Prints the shell completion file\.
|
32
|
+
.TP
|
33
|
+
\fB\-\-install\fR
|
34
|
+
Installs the shell completion file\.
|
35
|
+
.TP
|
36
|
+
\fB\-\-uninstall\fR
|
37
|
+
Uninstalls the shell completion file\.
|
38
|
+
.TP
|
39
|
+
\fB\-h\fR, \fB\-\-help\fR
|
40
|
+
Prints help information\.
|
41
|
+
.SH ENVIRONMENT
|
42
|
+
.TP
|
43
|
+
\fIPREFIX\fP
|
44
|
+
Specifies the root prefix for the file system\.
|
45
|
+
.TP
|
46
|
+
\fIHOME\fP
|
47
|
+
Specifies the home directory of the user\. Ronin will search for the
|
48
|
+
\fB\[ti]\[sl]\.cache\[sl]ronin\-masscan\fR cache directory within the home directory\.
|
49
|
+
.TP
|
50
|
+
\fIXDG\[ru]DATA\[ru]HOME\fP
|
51
|
+
Specifies the data directory to use\. Defaults to \fB\[Do]HOME\[sl]\.local\[sl]share\fR\.
|
52
|
+
.SH FILES
|
53
|
+
.TP
|
54
|
+
\fB\[ti]\[sl]\.local\[sl]share\[sl]bash\-completion\[sl]completions\[sl]\fR
|
55
|
+
The user\-local installation directory for Bash completion files\.
|
56
|
+
.TP
|
57
|
+
\fB\[sl]usr\[sl]local\[sl]share\[sl]bash\-completion\[sl]completions\[sl]\fR
|
58
|
+
The system\-wide installation directory for Bash completions files\.
|
59
|
+
.TP
|
60
|
+
\fB\[sl]usr\[sl]local\[sl]share\[sl]zsh\[sl]site\-functions\[sl]\fR
|
61
|
+
The installation directory for Zsh completion files\.
|
62
|
+
.SH EXAMPLES
|
63
|
+
.TP
|
64
|
+
\fBronin\-masscan completion \-\-print\fR
|
65
|
+
Prints the shell completion rules instead of installing them\.
|
66
|
+
.TP
|
67
|
+
\fBronin\-masscan completion \-\-install\fR
|
68
|
+
Installs the shell completion rules for \fBronin\-masscan\fR\.
|
69
|
+
.TP
|
70
|
+
\fBronin\-masscan completion \-\-uninstall\fR
|
71
|
+
Uninstalls the shell completion rules for \fBronin\-masscan\fR\.
|
72
|
+
.SH AUTHOR
|
73
|
+
.PP
|
74
|
+
Postmodern
|
75
|
+
.MT postmodern\.mod3\[at]gmail\.com
|
76
|
+
.ME
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# ronin-masscan-completion 1 "2024-01-01" Ronin Masscan "User Manuals"
|
2
|
+
|
3
|
+
## NAME
|
4
|
+
|
5
|
+
ronin-masscan-completion - Manages shell completion rules for `ronin-masscan`
|
6
|
+
|
7
|
+
## SYNOPSIS
|
8
|
+
|
9
|
+
`ronin-masscan completion` [*options*]
|
10
|
+
|
11
|
+
## DESCRIPTION
|
12
|
+
|
13
|
+
The `ronin-masscan completion` command can print, install, or uninstall shell
|
14
|
+
completion rules for the `ronin-masscan` command.
|
15
|
+
|
16
|
+
Supports installing completion rules for Bash or Zsh shells.
|
17
|
+
Completion rules for the Fish shell is currently not supported.
|
18
|
+
|
19
|
+
### ZSH SUPPORT
|
20
|
+
|
21
|
+
Zsh users will have to add the following lines to their `~/.zshrc` file in
|
22
|
+
order to enable Zsh's Bash completion compatibility layer:
|
23
|
+
|
24
|
+
autoload -Uz +X compinit && compinit
|
25
|
+
autoload -Uz +X bashcompinit && bashcompinit
|
26
|
+
|
27
|
+
## OPTIONS
|
28
|
+
|
29
|
+
`--print`
|
30
|
+
: Prints the shell completion file.
|
31
|
+
|
32
|
+
`--install`
|
33
|
+
: Installs the shell completion file.
|
34
|
+
|
35
|
+
`--uninstall`
|
36
|
+
: Uninstalls the shell completion file.
|
37
|
+
|
38
|
+
`-h`, `--help`
|
39
|
+
: Prints help information.
|
40
|
+
|
41
|
+
## ENVIRONMENT
|
42
|
+
|
43
|
+
*PREFIX*
|
44
|
+
: Specifies the root prefix for the file system.
|
45
|
+
|
46
|
+
*HOME*
|
47
|
+
: Specifies the home directory of the user. Ronin will search for the
|
48
|
+
`~/.cache/ronin-masscan` cache directory within the home directory.
|
49
|
+
|
50
|
+
*XDG_DATA_HOME*
|
51
|
+
: Specifies the data directory to use. Defaults to `$HOME/.local/share`.
|
52
|
+
|
53
|
+
## FILES
|
54
|
+
|
55
|
+
`~/.local/share/bash-completion/completions/`
|
56
|
+
: The user-local installation directory for Bash completion files.
|
57
|
+
|
58
|
+
`/usr/local/share/bash-completion/completions/`
|
59
|
+
: The system-wide installation directory for Bash completions files.
|
60
|
+
|
61
|
+
`/usr/local/share/zsh/site-functions/`
|
62
|
+
: The installation directory for Zsh completion files.
|
63
|
+
|
64
|
+
## EXAMPLES
|
65
|
+
|
66
|
+
`ronin-masscan completion --print`
|
67
|
+
: Prints the shell completion rules instead of installing them.
|
68
|
+
|
69
|
+
`ronin-masscan completion --install`
|
70
|
+
: Installs the shell completion rules for `ronin-masscan`.
|
71
|
+
|
72
|
+
`ronin-masscan completion --uninstall`
|
73
|
+
: Uninstalls the shell completion rules for `ronin-masscan`.
|
74
|
+
|
75
|
+
## AUTHOR
|
76
|
+
|
77
|
+
Postmodern <postmodern.mod3@gmail.com>
|
78
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
.\" Generated by kramdown-man 1.0.1
|
2
|
+
.\" https://github.com/postmodern/kramdown-man#readme
|
3
|
+
.TH ronin-masscan-convert 1 "2023-03-01" Ronin Masscan "User Manuals"
|
4
|
+
.SH NAME
|
5
|
+
.PP
|
6
|
+
ronin\-masscan\-convert \- Converts an masscan scan file to JSON or CSV
|
7
|
+
.SH SYNOPSIS
|
8
|
+
.PP
|
9
|
+
\fBronin\-masscan convert\fR \[lB]\fB\-\-format\fR \fBjson\fR\[or]\fBcsv\fR\[rB] \fIINPUT\[ru]FILE\fP \[lB]\fIOUTPUT\[ru]FILE\fP\[rB]
|
10
|
+
.SH DESCRIPTION
|
11
|
+
.PP
|
12
|
+
Converts an masscan scan file to JSON or CSV\.
|
13
|
+
.SH ARGUMENTS
|
14
|
+
.TP
|
15
|
+
\fIINPUT\[ru]FILE\fP
|
16
|
+
The masscan scan file to import\.
|
17
|
+
.TP
|
18
|
+
\fIOUTPUT\[ru]FILE\fP
|
19
|
+
The optional output file to write to\.
|
20
|
+
.SH OPTIONS
|
21
|
+
.TP
|
22
|
+
\fB\-I\fR, \fB\-\-input\-format\fR \fBbinary\fR\[or]\fBlist\fR\[or]\fBjson\fR\[or]\fBndjson\fR
|
23
|
+
Specifies the format of the \fIINPUT\[ru]FILE\fP\. If not specified the input format
|
24
|
+
will be inferred from the \fIINPUT\[ru]FILE\fP file extension\.
|
25
|
+
.TP
|
26
|
+
\fB\-F\fR, \fB\-\-format\fR \fBjson\fR\[or]\fBcsv\fR
|
27
|
+
Sets the output conversion format to JSON or CSV\. If the option is not given,
|
28
|
+
the output conversion format Will be inferred from the \fIOUTPUT\[ru]FILE\fP file
|
29
|
+
extension\.
|
30
|
+
.TP
|
31
|
+
\fB\-h\fR, \fB\-\-help\fR
|
32
|
+
Print help information
|
33
|
+
.SH AUTHOR
|
34
|
+
.PP
|
35
|
+
Postmodern
|
36
|
+
.MT postmodern\.mod3\[at]gmail\.com
|
37
|
+
.ME
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# ronin-masscan-convert 1 "2023-03-01" Ronin Masscan "User Manuals"
|
2
|
+
|
3
|
+
## NAME
|
4
|
+
|
5
|
+
ronin-masscan-convert - Converts an masscan scan file to JSON or CSV
|
6
|
+
|
7
|
+
## SYNOPSIS
|
8
|
+
|
9
|
+
`ronin-masscan convert` [`--format` `json`\|`csv`] *INPUT_FILE* [*OUTPUT_FILE*]
|
10
|
+
|
11
|
+
## DESCRIPTION
|
12
|
+
|
13
|
+
Converts an masscan scan file to JSON or CSV.
|
14
|
+
|
15
|
+
## ARGUMENTS
|
16
|
+
|
17
|
+
*INPUT_FILE*
|
18
|
+
: The masscan scan file to import.
|
19
|
+
|
20
|
+
*OUTPUT_FILE*
|
21
|
+
: The optional output file to write to.
|
22
|
+
|
23
|
+
## OPTIONS
|
24
|
+
|
25
|
+
`-I`, `--input-format` `binary`\|`list`\|`json`\|`ndjson`
|
26
|
+
: Specifies the format of the *INPUT_FILE*. If not specified the input format
|
27
|
+
will be inferred from the *INPUT_FILE* file extension.
|
28
|
+
|
29
|
+
`-F`, `--format` `json`|`csv`
|
30
|
+
: Sets the output conversion format to JSON or CSV. If the option is not given,
|
31
|
+
the output conversion format Will be inferred from the *OUTPUT_FILE* file
|
32
|
+
extension.
|
33
|
+
|
34
|
+
`-h`, `--help`
|
35
|
+
: Print help information
|
36
|
+
|
37
|
+
## AUTHOR
|
38
|
+
|
39
|
+
Postmodern <postmodern.mod3@gmail.com>
|
40
|
+
|