From 3933043599de2a5b3edd6f3c3eaed1aa5490233d Mon Sep 17 00:00:00 2001 From: Postmodern Date: Wed, 13 Dec 2023 22:35:20 -0800 Subject: [PATCH] Renamed `ronin-masscan targets` to `ronin-masscan dump` (closes #10). --- README.md | 14 +++++----- gemspec.yml | 2 +- .../cli/commands/{targets.rb => dump.rb} | 22 +++++++-------- ...n-targets.1.md => ronin-masscan-dump.1.md} | 28 +++++++++++++------ man/ronin-masscan.1.md | 8 +++--- 5 files changed, 42 insertions(+), 32 deletions(-) rename lib/ronin/masscan/cli/commands/{targets.rb => dump.rb} (88%) rename man/{ronin-masscan-targets.1.md => ronin-masscan-dump.1.md} (67%) diff --git a/README.md b/README.md index 950d45d..04fc98d 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,10 @@ Arguments: Commands: convert + dump help import scan - targets ``` Import a binary `masscan` scan file: @@ -62,22 +62,22 @@ Import a JSON `masscan` scan file: $ ronin-masscan import masscan.json ``` -Convert an masscan scan file to a list of `IP:PORT` pairs: +Dumps a masscan scan file to a list of `IP:PORT` pairs: ```shell -$ ronin-masscan targets --print-ip-ports masscan.bin +$ ronin-masscan dump --print-ip-ports masscan.bin ``` -Convert an masscan scan file to a list of `HOST:PORT` pairs: +Dump a masscan scan file to a list of `HOST:PORT` pairs: ```shell -$ ronin-masscan targets --print-host-ports masscan.bin +$ ronin-masscan dump --print-host-ports masscan.bin ``` -Convert an masscan scan file to a list of `http`://` or `https://` URIs: +Dump a masscan scan file to a list of `http`://` or `https://` URIs: ```shell -$ ronin-masscan targets --print-uris masscan.bin +$ ronin-masscan dump --print-uris masscan.bin ``` Convert a binary `masscan` scan file to CSV: diff --git a/gemspec.yml b/gemspec.yml index 794229e..75812dd 100644 --- a/gemspec.yml +++ b/gemspec.yml @@ -21,9 +21,9 @@ metadata: generated_files: - man/ronin-masscan.1 - man/ronin-masscan-convert.1 + - man/ronin-masscan-dump.1 - man/ronin-masscan-import.1 - man/ronin-masscan-scan.1 - - man/ronin-masscan-targets.1 required_ruby_version: ">= 3.0.0" diff --git a/lib/ronin/masscan/cli/commands/targets.rb b/lib/ronin/masscan/cli/commands/dump.rb similarity index 88% rename from lib/ronin/masscan/cli/commands/targets.rb rename to lib/ronin/masscan/cli/commands/dump.rb index b10951d..b6be987 100644 --- a/lib/ronin/masscan/cli/commands/targets.rb +++ b/lib/ronin/masscan/cli/commands/dump.rb @@ -29,11 +29,11 @@ module Masscan class CLI module Commands # - # Converts masscan scan files into a list of targets. + # Dumps the scanned ports from masscan scan file(s). # # ## Usage # - # ronin-masscan targets [options] XML_FILE [...] + # ronin-masscan dump [options] XML_FILE [...] # # ## Options # @@ -55,13 +55,13 @@ module Commands # # ## Examples # - # ronin-masscan targets --print-ip-ports masscan.bin - # ronin-masscan targets --print-ip-ports --ports 22,80,443 masscan.bin - # ronin-masscan targets --print-host-ports masscan.bin - # ronin-masscan targets --print-hosts --with-port 22 masscan.bin - # ronin-masscan targets --print-uris masscan.bin + # ronin-masscan dump --print-ip-ports masscan.bin + # ronin-masscan dump --print-ip-ports --ports 22,80,443 masscan.bin + # ronin-masscan dump --print-host-ports masscan.bin + # ronin-masscan dump --print-hosts --with-port 22 masscan.bin + # ronin-masscan dump --print-uris masscan.bin # - class Targets < Command + class Dump < Command usage '[options] MASSCAN_FILE [...]' @@ -99,9 +99,9 @@ class Targets < Command '--print-uris masscan.bin' ] - description 'Converts masscan scan files into a list of targets' + description 'Dumps the scanned ports from masscan scan file(s)' - man_page 'ronin-masscan-targets.1' + man_page 'ronin-masscan-dump.1' # # Initializes the command. @@ -116,7 +116,7 @@ def initialize(**kwargs) end # - # Runs the `ronin-masscan targets` command. + # Runs the `ronin-masscan dump` command. # # @param [Array] masscan_files # The nmap `.xml` files to parse. diff --git a/man/ronin-masscan-targets.1.md b/man/ronin-masscan-dump.1.md similarity index 67% rename from man/ronin-masscan-targets.1.md rename to man/ronin-masscan-dump.1.md index e84f4e5..9f379e4 100644 --- a/man/ronin-masscan-targets.1.md +++ b/man/ronin-masscan-dump.1.md @@ -1,16 +1,26 @@ -# ronin-masscan-targets 1 "2023-03-01" Ronin "User Manuals" +# ronin-masscan-dump 1 "2023-03-01" Ronin "User Manuals" ## NAME -ronin-masscan-targets - Converts masscan scan files into a list of targets +ronin-masscan-dump - Dumps the scanned ports from masscan scan file(s) ## SYNOPSIS -`ronin-masscan targets` [options] *MASSCAN_FILE* +`ronin-masscan dump` [options] *MASSCAN_FILE* ## DESCRIPTION -Converts masscan scan files into a list of targets. +Dumps the scanned ports from masscan scan files into a variety of formats. The +output formats include: + +* IP +* Hostname +* `IP:PORT` +* `HOST:PORT` +* URI + +The command also supports filtering the scanned ports by IP, IP range, domain, +or port. ## ARGUMENTS @@ -57,23 +67,23 @@ Converts masscan scan files into a list of targets. Print `IP:PORT` pairs from the masscan scan file: - $ ronin-masscan targets --print-ip-ports masscan.bin + $ ronin-masscan dump --print-ip-ports masscan.bin Print `IP:PORT` pairs with ports 22, 80, or 443, from the masscan scan file: - $ ronin-masscan targets --print-ip-ports --ports 22,80,443 masscan.bin + $ ronin-masscan dump --print-ip-ports --ports 22,80,443 masscan.bin Print `HOST:PORT` pairs from the masscan scan file: - $ ronin-masscan targets --print-host-ports masscan.bin + $ ronin-masscan dump --print-host-ports masscan.bin Print target hostnames from the masscan scan file: - $ ronin-masscan targets --print-hosts --with-port 22 masscan.bin + $ ronin-masscan dump --print-hosts --with-port 22 masscan.bin Print URIs from the masscan scan file: - $ ronin-masscan targets --print-uris masscan.bin + $ ronin-masscan dump --print-uris masscan.bin ## AUTHOR diff --git a/man/ronin-masscan.1.md b/man/ronin-masscan.1.md index 7aaf23f..f21a2be 100644 --- a/man/ronin-masscan.1.md +++ b/man/ronin-masscan.1.md @@ -28,19 +28,19 @@ scan output files, and importing scan data into the database. *convert* : Converts an masscan scan file to JSON or CSV. +*dump* +: Dumps the scanned ports from masscan scan files. + *import* : Imports a masscan scan file into ronin-db. *scan* : Runs masscan and outputs data as JSON or CSV or imports into the database. -*targets* -: Converts masscan scan files into a list of targets. - ## AUTHOR Postmodern ## SEE ALSO -[ronin-masscan-convert](ronin-masscan-convert.1.md) [ronin-masscan-import](ronin-masscan-import.1.md) [ronin-masscan-scan](ronin-masscan-scan.1.md) [ronin-masscan-targets](ronin-masscan-targets.1.md) +[ronin-masscan-convert](ronin-masscan-convert.1.md) [ronin-masscan-dump](ronin-masscan-dump.1.md) [ronin-masscan-import](ronin-masscan-import.1.md) [ronin-masscan-scan](ronin-masscan-scan.1.md)