ronin-nmap 0.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.document +4 -0
  3. data/.github/workflows/ruby.yml +47 -0
  4. data/.gitignore +14 -0
  5. data/.rspec +1 -0
  6. data/.rubocop.yml +15 -0
  7. data/.ruby-version +1 -0
  8. data/.yardopts +1 -0
  9. data/COPYING.txt +165 -0
  10. data/ChangeLog.md +10 -0
  11. data/Gemfile +42 -0
  12. data/README.md +238 -0
  13. data/Rakefile +43 -0
  14. data/bin/ronin-nmap +32 -0
  15. data/data/completions/ronin-nmap +79 -0
  16. data/data/templates/script.rb.erb +58 -0
  17. data/gemspec.yml +42 -0
  18. data/lib/ronin/nmap/cli/command.rb +40 -0
  19. data/lib/ronin/nmap/cli/commands/completion.rb +61 -0
  20. data/lib/ronin/nmap/cli/commands/convert.rb +108 -0
  21. data/lib/ronin/nmap/cli/commands/dump.rb +293 -0
  22. data/lib/ronin/nmap/cli/commands/grep.rb +378 -0
  23. data/lib/ronin/nmap/cli/commands/import.rb +79 -0
  24. data/lib/ronin/nmap/cli/commands/new.rb +226 -0
  25. data/lib/ronin/nmap/cli/commands/print.rb +133 -0
  26. data/lib/ronin/nmap/cli/commands/scan.rb +233 -0
  27. data/lib/ronin/nmap/cli/filtering_options.rb +355 -0
  28. data/lib/ronin/nmap/cli/importable.rb +68 -0
  29. data/lib/ronin/nmap/cli/port_list.rb +102 -0
  30. data/lib/ronin/nmap/cli.rb +50 -0
  31. data/lib/ronin/nmap/converter.rb +114 -0
  32. data/lib/ronin/nmap/converters/csv.rb +162 -0
  33. data/lib/ronin/nmap/converters/json.rb +562 -0
  34. data/lib/ronin/nmap/converters.rb +54 -0
  35. data/lib/ronin/nmap/exceptions.rb +47 -0
  36. data/lib/ronin/nmap/importer.rb +369 -0
  37. data/lib/ronin/nmap/root.rb +28 -0
  38. data/lib/ronin/nmap/version.rb +26 -0
  39. data/lib/ronin/nmap.rb +223 -0
  40. data/man/ronin-nmap-completion.1 +76 -0
  41. data/man/ronin-nmap-completion.1.md +78 -0
  42. data/man/ronin-nmap-convert.1 +33 -0
  43. data/man/ronin-nmap-convert.1.md +36 -0
  44. data/man/ronin-nmap-dump.1 +141 -0
  45. data/man/ronin-nmap-dump.1.md +119 -0
  46. data/man/ronin-nmap-grep.1 +33 -0
  47. data/man/ronin-nmap-grep.1.md +36 -0
  48. data/man/ronin-nmap-import.1 +52 -0
  49. data/man/ronin-nmap-import.1.md +57 -0
  50. data/man/ronin-nmap-new.1 +81 -0
  51. data/man/ronin-nmap-new.1.md +73 -0
  52. data/man/ronin-nmap-print.1 +61 -0
  53. data/man/ronin-nmap-print.1.md +63 -0
  54. data/man/ronin-nmap-scan.1 +86 -0
  55. data/man/ronin-nmap-scan.1.md +84 -0
  56. data/man/ronin-nmap.1 +58 -0
  57. data/man/ronin-nmap.1.md +57 -0
  58. data/ronin-nmap.gemspec +62 -0
  59. data/scripts/setup +161 -0
  60. metadata +168 -0
@@ -0,0 +1,33 @@
1
+ .\" Generated by kramdown-man 1.0.1
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH ronin-nmap-grep 1 "2023-03-01" Ronin Nmap "User Manuals"
4
+ .SH NAME
5
+ .PP
6
+ ronin\-nmap\-grep \- Parses and searches nmap XML file(s) for the pattern\.
7
+ .SH SYNOPSIS
8
+ .PP
9
+ \fBronin\-nmap grep\fR \[lB]options\[rB] \fIPATTERN\fP \fIXML\[ru]FILE\fP \[lB]\.\.\.\[rB]
10
+ .SH DESCRIPTION
11
+ .PP
12
+ Parses one or more nmap XML files and searches the scan data for the text
13
+ pattern\. The scanned hosts that contain the text pattern are then printed
14
+ with the text pattern highlighted in red\.
15
+ .SH ARGUMENTS
16
+ .TP
17
+ \fIPATTERN\fP
18
+ The text pattern to search for\.
19
+ .TP
20
+ \fIXML\[ru]FILE\fP
21
+ The nmap XML file to import\.
22
+ .SH OPTIONS
23
+ .TP
24
+ \fB\-h\fR, \fB\-\-help\fR
25
+ Print help information
26
+ .SH AUTHOR
27
+ .PP
28
+ Postmodern
29
+ .MT postmodern\.mod3\[at]gmail\.com
30
+ .ME
31
+ .SH SEE ALSO
32
+ .PP
33
+ .BR ronin\-nmap\-print (1)
@@ -0,0 +1,36 @@
1
+ # ronin-nmap-grep 1 "2023-03-01" Ronin Nmap "User Manuals"
2
+
3
+ ## NAME
4
+
5
+ ronin-nmap-grep - Parses and searches nmap XML file(s) for the pattern.
6
+
7
+ ## SYNOPSIS
8
+
9
+ `ronin-nmap grep` [options] *PATTERN* *XML_FILE* [...]
10
+
11
+ ## DESCRIPTION
12
+
13
+ Parses one or more nmap XML files and searches the scan data for the text
14
+ pattern. The scanned hosts that contain the text pattern are then printed
15
+ with the text pattern highlighted in red.
16
+
17
+ ## ARGUMENTS
18
+
19
+ *PATTERN*
20
+ : The text pattern to search for.
21
+
22
+ *XML_FILE*
23
+ : The nmap XML file to import.
24
+
25
+ ## OPTIONS
26
+
27
+ `-h`, `--help`
28
+ : Print help information
29
+
30
+ ## AUTHOR
31
+
32
+ Postmodern <postmodern.mod3@gmail.com>
33
+
34
+ ## SEE ALSO
35
+
36
+ [ronin-nmap-print](ronin-nmap-print.1.md)
@@ -0,0 +1,52 @@
1
+ .\" Generated by kramdown-man 1.0.1
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH ronin-nmap-import 1 "2023-03-01" Ronin Nmap "User Manuals"
4
+ .SH NAME
5
+ .PP
6
+ ronin\-nmap\-import \- Imports an nmap XML file into ronin\-db
7
+ .SH SYNOPSIS
8
+ .PP
9
+ \fBronin\-nmap import\fR \[lB]\fIoptions\fP\[rB] \fIXML\[ru]FILE\fP
10
+ .SH DESCRIPTION
11
+ .PP
12
+ Imports the nmap XML file data into the Ronin database\.
13
+ .SH ARGUMENTS
14
+ .TP
15
+ \fIXML\[ru]FILE\fP
16
+ The nmap XML file to import\.
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\-h\fR, \fB\-\-help\fR
30
+ Print help information
31
+ .SH ENVIRONMENT
32
+ .TP
33
+ \fIHOME\fP
34
+ The user\[cq]s home directory\.
35
+ .TP
36
+ \fIXDG\[ru]CONFIG\[ru]HOME\fP
37
+ Alternate location for the \fB\[ti]\[sl]\.config\fR directory\.
38
+ .TP
39
+ \fIXDG\[ru]DATA\[ru]HOME\fP
40
+ Alternate location for the \fB\[ti]\[sl]\.local\[sl]share\fR directory\.
41
+ .SH FILES
42
+ .TP
43
+ \fB\[ti]\[sl]\.local\[sl]share\[sl]ronin\-db\[sl]database\.sqlite3\fR
44
+ The default sqlite3 database file\.
45
+ .TP
46
+ \fB\[ti]\[sl]\.config\[sl]ronin\-db\[sl]database\.yml\fR
47
+ Optional database configuration\.
48
+ .SH AUTHOR
49
+ .PP
50
+ Postmodern
51
+ .MT postmodern\.mod3\[at]gmail\.com
52
+ .ME
@@ -0,0 +1,57 @@
1
+ # ronin-nmap-import 1 "2023-03-01" Ronin Nmap "User Manuals"
2
+
3
+ ## NAME
4
+
5
+ ronin-nmap-import - Imports an nmap XML file into ronin-db
6
+
7
+ ## SYNOPSIS
8
+
9
+ `ronin-nmap import` [*options*] *XML_FILE*
10
+
11
+ ## DESCRIPTION
12
+
13
+ Imports the nmap XML file data into the Ronin database.
14
+
15
+ ## ARGUMENTS
16
+
17
+ *XML_FILE*
18
+ : The nmap XML file to import.
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
+ `-h`, `--help`
33
+ : Print help information
34
+
35
+ ## ENVIRONMENT
36
+
37
+ *HOME*
38
+ : The user's home directory.
39
+
40
+ *XDG_CONFIG_HOME*
41
+ : Alternate location for the `~/.config` directory.
42
+
43
+ *XDG_DATA_HOME*
44
+ : Alternate location for the `~/.local/share` directory.
45
+
46
+ ## FILES
47
+
48
+ `~/.local/share/ronin-db/database.sqlite3`
49
+ : The default sqlite3 database file.
50
+
51
+ `~/.config/ronin-db/database.yml`
52
+ : Optional database configuration.
53
+
54
+ ## AUTHOR
55
+
56
+ Postmodern <postmodern.mod3@gmail.com>
57
+
@@ -0,0 +1,81 @@
1
+ .\" Generated by kramdown-man 1.0.1
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH ronin-nmap-new 1 "2023-03-01" Ronin Nmap "User Manuals"
4
+ .SH NAME
5
+ .PP
6
+ ronin\-nmap\-new \- Generates a new nmap ruby script
7
+ .SH SYNOPSIS
8
+ .PP
9
+ \fBronin\-nmap new\fR \[lB]options\[rB] \fIFILE\fP
10
+ .SH DESCRIPTION
11
+ .PP
12
+ Generates a new nmap scanner or parser Ruby script that uses the \fBronin\-nmap\fR
13
+ library\.
14
+ .SH ARGUMENTS
15
+ .TP
16
+ \fIFILE\fP
17
+ The path to the new Ruby script to generate\.
18
+ .SH OPTIONS
19
+ .TP
20
+ \fB\-\-parser\fR
21
+ Generates a new nmap XML parser Ruby script\.
22
+ .TP
23
+ \fB\-\-scanner\fR
24
+ Generates a new nmap scanner Ruby script\.
25
+ .TP
26
+ \fB\-\-printing\fR
27
+ Adds additional code to the Ruby script that prints the nmap XML scan data\.
28
+ Is compatible with both \fB\-\-parser\fR and \fB\-\-scanner\fR\.
29
+ .TP
30
+ \fB\-\-import\fR
31
+ Adds additional code to the Ruby script that imports the nmap XML scan data\.
32
+ Is compatible with both \fB\-\-parser\fR and \fB\-\-scanner\fR\.
33
+ .TP
34
+ \fB\-\-xml\-file\fR \fIXML\[ru]FILE\fP
35
+ Parses or writes the scan results to the given XML File\.
36
+ Is compatible with both \fB\-\-parser\fR and \fB\-\-scanner\fR\.
37
+ .TP
38
+ \fB\-\-syn\-scan\fR
39
+ Enables SYN scanning\. Only compatible with the \fB\-\-scanner\fR option\.
40
+ .TP
41
+ \fB\-p\fR, \fB\-\-port\fR \[lC]\fIPORT\fP \[or] \[lB]\fIPORT1\fP\[rB]\-\[lB]\fIPORT2\fP\[rB]\[rC]\[lB],\.\.\.\[rB]
42
+ Specifies the ports to scan\. Not compatible with the \fB\-\-parser\fR option\.
43
+ .TP
44
+ \fB\-\-target\fR \fITARGET\fP
45
+ Adds a target to scan\. May be a host name, IP, IP CIDR range (ex:
46
+ \fB192\.168\.1\.1\[sl]24\fR), or IP glob range (ex: \fB192\.168\.*\.1\-4\fR)\.
47
+ Not compatible with the \fB\-\-parser\fR option\.
48
+ .TP
49
+ \fB\-h\fR, \fB\-\-help\fR
50
+ Print help information
51
+ .SH EXAMPLES
52
+ .PP
53
+ Generates a new nmap scanner Ruby script that scans \fBexample\.com\fR, ports 22, 80,
54
+ 443, and 8000 through 9000:
55
+ .PP
56
+ .RS 4
57
+ .EX
58
+ \[Do] ronin\-nmap new scanner\.rb \-\-target example\.com \-\-ports 22,80,443,8000\-9000
59
+ .EE
60
+ .RE
61
+ .PP
62
+ Generates a new nmap XML parser script that parses \fBpath\[sl]to\[sl]nmap\.xml\fR and prints
63
+ the scan information:
64
+ .PP
65
+ .RS 4
66
+ .EX
67
+ \[Do] ronin\-nmap new parser\.rb \-\-parser \-\-xml\-file path\[sl]to\[sl]nmap\.xml \-\-printing
68
+ .EE
69
+ .RE
70
+ .SH AUTHOR
71
+ .PP
72
+ Postmodern
73
+ .MT postmodern\.mod3\[at]gmail\.com
74
+ .ME
75
+ .SH SEE ALSO
76
+ .PP
77
+ .BR ronin\-nmap\-scan (1)
78
+ ,
79
+ .BR ronin\-nmap\-print (1)
80
+ ,
81
+ .BR ronin\-nmap\-import (1)
@@ -0,0 +1,73 @@
1
+ # ronin-nmap-new 1 "2023-03-01" Ronin Nmap "User Manuals"
2
+
3
+ ## NAME
4
+
5
+ ronin-nmap-new - Generates a new nmap ruby script
6
+
7
+ ## SYNOPSIS
8
+
9
+ `ronin-nmap new` [options] *FILE*
10
+
11
+ ## DESCRIPTION
12
+
13
+ Generates a new nmap scanner or parser Ruby script that uses the `ronin-nmap`
14
+ library.
15
+
16
+ ## ARGUMENTS
17
+
18
+ *FILE*
19
+ : The path to the new Ruby script to generate.
20
+
21
+ ## OPTIONS
22
+
23
+ `--parser`
24
+ : Generates a new nmap XML parser Ruby script.
25
+
26
+ `--scanner`
27
+ : Generates a new nmap scanner Ruby script.
28
+
29
+ `--printing`
30
+ : Adds additional code to the Ruby script that prints the nmap XML scan data.
31
+ Is compatible with both `--parser` and `--scanner`.
32
+
33
+ `--import`
34
+ : Adds additional code to the Ruby script that imports the nmap XML scan data.
35
+ Is compatible with both `--parser` and `--scanner`.
36
+
37
+ `--xml-file` *XML_FILE*
38
+ : Parses or writes the scan results to the given XML File.
39
+ Is compatible with both `--parser` and `--scanner`.
40
+
41
+ `--syn-scan`
42
+ : Enables SYN scanning. Only compatible with the `--scanner` option.
43
+
44
+ `-p`, `--port` {*PORT* \| \[*PORT1*\]-\[*PORT2*\]}[,...]
45
+ : Specifies the ports to scan. Not compatible with the `--parser` option.
46
+
47
+ `--target` *TARGET*
48
+ : Adds a target to scan. May be a host name, IP, IP CIDR range (ex:
49
+ `192.168.1.1/24`), or IP glob range (ex: `192.168.*.1-4`).
50
+ Not compatible with the `--parser` option.
51
+
52
+ `-h`, `--help`
53
+ : Print help information
54
+
55
+ ## EXAMPLES
56
+
57
+ Generates a new nmap scanner Ruby script that scans `example.com`, ports 22, 80,
58
+ 443, and 8000 through 9000:
59
+
60
+ $ ronin-nmap new scanner.rb --target example.com --ports 22,80,443,8000-9000
61
+
62
+ Generates a new nmap XML parser script that parses `path/to/nmap.xml` and prints
63
+ the scan information:
64
+
65
+ $ ronin-nmap new parser.rb --parser --xml-file path/to/nmap.xml --printing
66
+
67
+ ## AUTHOR
68
+
69
+ Postmodern <postmodern.mod3@gmail.com>
70
+
71
+ ## SEE ALSO
72
+
73
+ [ronin-nmap-scan](ronin-nmap-scan.1.md), [ronin-nmap-print](ronin-nmap-print.1.md), [ronin-nmap-import](ronin-nmap-import.1.md)
@@ -0,0 +1,61 @@
1
+ .\" Generated by kramdown-man 1.0.1
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH ronin-nmap-print 1 "2023-03-01" Ronin Nmap "User Manuals"
4
+ .SH NAME
5
+ .PP
6
+ ronin\-nmap\-print \- Print the scanned hosts from nmap XML file(s)\.
7
+ .SH SYNOPSIS
8
+ .PP
9
+ \fBronin\-nmap print\fR \[lB]options\[rB] \fIXML\[ru]FILE\fP \[lB]\.\.\.\[rB]
10
+ .SH DESCRIPTION
11
+ .PP
12
+ Parses an one or more nmap XML files and pretty prints the scanned hosts\.
13
+ The command also supports filtering the nmap targets by IP, IP range, domain,
14
+ OS, port, service, or NSE script\.
15
+ .SH ARGUMENTS
16
+ .TP
17
+ \fIXML\[ru]FILE\fP
18
+ The nmap XML file to import\.
19
+ .SH OPTIONS
20
+ .TP
21
+ \fB\-\-ip\fR \fIIP\fP
22
+ Filters the targets by a specific IP address\.
23
+ .TP
24
+ \fB\-\-ip\-range\fR \fICIDR\fP
25
+ Filter the targets by a CIDR IP range (ex: \fB192\.168\.1\.0\[sl]24\fR)\.
26
+ .TP
27
+ \fB\-\-domain\fR \fIDOMAIN\fP
28
+ Filters the targets by a domain (ex: \fBexample\.com\fR)\.
29
+ .TP
30
+ \fB\-\-with\-os\fR \fIOS\fP
31
+ Filters the targets by Operating System (ex: \fBLinux\fR, \fBWindows\fR, etc)\.
32
+ .TP
33
+ \fB\-\-with\-ports\fR \[lC]\fIPORT\fP \[or] \fIPORT1\fP\fB\-\fR\fIPORT2\fP\[rC]\fB,\fR\.\.\.
34
+ Filter targets that have open ports in the port list\.
35
+ The port list is a comma separated list of port numbers (\fB443\fR) or port
36
+ ranges (\fB8000\-9000\fR)\.
37
+ .TP
38
+ \fB\-\-with\-service\fR \fISERVICE\fP\[lB]\fB,\fR\.\.\.\[rB]
39
+ Filters targets who are running one of the specified services\.
40
+ .TP
41
+ \fB\-\-with\-script\fR \fISCRIPT\fP\[lB]\fB,\fR\.\.\.\[rB]
42
+ Filters targets that have the NSE script name(s)\.
43
+ .TP
44
+ \fB\-\-with\-script\-output\fR \fISTRING\fP
45
+ Filters targets that have NSE script output contain the string\.
46
+ .TP
47
+ \fB\-\-with\-script\-regex\fR \fB\[sl]\fR\fIREGEX\fP\fB\[sl]\fR
48
+ Filters targets that have NSE script output that matches the regular
49
+ expression\.
50
+ .TP
51
+ \fB\-h\fR, \fB\-\-help\fR
52
+ Print help information
53
+ .SH AUTHOR
54
+ .PP
55
+ Postmodern
56
+ .MT postmodern\.mod3\[at]gmail\.com
57
+ .ME
58
+ .SH SEE ALSO
59
+ .PP
60
+ .BR ronin\-nmap\-dump (1)
61
+ .BR ronin\-nmap\-grep (1)
@@ -0,0 +1,63 @@
1
+ # ronin-nmap-print 1 "2023-03-01" Ronin Nmap "User Manuals"
2
+
3
+ ## NAME
4
+
5
+ ronin-nmap-print - Print the scanned hosts from nmap XML file(s).
6
+
7
+ ## SYNOPSIS
8
+
9
+ `ronin-nmap print` [options] *XML_FILE* [...]
10
+
11
+ ## DESCRIPTION
12
+
13
+ Parses an one or more nmap XML files and pretty prints the scanned hosts.
14
+ The command also supports filtering the nmap targets by IP, IP range, domain,
15
+ OS, port, service, or NSE script.
16
+
17
+ ## ARGUMENTS
18
+
19
+ *XML_FILE*
20
+ : The nmap XML file to import.
21
+
22
+ ## OPTIONS
23
+
24
+ `--ip` *IP*
25
+ : Filters the targets by a specific IP address.
26
+
27
+ `--ip-range` *CIDR*
28
+ : Filter the targets by a CIDR IP range (ex: `192.168.1.0/24`).
29
+
30
+ `--domain` *DOMAIN*
31
+ : Filters the targets by a domain (ex: `example.com`).
32
+
33
+ `--with-os` *OS*
34
+ : Filters the targets by Operating System (ex: `Linux`, `Windows`, etc).
35
+
36
+ `--with-ports` {*PORT* \| *PORT1*`-`*PORT2*}`,`...
37
+ : Filter targets that have open ports in the port list.
38
+ The port list is a comma separated list of port numbers (`443`) or port
39
+ ranges (`8000-9000`).
40
+
41
+ `--with-service` *SERVICE*[`,`...]
42
+ : Filters targets who are running one of the specified services.
43
+
44
+ `--with-script` *SCRIPT*[`,`...]
45
+ : Filters targets that have the NSE script name(s).
46
+
47
+ `--with-script-output` *STRING*
48
+ : Filters targets that have NSE script output contain the string.
49
+
50
+ `--with-script-regex` `/`*REGEX*`/`
51
+ : Filters targets that have NSE script output that matches the regular
52
+ expression.
53
+
54
+ `-h`, `--help`
55
+ : Print help information
56
+
57
+ ## AUTHOR
58
+
59
+ Postmodern <postmodern.mod3@gmail.com>
60
+
61
+ ## SEE ALSO
62
+
63
+ [ronin-nmap-dump](ronin-nmap-dump.1.md) [ronin-nmap-grep](ronin-nmap-grep.1.md)
@@ -0,0 +1,86 @@
1
+ .\" Generated by kramdown-man 1.0.1
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH ronin-nmap-convert 1 "2023-03-01" Ronin Nmap "User Manuals"
4
+ .SH NAME
5
+ .PP
6
+ ronin\-nmap\-scan \- Runs nmap and outputs data as JSON or CSV or imports into the database
7
+ .SH SYNOPSIS
8
+ .PP
9
+ \fBronin\-nmap scan\fR \[lB]options\[rB] \fB\-\-\fR \fInmap\[ru]options\fP \.\.\.
10
+ .SH DESCRIPTION
11
+ .PP
12
+ Runs \fBnmap\fR and outputs data as JSON or CSV or imports into the database\.
13
+ .SH ARGUMENTS
14
+ .TP
15
+ \fInmap\[ru]options\fP
16
+ Additional options for the \fBnmap\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 \fBnmap\fR under \fBsudo\fR\. If the option is not given, then
31
+ \fBsudo\fR will automatically be enabled if the \fInmap\[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 \fBnmap\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 \fBxml\fR\[or]\fBjson\fR\[or]\fBcsv\fR
39
+ Explicitly specify the output format to XML, 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 \fBnmap\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\-nmap scan \-o scan\.json \-\- \-sV 192\.168\.1\.1
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\-nmap scan \-\-import \-\- \-sV 192\.168\.1\.1
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-nmap-convert 1 "2023-03-01" Ronin Nmap "User Manuals"
2
+
3
+ ## NAME
4
+
5
+ ronin-nmap-scan - Runs nmap and outputs data as JSON or CSV or imports into the database
6
+
7
+ ## SYNOPSIS
8
+
9
+ `ronin-nmap scan` [options] `--` *nmap_options* ...
10
+
11
+ ## DESCRIPTION
12
+
13
+ Runs `nmap` and outputs data as JSON or CSV or imports into the database.
14
+
15
+ ## ARGUMENTS
16
+
17
+ *nmap_options*
18
+ : Additional options for the `nmap` 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 `nmap` under `sudo`. If the option is not given, then
34
+ `sudo` will automatically be enabled if the *nmap_options* includes a
35
+ privileged option (ex: `-sS`, `-O`, etc).
36
+
37
+ `-o`, `--output` *FILE*
38
+ : Sets the output file to save the `nmap` scan results to. May be a `.xml`,
39
+ `.json`, or `.csv` file.
40
+
41
+ `-F`, `--output-format` `xml`|`json`|`csv`
42
+ : Explicitly specify the output format to XML, 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 `nmap` 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-nmap scan -o scan.json -- -sV 192.168.1.1
76
+
77
+ Service scans `192.168.1.1` and saves the scan results to the Ronin database:
78
+
79
+ $ ronin-nmap scan --import -- -sV 192.168.1.1
80
+
81
+ ## AUTHOR
82
+
83
+ Postmodern <postmodern.mod3@gmail.com>
84
+
data/man/ronin-nmap.1 ADDED
@@ -0,0 +1,58 @@
1
+ .\" Generated by kramdown-man 1.0.1
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH ronin-nmap 1 "2024-01-01" Ronin Nmap "User Manuals"
4
+ .SH NAME
5
+ .PP
6
+ ronin\-nmap \- A CLI for working with nmap
7
+ .SH SYNOPSIS
8
+ .PP
9
+ \fBronin\-nmap\fR \[lB]\fIoptions\fP\[rB] \[lB]\fICOMMAND\fP \[lB]\.\.\.\[rB]\[rB]
10
+ .SH DESCRIPTION
11
+ .PP
12
+ \fBronin\-nmap\fR provides various commands for automating \fBnmap\fR, parsing
13
+ XML output files, and importing scan data into the database\.
14
+ .PP
15
+ Runs a \fBronin\-nmap\fR \fICOMMAND\fP\.
16
+ .SH ARGUMENTS
17
+ .TP
18
+ \fICOMMAND\fP
19
+ The \fBronin\-nmap\fR command to execute\.
20
+ .SH OPTIONS
21
+ .TP
22
+ \fB\-h\fR, \fB\-\-help\fR
23
+ Print help information
24
+ .SH COMMANDS
25
+ .TP
26
+ \fIcompletion\fP
27
+ Manages the shell completion rules for \fBronin\-nmap\fR\.
28
+ .TP
29
+ \fIconvert\fP
30
+ Converts an nmap XML file to JSON or CSV\.
31
+ .TP
32
+ \fIdump\fP
33
+ Dumps the targets from an nmap XML file\.
34
+ .TP
35
+ \fIimport\fP
36
+ Imports an nmap XML file into ronin\-db\.
37
+ .TP
38
+ \fInew\fP
39
+ Generates a new nmap Ruby script\.
40
+ .TP
41
+ \fIprint\fP
42
+ Prints the scanned hosts from nmap XML file(s)\.
43
+ .TP
44
+ \fIscan\fP
45
+ Runs nmap and outputs data as JSON or CSV or imports into the database\.
46
+ .SH AUTHOR
47
+ .PP
48
+ Postmodern
49
+ .MT postmodern\.mod3\[at]gmail\.com
50
+ .ME
51
+ .SH SEE ALSO
52
+ .PP
53
+ .BR ronin\-nmap\-completion (1)
54
+ .BR ronin\-nmap\-convert (1)
55
+ .BR ronin\-nmap\-dump (1)
56
+ .BR ronin\-nmap\-import (1)
57
+ .BR ronin\-nmap\-new (1)
58
+ .BR ronin\-nmap\-scan (1)