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,86 @@
|
|
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\-scan \- Runs masscan and outputs data as JSON or CSV or imports into the database
|
7
|
+
.SH SYNOPSIS
|
8
|
+
.PP
|
9
|
+
\fBronin\-masscan scan\fR \[lB]options\[rB] \fB\-\-\fR \fImasscan\[ru]options\fP \.\.\.
|
10
|
+
.SH DESCRIPTION
|
11
|
+
.PP
|
12
|
+
Runs \fBmasscan\fR and outputs data as JSON or CSV or imports into the database\.
|
13
|
+
.SH ARGUMENTS
|
14
|
+
.TP
|
15
|
+
\fImasscan\[ru]options\fP
|
16
|
+
Additional options for the \fBmasscan\fR command\.
|
17
|
+
.SH OPTIONS
|
18
|
+
.TP
|
19
|
+
\fB\-\-db\fR \fINAME\fP
|
20
|
+
The database name to connect to\. Defaults to \fBdefault\fR if not given\.
|
21
|
+
.TP
|
22
|
+
\fB\-\-db\-uri\fR \fIURI\fP
|
23
|
+
The explicit database URI to connect to
|
24
|
+
(ex: \fBpostgres:\[sl]\[sl]user:password\[at]host\[sl]db\fR)\.
|
25
|
+
.TP
|
26
|
+
\fB\-\-db\-file\fR \fIPATH\fP
|
27
|
+
The sqlite3 database file to use\.
|
28
|
+
.TP
|
29
|
+
\fB\-\-sudo\fR
|
30
|
+
Explicitly run \fBmasscan\fR under \fBsudo\fR\. If the option is not given, then
|
31
|
+
\fBsudo\fR will automatically be enabled if the \fImasscan\[ru]options\fP includes a
|
32
|
+
privileged option (ex: \fB\-sS\fR, \fB\-O\fR, etc)\.
|
33
|
+
.TP
|
34
|
+
\fB\-o\fR, \fB\-\-output\fR \fIFILE\fP
|
35
|
+
Sets the output file to save the \fBmasscan\fR scan results to\. May be a \fB\.xml\fR,
|
36
|
+
\fB\.json\fR, or \fB\.csv\fR file\.
|
37
|
+
.TP
|
38
|
+
\fB\-F\fR, \fB\-\-output\-format\fR \fBjson\fR\[or]\fBcsv\fR
|
39
|
+
Explicitly specify the output format to JSON or CSV\. If the option is
|
40
|
+
not given, the output format Will be inferred from the \fB\-\-output\fR \fIFILE\fP file
|
41
|
+
extension\.
|
42
|
+
.TP
|
43
|
+
\fB\-\-import\fR
|
44
|
+
Imports the \fBmasscan\fR scan results into the Ronin database\.
|
45
|
+
.TP
|
46
|
+
\fB\-h\fR, \fB\-\-help\fR
|
47
|
+
Print help information
|
48
|
+
.SH ENVIRONMENT
|
49
|
+
.TP
|
50
|
+
\fIHOME\fP
|
51
|
+
The user\[cq]s home directory\.
|
52
|
+
.TP
|
53
|
+
\fIXDG\[ru]CONFIG\[ru]HOME\fP
|
54
|
+
Alternate location for the \fB\[ti]\[sl]\.config\fR directory\.
|
55
|
+
.TP
|
56
|
+
\fIXDG\[ru]DATA\[ru]HOME\fP
|
57
|
+
Alternate location for the \fB\[ti]\[sl]\.local\[sl]share\fR directory\.
|
58
|
+
.SH FILES
|
59
|
+
.TP
|
60
|
+
\fB\[ti]\[sl]\.local\[sl]share\[sl]ronin\-db\[sl]database\.sqlite3\fR
|
61
|
+
The default sqlite3 database file\.
|
62
|
+
.TP
|
63
|
+
\fB\[ti]\[sl]\.config\[sl]ronin\-db\[sl]database\.yml\fR
|
64
|
+
Optional database configuration\.
|
65
|
+
.SH EXAMPLES
|
66
|
+
.PP
|
67
|
+
Port scans \fB192\.168\.1\.1\fR and save the scan results to a JSON file:
|
68
|
+
.PP
|
69
|
+
.RS 4
|
70
|
+
.EX
|
71
|
+
\[Do] ronin\-masscan scan \-o scan\.json \-\- 192\.168\.1\.1 \-p80,443,\.\.\.
|
72
|
+
.EE
|
73
|
+
.RE
|
74
|
+
.PP
|
75
|
+
Service scans \fB192\.168\.1\.1\fR and saves the scan results to the Ronin database:
|
76
|
+
.PP
|
77
|
+
.RS 4
|
78
|
+
.EX
|
79
|
+
\[Do] ronin\-masscan scan \-\-import \-\- 192\.168\.1\.1 \-p80,443,\.\.\.
|
80
|
+
.EE
|
81
|
+
.RE
|
82
|
+
.SH AUTHOR
|
83
|
+
.PP
|
84
|
+
Postmodern
|
85
|
+
.MT postmodern\.mod3\[at]gmail\.com
|
86
|
+
.ME
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# ronin-masscan-convert 1 "2023-03-01" Ronin Masscan "User Manuals"
|
2
|
+
|
3
|
+
## NAME
|
4
|
+
|
5
|
+
ronin-masscan-scan - Runs masscan and outputs data as JSON or CSV or imports into the database
|
6
|
+
|
7
|
+
## SYNOPSIS
|
8
|
+
|
9
|
+
`ronin-masscan scan` [options] `--` *masscan_options* ...
|
10
|
+
|
11
|
+
## DESCRIPTION
|
12
|
+
|
13
|
+
Runs `masscan` and outputs data as JSON or CSV or imports into the database.
|
14
|
+
|
15
|
+
## ARGUMENTS
|
16
|
+
|
17
|
+
*masscan_options*
|
18
|
+
: Additional options for the `masscan` command.
|
19
|
+
|
20
|
+
## OPTIONS
|
21
|
+
|
22
|
+
`--db` *NAME*
|
23
|
+
: The database name to connect to. Defaults to `default` if not given.
|
24
|
+
|
25
|
+
`--db-uri` *URI*
|
26
|
+
: The explicit database URI to connect to
|
27
|
+
(ex: `postgres://user:password@host/db`).
|
28
|
+
|
29
|
+
`--db-file` *PATH*
|
30
|
+
: The sqlite3 database file to use.
|
31
|
+
|
32
|
+
`--sudo`
|
33
|
+
: Explicitly run `masscan` under `sudo`. If the option is not given, then
|
34
|
+
`sudo` will automatically be enabled if the *masscan_options* includes a
|
35
|
+
privileged option (ex: `-sS`, `-O`, etc).
|
36
|
+
|
37
|
+
`-o`, `--output` *FILE*
|
38
|
+
: Sets the output file to save the `masscan` scan results to. May be a `.xml`,
|
39
|
+
`.json`, or `.csv` file.
|
40
|
+
|
41
|
+
`-F`, `--output-format` `json`|`csv`
|
42
|
+
: Explicitly specify the output format to JSON or CSV. If the option is
|
43
|
+
not given, the output format Will be inferred from the `--output` *FILE* file
|
44
|
+
extension.
|
45
|
+
|
46
|
+
`--import`
|
47
|
+
: Imports the `masscan` scan results into the Ronin database.
|
48
|
+
|
49
|
+
`-h`, `--help`
|
50
|
+
: Print help information
|
51
|
+
|
52
|
+
## ENVIRONMENT
|
53
|
+
|
54
|
+
*HOME*
|
55
|
+
: The user's home directory.
|
56
|
+
|
57
|
+
*XDG_CONFIG_HOME*
|
58
|
+
: Alternate location for the `~/.config` directory.
|
59
|
+
|
60
|
+
*XDG_DATA_HOME*
|
61
|
+
: Alternate location for the `~/.local/share` directory.
|
62
|
+
|
63
|
+
## FILES
|
64
|
+
|
65
|
+
`~/.local/share/ronin-db/database.sqlite3`
|
66
|
+
: The default sqlite3 database file.
|
67
|
+
|
68
|
+
`~/.config/ronin-db/database.yml`
|
69
|
+
: Optional database configuration.
|
70
|
+
|
71
|
+
## EXAMPLES
|
72
|
+
|
73
|
+
Port scans `192.168.1.1` and save the scan results to a JSON file:
|
74
|
+
|
75
|
+
$ ronin-masscan scan -o scan.json -- 192.168.1.1 -p80,443,...
|
76
|
+
|
77
|
+
Service scans `192.168.1.1` and saves the scan results to the Ronin database:
|
78
|
+
|
79
|
+
$ ronin-masscan scan --import -- 192.168.1.1 -p80,443,...
|
80
|
+
|
81
|
+
## AUTHOR
|
82
|
+
|
83
|
+
Postmodern <postmodern.mod3@gmail.com>
|
84
|
+
|
data/man/ronin-masscan.1
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
.\" Generated by kramdown-man 1.0.1
|
2
|
+
.\" https://github.com/postmodern/kramdown-man#readme
|
3
|
+
.TH ronin-masscan 1 "2024-01-01" Ronin Masscan "User Manuals"
|
4
|
+
.SH NAME
|
5
|
+
.PP
|
6
|
+
ronin\-masscan \- A CLI for working with masscan
|
7
|
+
.SH SYNOPSIS
|
8
|
+
.PP
|
9
|
+
\fBronin\-masscan\fR \[lB]\fIoptions\fP\[rB] \[lB]\fICOMMAND\fP \[lB]\.\.\.\[rB]\[rB]
|
10
|
+
.SH DESCRIPTION
|
11
|
+
.PP
|
12
|
+
\fBronin\-masscan\fR provides various commands for automating \fBmasscan\fR, parsing
|
13
|
+
scan output files, and importing scan data into the database\.
|
14
|
+
.SH ARGUMENTS
|
15
|
+
.TP
|
16
|
+
\fICOMMAND\fP
|
17
|
+
The \fBronin\-masscan\fR command to execute\.
|
18
|
+
.SH OPTIONS
|
19
|
+
.TP
|
20
|
+
\fB\-h\fR, \fB\-\-help\fR
|
21
|
+
Print help information
|
22
|
+
.SH COMMANDS
|
23
|
+
.TP
|
24
|
+
\fIcompletion\fP
|
25
|
+
Manages the shell completion rules for \fBronin\-masscan\fR\.
|
26
|
+
.TP
|
27
|
+
\fIconvert\fP
|
28
|
+
Converts an masscan scan file to JSON or CSV\.
|
29
|
+
.TP
|
30
|
+
\fIdump\fP
|
31
|
+
Dumps the scanned ports from masscan scan files\.
|
32
|
+
.TP
|
33
|
+
\fIgrep\fP
|
34
|
+
Greps the scanned services from masscan scan file(s)\.
|
35
|
+
.TP
|
36
|
+
\fIimport\fP
|
37
|
+
Imports a masscan scan file into ronin\-db\.
|
38
|
+
.TP
|
39
|
+
\fInew\fP
|
40
|
+
Generates a new masscan Ruby script\.
|
41
|
+
.TP
|
42
|
+
\fIprint\fP
|
43
|
+
Prints the scanned IPs and ports from masscan scan file(s)\.
|
44
|
+
.TP
|
45
|
+
\fIscan\fP
|
46
|
+
Runs masscan and outputs data as JSON or CSV or imports into the database\.
|
47
|
+
.SH AUTHOR
|
48
|
+
.PP
|
49
|
+
Postmodern
|
50
|
+
.MT postmodern\.mod3\[at]gmail\.com
|
51
|
+
.ME
|
52
|
+
.SH SEE ALSO
|
53
|
+
.PP
|
54
|
+
.BR ronin\-masscan\-completion (1)
|
55
|
+
.BR ronin\-masscan\-convert (1)
|
56
|
+
.BR ronin\-masscan\-dump (1)
|
57
|
+
.BR ronin\-masscan\-grep (1)
|
58
|
+
.BR ronin\-masscan\-import (1)
|
59
|
+
.BR ronin\-masscan\-new (1)
|
60
|
+
.BR ronin\-masscan\-print (1)
|
61
|
+
.BR ronin\-masscan\-scan (1)
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# ronin-masscan 1 "2024-01-01" Ronin Masscan "User Manuals"
|
2
|
+
|
3
|
+
## NAME
|
4
|
+
|
5
|
+
ronin-masscan - A CLI for working with masscan
|
6
|
+
|
7
|
+
## SYNOPSIS
|
8
|
+
|
9
|
+
`ronin-masscan` [*options*] [*COMMAND* [...]]
|
10
|
+
|
11
|
+
## DESCRIPTION
|
12
|
+
|
13
|
+
`ronin-masscan` provides various commands for automating `masscan`, parsing
|
14
|
+
scan output files, and importing scan data into the database.
|
15
|
+
|
16
|
+
## ARGUMENTS
|
17
|
+
|
18
|
+
*COMMAND*
|
19
|
+
: The `ronin-masscan` command to execute.
|
20
|
+
|
21
|
+
## OPTIONS
|
22
|
+
|
23
|
+
`-h`, `--help`
|
24
|
+
: Print help information
|
25
|
+
|
26
|
+
## COMMANDS
|
27
|
+
|
28
|
+
*completion*
|
29
|
+
: Manages the shell completion rules for `ronin-masscan`.
|
30
|
+
|
31
|
+
*convert*
|
32
|
+
: Converts an masscan scan file to JSON or CSV.
|
33
|
+
|
34
|
+
*dump*
|
35
|
+
: Dumps the scanned ports from masscan scan files.
|
36
|
+
|
37
|
+
*grep*
|
38
|
+
: Greps the scanned services from masscan scan file(s).
|
39
|
+
|
40
|
+
*import*
|
41
|
+
: Imports a masscan scan file into ronin-db.
|
42
|
+
|
43
|
+
*new*
|
44
|
+
: Generates a new masscan Ruby script.
|
45
|
+
|
46
|
+
*print*
|
47
|
+
: Prints the scanned IPs and ports from masscan scan file(s).
|
48
|
+
|
49
|
+
*scan*
|
50
|
+
: Runs masscan and outputs data as JSON or CSV or imports into the database.
|
51
|
+
|
52
|
+
## AUTHOR
|
53
|
+
|
54
|
+
Postmodern <postmodern.mod3@gmail.com>
|
55
|
+
|
56
|
+
## SEE ALSO
|
57
|
+
|
58
|
+
[ronin-masscan-completion](ronin-masscan-completion.1.md) [ronin-masscan-convert](ronin-masscan-convert.1.md) [ronin-masscan-dump](ronin-masscan-dump.1.md) [ronin-masscan-grep](ronin-masscan-grep.1.md) [ronin-masscan-import](ronin-masscan-import.1.md) [ronin-masscan-new](ronin-masscan-new.1.md) [ronin-masscan-print](ronin-masscan-print.1.md) [ronin-masscan-scan](ronin-masscan-scan.1.md)
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gemspec = YAML.load_file('gemspec.yml')
|
7
|
+
|
8
|
+
gem.name = gemspec.fetch('name')
|
9
|
+
gem.version = gemspec.fetch('version') do
|
10
|
+
lib_dir = File.join(File.dirname(__FILE__),'lib')
|
11
|
+
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
12
|
+
|
13
|
+
require 'ronin/masscan/version'
|
14
|
+
Ronin::Masscan::VERSION
|
15
|
+
end
|
16
|
+
|
17
|
+
gem.summary = gemspec['summary']
|
18
|
+
gem.description = gemspec['description']
|
19
|
+
gem.licenses = Array(gemspec['license'])
|
20
|
+
gem.authors = Array(gemspec['authors'])
|
21
|
+
gem.email = gemspec['email']
|
22
|
+
gem.homepage = gemspec['homepage']
|
23
|
+
gem.metadata = gemspec['metadata'] if gemspec['metadata']
|
24
|
+
|
25
|
+
glob = ->(patterns) { gem.files & Dir[*patterns] }
|
26
|
+
|
27
|
+
gem.files = `git ls-files`.split($/)
|
28
|
+
gem.files = glob[gemspec['files']] if gemspec['files']
|
29
|
+
gem.files += Array(gemspec['generated_files'])
|
30
|
+
# exclude test files from the packages gem
|
31
|
+
gem.files -= glob[gemspec['test_files'] || 'spec/{**/}*']
|
32
|
+
|
33
|
+
gem.executables = gemspec.fetch('executables') do
|
34
|
+
glob['bin/*'].map { |path| File.basename(path) }
|
35
|
+
end
|
36
|
+
|
37
|
+
gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
|
38
|
+
gem.extra_rdoc_files = glob[gemspec['extra_doc_files'] || '*.{txt,md}']
|
39
|
+
|
40
|
+
gem.require_paths = Array(gemspec.fetch('require_paths') {
|
41
|
+
%w[ext lib].select { |dir| File.directory?(dir) }
|
42
|
+
})
|
43
|
+
|
44
|
+
gem.requirements = gemspec['requirements']
|
45
|
+
gem.required_ruby_version = gemspec['required_ruby_version']
|
46
|
+
gem.required_rubygems_version = gemspec['required_rubygems_version']
|
47
|
+
gem.post_install_message = gemspec['post_install_message']
|
48
|
+
|
49
|
+
split = ->(string) { string.split(/,\s*/) }
|
50
|
+
|
51
|
+
if gemspec['dependencies']
|
52
|
+
gemspec['dependencies'].each do |name,versions|
|
53
|
+
gem.add_dependency(name,split[versions])
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
if gemspec['development_dependencies']
|
58
|
+
gemspec['development_dependencies'].each do |name,versions|
|
59
|
+
gem.add_development_dependency(name,split[versions])
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
data/scripts/setup
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
#
|
4
|
+
# Prints a log message.
|
5
|
+
#
|
6
|
+
function log()
|
7
|
+
{
|
8
|
+
if [[ -t 1 ]]; then
|
9
|
+
echo -e "\x1b[1m\x1b[32m>>>\x1b[0m \x1b[1m$1\x1b[0m"
|
10
|
+
else
|
11
|
+
echo ">>> $1"
|
12
|
+
fi
|
13
|
+
}
|
14
|
+
|
15
|
+
#
|
16
|
+
# Prints a warn message.
|
17
|
+
#
|
18
|
+
function warn()
|
19
|
+
{
|
20
|
+
if [[ -t 1 ]]; then
|
21
|
+
echo -e "\x1b[1m\x1b[33m***\x1b[0m \x1b[1m$1\x1b[0m" >&2
|
22
|
+
else
|
23
|
+
echo "*** $1" >&2
|
24
|
+
fi
|
25
|
+
}
|
26
|
+
|
27
|
+
#
|
28
|
+
# Prints an error message.
|
29
|
+
#
|
30
|
+
function error()
|
31
|
+
{
|
32
|
+
if [[ -t 1 ]]; then
|
33
|
+
echo -e "\x1b[1m\x1b[31m!!!\x1b[0m \x1b[1m$1\x1b[0m" >&2
|
34
|
+
else
|
35
|
+
echo "!!! $1" >&2
|
36
|
+
fi
|
37
|
+
}
|
38
|
+
|
39
|
+
#
|
40
|
+
# Prints an error message and exists with -1.
|
41
|
+
#
|
42
|
+
function fail()
|
43
|
+
{
|
44
|
+
error "$@"
|
45
|
+
exit -1
|
46
|
+
}
|
47
|
+
|
48
|
+
#
|
49
|
+
# Sets os_platform and os_arch.
|
50
|
+
#
|
51
|
+
function detect_os()
|
52
|
+
{
|
53
|
+
os_platform="$(uname -s)"
|
54
|
+
os_arch="$(uname -m)"
|
55
|
+
}
|
56
|
+
|
57
|
+
#
|
58
|
+
# Auto-detect the package manager.
|
59
|
+
#
|
60
|
+
function detect_package_manager()
|
61
|
+
{
|
62
|
+
case "$os_platform" in
|
63
|
+
Linux)
|
64
|
+
if [[ -f /etc/redhat-release ]]; then
|
65
|
+
if command -v dnf >/dev/null; then
|
66
|
+
package_manager="dnf"
|
67
|
+
elif command -v yum >/dev/null; then
|
68
|
+
package_manager="yum"
|
69
|
+
fi
|
70
|
+
elif [[ -f /etc/debian_version ]]; then
|
71
|
+
if command -v apt-get >/dev/null; then
|
72
|
+
package_manager="apt"
|
73
|
+
fi
|
74
|
+
elif [[ -f /etc/SuSE-release ]]; then
|
75
|
+
if command -v zypper >/dev/null; then
|
76
|
+
package_manager="zypper"
|
77
|
+
fi
|
78
|
+
elif [[ -f /etc/arch-release ]]; then
|
79
|
+
if command -v pacman >/dev/null; then
|
80
|
+
package_manager="pacman"
|
81
|
+
fi
|
82
|
+
elif [[ -f /etc/os-release ]]; then
|
83
|
+
if command -v pacman >/dev/null; then
|
84
|
+
package_manager="pacman"
|
85
|
+
elif command -v zypper >/dev/null; then
|
86
|
+
package_manager="zypper"
|
87
|
+
fi
|
88
|
+
elif [[ "$HOME" == *"com.termux"* ]]; then
|
89
|
+
package_manager="termux"
|
90
|
+
fi
|
91
|
+
;;
|
92
|
+
Darwin)
|
93
|
+
if command -v brew >/dev/null; then
|
94
|
+
package_manager="brew"
|
95
|
+
elif command -v port >/dev/null; then
|
96
|
+
package_manager="port"
|
97
|
+
fi
|
98
|
+
;;
|
99
|
+
*BSD)
|
100
|
+
if command -v pkg >/dev/null; then
|
101
|
+
package_manager="pkg"
|
102
|
+
fi
|
103
|
+
;;
|
104
|
+
esac
|
105
|
+
}
|
106
|
+
|
107
|
+
#
|
108
|
+
# Detects the system.
|
109
|
+
#
|
110
|
+
function detect_system()
|
111
|
+
{
|
112
|
+
detect_os
|
113
|
+
detect_package_manager
|
114
|
+
}
|
115
|
+
|
116
|
+
#
|
117
|
+
# Installs a list of package names using the detected package manager.
|
118
|
+
#
|
119
|
+
function install_packages()
|
120
|
+
{
|
121
|
+
case "$package_manager" in
|
122
|
+
apt) $sudo apt-get install -y "$@" || return $? ;;
|
123
|
+
dnf|yum)$sudo $package_manager install -y "$@" || return $? ;;
|
124
|
+
port) $sudo port install "$@" || return $? ;;
|
125
|
+
pkg) $sudo pkg install -y "$@" || return $? ;;
|
126
|
+
brew)
|
127
|
+
local brew_owner="$(/usr/bin/stat -f %Su "$(command -v brew)")"
|
128
|
+
sudo -u "$brew_owner" brew install "$@" ||
|
129
|
+
sudo -u "$brew_owner" brew upgrade "$@" || return $?
|
130
|
+
;;
|
131
|
+
pacman)
|
132
|
+
local missing_pkgs=($(pacman -T "$@"))
|
133
|
+
|
134
|
+
if (( ${#missing_pkgs[@]} > 0 )); then
|
135
|
+
$sudo pacman -Sy --noconfirm "${missing_pkgs[@]}" || return $?
|
136
|
+
fi
|
137
|
+
;;
|
138
|
+
zypper) $sudo zypper -n in -l $* || return $? ;;
|
139
|
+
termux) pkg install -y "$@" || return $? ;;
|
140
|
+
"") warn "Could not determine Package Manager. Proceeding anyway." ;;
|
141
|
+
esac
|
142
|
+
}
|
143
|
+
|
144
|
+
if ! command -v masscan >/dev/null; then
|
145
|
+
detect_system
|
146
|
+
|
147
|
+
log "Installing masscan ..."
|
148
|
+
install_packages masscan || warn "Could not install masscan. Proceeding anyways ..."
|
149
|
+
fi
|
150
|
+
|
151
|
+
# default to installing gems into vendor/bundle
|
152
|
+
if [[ ! -f .bundle/config ]]; then
|
153
|
+
bundle config set --local path vendor/bundle >/dev/null || \
|
154
|
+
fail "Failed to run 'bundle config'"
|
155
|
+
fi
|
156
|
+
|
157
|
+
log "Installing gems ..."
|
158
|
+
bundle install || fail "Failed to run 'bundle install'!"
|
159
|
+
|
160
|
+
log "Setting up the project ..."
|
161
|
+
bundle exec rake setup || "Failed to run 'rake setup'!"
|
metadata
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ronin-masscan
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.rc1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Postmodern
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-06-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ruby-masscan
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ronin-core
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.2.0.rc1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.2.0.rc1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ronin-db
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.2.0.rc1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.2.0.rc1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
69
|
+
description: |
|
70
|
+
ronin-masscan is a Ruby library for working with masscan. ronin-masscan can
|
71
|
+
parse masscan scan files, convert masscan files into JSON or CSV, or import
|
72
|
+
masscan scan data into the ronin-db database.
|
73
|
+
email: postmodern.mod3@gmail.com
|
74
|
+
executables:
|
75
|
+
- ronin-masscan
|
76
|
+
extensions: []
|
77
|
+
extra_rdoc_files:
|
78
|
+
- COPYING.txt
|
79
|
+
- ChangeLog.md
|
80
|
+
- README.md
|
81
|
+
files:
|
82
|
+
- ".document"
|
83
|
+
- ".github/workflows/ruby.yml"
|
84
|
+
- ".gitignore"
|
85
|
+
- ".rspec"
|
86
|
+
- ".rubocop.yml"
|
87
|
+
- ".ruby-version"
|
88
|
+
- ".yardopts"
|
89
|
+
- COPYING.txt
|
90
|
+
- ChangeLog.md
|
91
|
+
- Gemfile
|
92
|
+
- README.md
|
93
|
+
- Rakefile
|
94
|
+
- bin/ronin-masscan
|
95
|
+
- data/completions/ronin-masscan
|
96
|
+
- data/templates/script.rb.erb
|
97
|
+
- gemspec.yml
|
98
|
+
- lib/ronin/masscan.rb
|
99
|
+
- lib/ronin/masscan/cli.rb
|
100
|
+
- lib/ronin/masscan/cli/command.rb
|
101
|
+
- lib/ronin/masscan/cli/commands/completion.rb
|
102
|
+
- lib/ronin/masscan/cli/commands/convert.rb
|
103
|
+
- lib/ronin/masscan/cli/commands/dump.rb
|
104
|
+
- lib/ronin/masscan/cli/commands/grep.rb
|
105
|
+
- lib/ronin/masscan/cli/commands/import.rb
|
106
|
+
- lib/ronin/masscan/cli/commands/new.rb
|
107
|
+
- lib/ronin/masscan/cli/commands/print.rb
|
108
|
+
- lib/ronin/masscan/cli/commands/scan.rb
|
109
|
+
- lib/ronin/masscan/cli/filtering_options.rb
|
110
|
+
- lib/ronin/masscan/cli/importable.rb
|
111
|
+
- lib/ronin/masscan/cli/port_list.rb
|
112
|
+
- lib/ronin/masscan/converter.rb
|
113
|
+
- lib/ronin/masscan/converters.rb
|
114
|
+
- lib/ronin/masscan/converters/csv.rb
|
115
|
+
- lib/ronin/masscan/converters/json.rb
|
116
|
+
- lib/ronin/masscan/exceptions.rb
|
117
|
+
- lib/ronin/masscan/importer.rb
|
118
|
+
- lib/ronin/masscan/root.rb
|
119
|
+
- lib/ronin/masscan/version.rb
|
120
|
+
- man/ronin-masscan-completion.1
|
121
|
+
- man/ronin-masscan-completion.1.md
|
122
|
+
- man/ronin-masscan-convert.1
|
123
|
+
- man/ronin-masscan-convert.1.md
|
124
|
+
- man/ronin-masscan-dump.1
|
125
|
+
- man/ronin-masscan-dump.1.md
|
126
|
+
- man/ronin-masscan-grep.1
|
127
|
+
- man/ronin-masscan-grep.1.md
|
128
|
+
- man/ronin-masscan-import.1
|
129
|
+
- man/ronin-masscan-import.1.md
|
130
|
+
- man/ronin-masscan-new.1
|
131
|
+
- man/ronin-masscan-new.1.md
|
132
|
+
- man/ronin-masscan-print.1
|
133
|
+
- man/ronin-masscan-print.1.md
|
134
|
+
- man/ronin-masscan-scan.1
|
135
|
+
- man/ronin-masscan-scan.1.md
|
136
|
+
- man/ronin-masscan.1
|
137
|
+
- man/ronin-masscan.1.md
|
138
|
+
- ronin-masscan.gemspec
|
139
|
+
- scripts/setup
|
140
|
+
homepage: https://ronin-rb.dev/
|
141
|
+
licenses:
|
142
|
+
- LGPL-3.0
|
143
|
+
metadata:
|
144
|
+
documentation_uri: https://ronin-rb.dev/docs/ronin-masscan
|
145
|
+
source_code_uri: https://github.com/ronin-rb/ronin-masscan
|
146
|
+
bug_tracker_uri: https://github.com/ronin-rb/ronin-masscan/issues
|
147
|
+
changelog_uri: https://github.com/ronin-rb/ronin-masscan/blob/main/ChangeLog.md
|
148
|
+
rubygems_mfa_required: 'true'
|
149
|
+
post_install_message:
|
150
|
+
rdoc_options: []
|
151
|
+
require_paths:
|
152
|
+
- lib
|
153
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: 3.0.0
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
requirements: []
|
164
|
+
rubygems_version: 3.3.27
|
165
|
+
signing_key:
|
166
|
+
specification_version: 4
|
167
|
+
summary: A Ruby library and CLI for working with masscan.
|
168
|
+
test_files: []
|