ronin-db 0.1.2-java → 0.2.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +3 -2
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/ChangeLog.md +35 -0
- data/Gemfile +6 -4
- data/README.md +17 -5
- data/Rakefile +13 -35
- data/data/completions/ronin-db +271 -0
- data/gemspec.yml +17 -2
- data/lib/ronin/db/cli/command.rb +1 -1
- data/lib/ronin/db/cli/commands/add.rb +1 -1
- data/lib/ronin/db/cli/commands/asn.rb +12 -2
- data/lib/ronin/db/cli/commands/certs.rb +322 -0
- data/lib/ronin/db/cli/commands/completion.rb +63 -0
- data/lib/ronin/db/cli/commands/creds.rb +2 -1
- data/lib/ronin/db/cli/commands/edit.rb +1 -1
- data/lib/ronin/db/cli/commands/emails.rb +22 -1
- data/lib/ronin/db/cli/commands/hosts.rb +2 -1
- data/lib/ronin/db/cli/commands/ips.rb +2 -1
- data/lib/ronin/db/cli/commands/irb.rb +8 -4
- data/lib/ronin/db/cli/commands/list.rb +1 -1
- data/lib/ronin/db/cli/commands/migrate.rb +12 -8
- data/lib/ronin/db/cli/commands/open_ports.rb +102 -0
- data/lib/ronin/db/cli/commands/oses.rb +95 -0
- data/lib/ronin/db/cli/commands/passwords.rb +83 -0
- data/lib/ronin/db/cli/commands/people.rb +185 -0
- data/lib/ronin/db/cli/commands/phone_numbers.rb +136 -0
- data/lib/ronin/db/cli/commands/ports.rb +103 -0
- data/lib/ronin/db/cli/commands/remove.rb +1 -1
- data/lib/ronin/db/cli/commands/services.rb +102 -0
- data/lib/ronin/db/cli/commands/software.rb +95 -0
- data/lib/ronin/db/cli/commands/street_addresses.rb +129 -0
- data/lib/ronin/db/cli/commands/urls.rb +2 -1
- data/lib/ronin/db/cli/commands/web_vulns.rb +235 -0
- data/lib/ronin/db/cli/database_options.rb +87 -0
- data/lib/ronin/db/cli/deletable.rb +85 -0
- data/lib/ronin/db/cli/importable.rb +108 -0
- data/lib/ronin/db/cli/model_command.rb +8 -6
- data/lib/ronin/db/cli/modifiable.rb +12 -104
- data/lib/ronin/db/cli/printing.rb +58 -0
- data/lib/ronin/db/cli/ruby_shell.rb +1 -1
- data/lib/ronin/db/cli/uri_methods.rb +1 -1
- data/lib/ronin/db/cli.rb +5 -1
- data/lib/ronin/db/config_file.rb +13 -8
- data/lib/ronin/db/exceptions.rb +10 -1
- data/lib/ronin/db/home.rb +1 -1
- data/lib/ronin/db/root.rb +1 -1
- data/lib/ronin/db/tasks.rb +87 -0
- data/lib/ronin/db/version.rb +2 -2
- data/lib/ronin/db.rb +24 -7
- data/man/ronin-db-add.1 +48 -70
- data/man/ronin-db-add.1.md +26 -22
- data/man/ronin-db-asn.1 +37 -55
- data/man/ronin-db-asn.1.md +29 -19
- data/man/ronin-db-certs.1 +108 -0
- data/man/ronin-db-certs.1.md +106 -0
- data/man/ronin-db-completion.1 +76 -0
- data/man/ronin-db-completion.1.md +78 -0
- data/man/ronin-db-creds.1 +29 -47
- data/man/ronin-db-creds.1.md +23 -16
- data/man/ronin-db-edit.1 +16 -27
- data/man/ronin-db-edit.1.md +11 -7
- data/man/ronin-db-emails.1 +37 -50
- data/man/ronin-db-emails.1.md +30 -17
- data/man/ronin-db-hosts.1 +32 -52
- data/man/ronin-db-hosts.1.md +25 -18
- data/man/ronin-db-ips.1 +32 -53
- data/man/ronin-db-ips.1.md +26 -19
- data/man/ronin-db-irb.1 +23 -36
- data/man/ronin-db-irb.1.md +17 -10
- data/man/ronin-db-list.1 +17 -31
- data/man/ronin-db-list.1.md +13 -9
- data/man/ronin-db-migrate.1 +23 -36
- data/man/ronin-db-migrate.1.md +17 -10
- data/man/ronin-db-open-ports.1 +72 -0
- data/man/ronin-db-open-ports.1.md +70 -0
- data/man/ronin-db-oses.1 +72 -0
- data/man/ronin-db-oses.1.md +70 -0
- data/man/ronin-db-passwords.1 +75 -0
- data/man/ronin-db-passwords.1.md +73 -0
- data/man/ronin-db-people.1 +96 -0
- data/man/ronin-db-people.1.md +94 -0
- data/man/ronin-db-phone-numbers.1 +93 -0
- data/man/ronin-db-phone-numbers.1.md +91 -0
- data/man/ronin-db-ports.1 +87 -0
- data/man/ronin-db-ports.1.md +85 -0
- data/man/ronin-db-remove.1 +16 -29
- data/man/ronin-db-remove.1.md +12 -8
- data/man/ronin-db-services.1 +84 -0
- data/man/ronin-db-services.1.md +82 -0
- data/man/ronin-db-software.1 +72 -0
- data/man/ronin-db-software.1.md +70 -0
- data/man/ronin-db-street-addresses.1 +81 -0
- data/man/ronin-db-street-addresses.1.md +79 -0
- data/man/ronin-db-urls.1 +38 -61
- data/man/ronin-db-urls.1.md +28 -21
- data/man/ronin-db-web-vulns.1 +87 -0
- data/man/ronin-db-web-vulns.1.md +85 -0
- data/man/ronin-db.1 +118 -0
- data/man/ronin-db.1.md +99 -0
- data/scripts/setup +58 -0
- metadata +70 -13
- data/lib/ronin/db/cli/database_command.rb +0 -71
- data/lib/ronin/db/cli/resources_command.rb +0 -118
data/man/ronin-db.1
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
.\" Generated by kramdown-man 1.0.1
|
2
|
+
.\" https://github.com/postmodern/kramdown-man#readme
|
3
|
+
.TH ronin-db 1 "2023-02-01" Ronin DB "User Manuals"
|
4
|
+
.SH NAME
|
5
|
+
.PP
|
6
|
+
ronin\-db \- manages ronin\[cq]s database(s)
|
7
|
+
.SH SYNOPSIS
|
8
|
+
.PP
|
9
|
+
\fBronin\-db\fR \[lB]\fIoptions\fP\[rB] \[lB]\fICOMMAND\fP\[rB]
|
10
|
+
.SH DESCRIPTION
|
11
|
+
.PP
|
12
|
+
The \fBronin\-db\fR provides commands for adding, removing, listing, databases,
|
13
|
+
and querying, inserting, or deleting data from the various tables within a
|
14
|
+
database\.
|
15
|
+
.SH OPTIONS
|
16
|
+
.TP
|
17
|
+
\fB\-h\fR, \fB\-\-help\fR
|
18
|
+
Prints help information\.
|
19
|
+
.SH COMMANDS
|
20
|
+
.TP
|
21
|
+
\fBadd\fR
|
22
|
+
Adds a pre\-existing database to ronin\-db\.
|
23
|
+
.TP
|
24
|
+
\fBasn\fR
|
25
|
+
Queries and updates ASNs\.
|
26
|
+
.TP
|
27
|
+
\fBcerts\fR
|
28
|
+
Queries or imports SSL\[sl]TLS certificates\.
|
29
|
+
.TP
|
30
|
+
\fBcompletion\fR
|
31
|
+
Manages shell completion rules for the \fBronin\-db\fR command\.
|
32
|
+
.TP
|
33
|
+
\fBcreds\fR
|
34
|
+
Manages all credentials in the database\.
|
35
|
+
.TP
|
36
|
+
\fBedit\fR
|
37
|
+
Manually edits the \fBdatabase\.yml\fR configuration file\.
|
38
|
+
.TP
|
39
|
+
\fBemails\fR
|
40
|
+
Manages all email addresses in the database\.
|
41
|
+
.TP
|
42
|
+
\fBhosts\fR
|
43
|
+
Manages all host names in the database\.
|
44
|
+
.TP
|
45
|
+
\fBips\fR
|
46
|
+
Manages IP addresses in the database\.
|
47
|
+
.TP
|
48
|
+
\fBirb\fR
|
49
|
+
Connects to a database and start an interactive Ruby shell\.
|
50
|
+
.TP
|
51
|
+
\fBlist\fR
|
52
|
+
List the configured database(s)\.
|
53
|
+
.TP
|
54
|
+
\fBmigrate\fR
|
55
|
+
Runs database migrations\.
|
56
|
+
.TP
|
57
|
+
\fBopen\-ports\fR
|
58
|
+
Queries open ports in the database\.
|
59
|
+
.TP
|
60
|
+
\fBoses\fR
|
61
|
+
Queries OSes in the database
|
62
|
+
.TP
|
63
|
+
\fBpasswords\fR
|
64
|
+
Manages all passwords in the database\.
|
65
|
+
.TP
|
66
|
+
\fBpeople\fR
|
67
|
+
Queries people in the database\.
|
68
|
+
.TP
|
69
|
+
\fBphone\-numbers\fR
|
70
|
+
Manages phone numbers in the database\.
|
71
|
+
.TP
|
72
|
+
\fBports\fR
|
73
|
+
Manages port numbers in the database\.
|
74
|
+
.TP
|
75
|
+
\fBremove\fR
|
76
|
+
Removes a database from the configuration file\.
|
77
|
+
.TP
|
78
|
+
\fBservices\fR
|
79
|
+
Manages services in the database\.
|
80
|
+
.TP
|
81
|
+
\fBsoftware\fR
|
82
|
+
Queries software in the database\.
|
83
|
+
.TP
|
84
|
+
\fBstreet\-addresses\fR
|
85
|
+
Queries street addresses in the database\.
|
86
|
+
.TP
|
87
|
+
\fBurls\fR
|
88
|
+
Manages URLs in the database\.
|
89
|
+
.SH AUTHOR
|
90
|
+
.PP
|
91
|
+
Postmodern
|
92
|
+
.MT postmodern\.mod3\[at]gmail\.com
|
93
|
+
.ME
|
94
|
+
.SH SEE ALSO
|
95
|
+
.PP
|
96
|
+
.BR ronin\-db\-add (1)
|
97
|
+
.BR ronin\-db\-asn (1)
|
98
|
+
.BR ronin\-db\-certs (1)
|
99
|
+
.BR ronin\-db\-completion (1)
|
100
|
+
.BR ronin\-db\-creds (1)
|
101
|
+
.BR ronin\-db\-edit (1)
|
102
|
+
.BR ronin\-db\-emails (1)
|
103
|
+
.BR ronin\-db\-hosts (1)
|
104
|
+
.BR ronin\-db\-ips (1)
|
105
|
+
.BR ronin\-db\-irb (1)
|
106
|
+
.BR ronin\-db\-list (1)
|
107
|
+
.BR ronin\-db\-migrate (1)
|
108
|
+
.BR ronin\-db\-open\-ports (1)
|
109
|
+
.BR ronin\-db\-oses (1)
|
110
|
+
.BR ronin\-db\-passwords (1)
|
111
|
+
.BR ronin\-db\-people (1)
|
112
|
+
.BR ronin\-db\-phone\-numbers (1)
|
113
|
+
.BR ronin\-db\-ports (1)
|
114
|
+
.BR ronin\-db\-remove (1)
|
115
|
+
.BR ronin\-db\-services (1)
|
116
|
+
.BR ronin\-db\-software (1)
|
117
|
+
.BR ronin\-db\-street\-addresses (1)
|
118
|
+
.BR ronin\-db\-urls (1)
|
data/man/ronin-db.1.md
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
# ronin-db 1 "2023-02-01" Ronin DB "User Manuals"
|
2
|
+
|
3
|
+
## NAME
|
4
|
+
|
5
|
+
ronin-db - manages ronin's database(s)
|
6
|
+
|
7
|
+
## SYNOPSIS
|
8
|
+
|
9
|
+
`ronin-db` [*options*] [*COMMAND*]
|
10
|
+
|
11
|
+
## DESCRIPTION
|
12
|
+
|
13
|
+
The `ronin-db` provides commands for adding, removing, listing, databases,
|
14
|
+
and querying, inserting, or deleting data from the various tables within a
|
15
|
+
database.
|
16
|
+
|
17
|
+
## OPTIONS
|
18
|
+
|
19
|
+
`-h`, `--help`
|
20
|
+
: Prints help information.
|
21
|
+
|
22
|
+
## COMMANDS
|
23
|
+
|
24
|
+
`add`
|
25
|
+
: Adds a pre-existing database to ronin-db.
|
26
|
+
|
27
|
+
`asn`
|
28
|
+
: Queries and updates ASNs.
|
29
|
+
|
30
|
+
`certs`
|
31
|
+
: Queries or imports SSL/TLS certificates.
|
32
|
+
|
33
|
+
`completion`
|
34
|
+
: Manages shell completion rules for the `ronin-db` command.
|
35
|
+
|
36
|
+
`creds`
|
37
|
+
: Manages all credentials in the database.
|
38
|
+
|
39
|
+
`edit`
|
40
|
+
: Manually edits the `database.yml` configuration file.
|
41
|
+
|
42
|
+
`emails`
|
43
|
+
: Manages all email addresses in the database.
|
44
|
+
|
45
|
+
`hosts`
|
46
|
+
: Manages all host names in the database.
|
47
|
+
|
48
|
+
`ips`
|
49
|
+
: Manages IP addresses in the database.
|
50
|
+
|
51
|
+
`irb`
|
52
|
+
: Connects to a database and start an interactive Ruby shell.
|
53
|
+
|
54
|
+
`list`
|
55
|
+
: List the configured database(s).
|
56
|
+
|
57
|
+
`migrate`
|
58
|
+
: Runs database migrations.
|
59
|
+
|
60
|
+
`open-ports`
|
61
|
+
: Queries open ports in the database.
|
62
|
+
|
63
|
+
`oses`
|
64
|
+
: Queries OSes in the database
|
65
|
+
|
66
|
+
`passwords`
|
67
|
+
: Manages all passwords in the database.
|
68
|
+
|
69
|
+
`people`
|
70
|
+
: Queries people in the database.
|
71
|
+
|
72
|
+
`phone-numbers`
|
73
|
+
: Manages phone numbers in the database.
|
74
|
+
|
75
|
+
`ports`
|
76
|
+
: Manages port numbers in the database.
|
77
|
+
|
78
|
+
`remove`
|
79
|
+
: Removes a database from the configuration file.
|
80
|
+
|
81
|
+
`services`
|
82
|
+
: Manages services in the database.
|
83
|
+
|
84
|
+
`software`
|
85
|
+
: Queries software in the database.
|
86
|
+
|
87
|
+
`street-addresses`
|
88
|
+
: Queries street addresses in the database.
|
89
|
+
|
90
|
+
`urls`
|
91
|
+
: Manages URLs in the database.
|
92
|
+
|
93
|
+
## AUTHOR
|
94
|
+
|
95
|
+
Postmodern <postmodern.mod3@gmail.com>
|
96
|
+
|
97
|
+
## SEE ALSO
|
98
|
+
|
99
|
+
[ronin-db-add](ronin-db-add.1.md) [ronin-db-asn](ronin-db-asn.1.md) [ronin-db-certs](ronin-db-certs.1.md) [ronin-db-completion](ronin-db-completion.1.md) [ronin-db-creds](ronin-db-creds.1.md) [ronin-db-edit](ronin-db-edit.1.md) [ronin-db-emails](ronin-db-emails.1.md) [ronin-db-hosts](ronin-db-hosts.1.md) [ronin-db-ips](ronin-db-ips.1.md) [ronin-db-irb](ronin-db-irb.1.md) [ronin-db-list](ronin-db-list.1.md) [ronin-db-migrate](ronin-db-migrate.1.md) [ronin-db-open-ports](ronin-db-open-ports.1.md) [ronin-db-oses](ronin-db-oses.1.md) [ronin-db-passwords](ronin-db-passwords.1.md) [ronin-db-people](ronin-db-people.1.md) [ronin-db-phone-numbers](ronin-db-phone-numbers.1.md) [ronin-db-ports](ronin-db-ports.1.md) [ronin-db-remove](ronin-db-remove.1.md) [ronin-db-services](ronin-db-services.1.md) [ronin-db-software](ronin-db-software.1.md) [ronin-db-street-addresses](ronin-db-street-addresses.1.md) [ronin-db-urls](ronin-db-urls.1.md)
|
data/scripts/setup
ADDED
@@ -0,0 +1,58 @@
|
|
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
|
+
# default to installing gems into vendor/bundle
|
49
|
+
if [[ ! -f .bundle/config ]]; then
|
50
|
+
bundle config set --local path vendor/bundle >/dev/null || \
|
51
|
+
fail "Failed to run 'bundle config'"
|
52
|
+
fi
|
53
|
+
|
54
|
+
log "Installing gems ..."
|
55
|
+
bundle install || fail "Failed to run 'bundle install'!"
|
56
|
+
|
57
|
+
log "Setting up the project ..."
|
58
|
+
bundle exec rake setup || "Failed to run 'rake setup'!"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ronin-db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -17,27 +17,41 @@ dependencies:
|
|
17
17
|
- !ruby/object:Gem::Version
|
18
18
|
version: '70.0'
|
19
19
|
name: activerecord-jdbcsqlite3-adapter
|
20
|
-
prerelease: false
|
21
20
|
type: :runtime
|
21
|
+
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '70.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 7.1.0
|
33
|
+
name: activerecord
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "<"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 7.1.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
requirement: !ruby/object:Gem::Requirement
|
29
43
|
requirements:
|
30
44
|
- - "~>"
|
31
45
|
- !ruby/object:Gem::Version
|
32
|
-
version: '0.
|
46
|
+
version: '0.2'
|
33
47
|
name: ronin-db-activerecord
|
34
|
-
prerelease: false
|
35
48
|
type: :runtime
|
49
|
+
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
54
|
+
version: '0.2'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
requirement: !ruby/object:Gem::Requirement
|
43
57
|
requirements:
|
@@ -45,8 +59,8 @@ dependencies:
|
|
45
59
|
- !ruby/object:Gem::Version
|
46
60
|
version: '1.0'
|
47
61
|
name: ronin-support
|
48
|
-
prerelease: false
|
49
62
|
type: :runtime
|
63
|
+
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
@@ -57,15 +71,15 @@ dependencies:
|
|
57
71
|
requirements:
|
58
72
|
- - "~>"
|
59
73
|
- !ruby/object:Gem::Version
|
60
|
-
version: '0.
|
74
|
+
version: '0.2'
|
61
75
|
name: ronin-core
|
62
|
-
prerelease: false
|
63
76
|
type: :runtime
|
77
|
+
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0.
|
82
|
+
version: '0.2'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
requirement: !ruby/object:Gem::Requirement
|
71
85
|
requirements:
|
@@ -73,8 +87,8 @@ dependencies:
|
|
73
87
|
- !ruby/object:Gem::Version
|
74
88
|
version: '2.0'
|
75
89
|
name: bundler
|
76
|
-
prerelease: false
|
77
90
|
type: :development
|
91
|
+
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
@@ -108,12 +122,15 @@ files:
|
|
108
122
|
- README.md
|
109
123
|
- Rakefile
|
110
124
|
- bin/ronin-db
|
125
|
+
- data/completions/ronin-db
|
111
126
|
- gemspec.yml
|
112
127
|
- lib/ronin/db.rb
|
113
128
|
- lib/ronin/db/cli.rb
|
114
129
|
- lib/ronin/db/cli/command.rb
|
115
130
|
- lib/ronin/db/cli/commands/add.rb
|
116
131
|
- lib/ronin/db/cli/commands/asn.rb
|
132
|
+
- lib/ronin/db/cli/commands/certs.rb
|
133
|
+
- lib/ronin/db/cli/commands/completion.rb
|
117
134
|
- lib/ronin/db/cli/commands/creds.rb
|
118
135
|
- lib/ronin/db/cli/commands/edit.rb
|
119
136
|
- lib/ronin/db/cli/commands/emails.rb
|
@@ -122,23 +139,40 @@ files:
|
|
122
139
|
- lib/ronin/db/cli/commands/irb.rb
|
123
140
|
- lib/ronin/db/cli/commands/list.rb
|
124
141
|
- lib/ronin/db/cli/commands/migrate.rb
|
142
|
+
- lib/ronin/db/cli/commands/open_ports.rb
|
143
|
+
- lib/ronin/db/cli/commands/oses.rb
|
144
|
+
- lib/ronin/db/cli/commands/passwords.rb
|
145
|
+
- lib/ronin/db/cli/commands/people.rb
|
146
|
+
- lib/ronin/db/cli/commands/phone_numbers.rb
|
147
|
+
- lib/ronin/db/cli/commands/ports.rb
|
125
148
|
- lib/ronin/db/cli/commands/remove.rb
|
149
|
+
- lib/ronin/db/cli/commands/services.rb
|
150
|
+
- lib/ronin/db/cli/commands/software.rb
|
151
|
+
- lib/ronin/db/cli/commands/street_addresses.rb
|
126
152
|
- lib/ronin/db/cli/commands/urls.rb
|
127
|
-
- lib/ronin/db/cli/
|
153
|
+
- lib/ronin/db/cli/commands/web_vulns.rb
|
154
|
+
- lib/ronin/db/cli/database_options.rb
|
155
|
+
- lib/ronin/db/cli/deletable.rb
|
156
|
+
- lib/ronin/db/cli/importable.rb
|
128
157
|
- lib/ronin/db/cli/model_command.rb
|
129
158
|
- lib/ronin/db/cli/modifiable.rb
|
130
|
-
- lib/ronin/db/cli/
|
159
|
+
- lib/ronin/db/cli/printing.rb
|
131
160
|
- lib/ronin/db/cli/ruby_shell.rb
|
132
161
|
- lib/ronin/db/cli/uri_methods.rb
|
133
162
|
- lib/ronin/db/config_file.rb
|
134
163
|
- lib/ronin/db/exceptions.rb
|
135
164
|
- lib/ronin/db/home.rb
|
136
165
|
- lib/ronin/db/root.rb
|
166
|
+
- lib/ronin/db/tasks.rb
|
137
167
|
- lib/ronin/db/version.rb
|
138
168
|
- man/ronin-db-add.1
|
139
169
|
- man/ronin-db-add.1.md
|
140
170
|
- man/ronin-db-asn.1
|
141
171
|
- man/ronin-db-asn.1.md
|
172
|
+
- man/ronin-db-certs.1
|
173
|
+
- man/ronin-db-certs.1.md
|
174
|
+
- man/ronin-db-completion.1
|
175
|
+
- man/ronin-db-completion.1.md
|
142
176
|
- man/ronin-db-creds.1
|
143
177
|
- man/ronin-db-creds.1.md
|
144
178
|
- man/ronin-db-edit.1
|
@@ -155,11 +189,34 @@ files:
|
|
155
189
|
- man/ronin-db-list.1.md
|
156
190
|
- man/ronin-db-migrate.1
|
157
191
|
- man/ronin-db-migrate.1.md
|
192
|
+
- man/ronin-db-open-ports.1
|
193
|
+
- man/ronin-db-open-ports.1.md
|
194
|
+
- man/ronin-db-oses.1
|
195
|
+
- man/ronin-db-oses.1.md
|
196
|
+
- man/ronin-db-passwords.1
|
197
|
+
- man/ronin-db-passwords.1.md
|
198
|
+
- man/ronin-db-people.1
|
199
|
+
- man/ronin-db-people.1.md
|
200
|
+
- man/ronin-db-phone-numbers.1
|
201
|
+
- man/ronin-db-phone-numbers.1.md
|
202
|
+
- man/ronin-db-ports.1
|
203
|
+
- man/ronin-db-ports.1.md
|
158
204
|
- man/ronin-db-remove.1
|
159
205
|
- man/ronin-db-remove.1.md
|
206
|
+
- man/ronin-db-services.1
|
207
|
+
- man/ronin-db-services.1.md
|
208
|
+
- man/ronin-db-software.1
|
209
|
+
- man/ronin-db-software.1.md
|
210
|
+
- man/ronin-db-street-addresses.1
|
211
|
+
- man/ronin-db-street-addresses.1.md
|
160
212
|
- man/ronin-db-urls.1
|
161
213
|
- man/ronin-db-urls.1.md
|
214
|
+
- man/ronin-db-web-vulns.1
|
215
|
+
- man/ronin-db-web-vulns.1.md
|
216
|
+
- man/ronin-db.1
|
217
|
+
- man/ronin-db.1.md
|
162
218
|
- ronin-db.gemspec
|
219
|
+
- scripts/setup
|
163
220
|
homepage: https://ronin-rb.dev
|
164
221
|
licenses:
|
165
222
|
- LGPL-3.0
|
@@ -1,71 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
#
|
3
|
-
# ronin-db - A common database library for managing and querying security data.
|
4
|
-
#
|
5
|
-
# Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
6
|
-
#
|
7
|
-
# ronin-db 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-db 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-db. If not, see <https://www.gnu.org/licenses/>.
|
19
|
-
#
|
20
|
-
|
21
|
-
require 'ronin/db/cli/command'
|
22
|
-
require 'ronin/db/cli/uri_methods'
|
23
|
-
require 'ronin/db'
|
24
|
-
|
25
|
-
module Ronin
|
26
|
-
module DB
|
27
|
-
class CLI
|
28
|
-
#
|
29
|
-
# Base class for all commands that access the database.
|
30
|
-
#
|
31
|
-
class DatabaseCommand < Command
|
32
|
-
|
33
|
-
include URIMethods
|
34
|
-
|
35
|
-
option :db, value: {
|
36
|
-
type: DB.config.keys,
|
37
|
-
default: :default,
|
38
|
-
usage: 'NAME'
|
39
|
-
},
|
40
|
-
desc: 'The database to connect to'
|
41
|
-
|
42
|
-
option :db_uri, value: {
|
43
|
-
type: String,
|
44
|
-
usage: 'URI'
|
45
|
-
},
|
46
|
-
desc: 'The database URI to connect to'
|
47
|
-
|
48
|
-
#
|
49
|
-
# The database connection configuration.
|
50
|
-
#
|
51
|
-
# @return [Hash{Symbol => String,Integer}]
|
52
|
-
#
|
53
|
-
def config
|
54
|
-
if options[:db_uri]
|
55
|
-
parse_uri(options[:db_uri])
|
56
|
-
else
|
57
|
-
DB.config[options[:db]]
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
#
|
62
|
-
# Connects to the database.
|
63
|
-
#
|
64
|
-
def connect
|
65
|
-
DB.connect(config)
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,118 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
#
|
3
|
-
# ronin-db - A common database library for managing and querying security data.
|
4
|
-
#
|
5
|
-
# Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
|
6
|
-
#
|
7
|
-
# ronin-db 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-db 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-db. If not, see <https://www.gnu.org/licenses/>.
|
19
|
-
#
|
20
|
-
|
21
|
-
require 'ronin/ui/cli/model_command'
|
22
|
-
require 'ronin/db/model/importable'
|
23
|
-
|
24
|
-
require 'dm-serializer'
|
25
|
-
|
26
|
-
module Ronin
|
27
|
-
module DB
|
28
|
-
module CLI
|
29
|
-
#
|
30
|
-
# A base-command class for listing Database Resources.
|
31
|
-
#
|
32
|
-
class ResourcesCommand < ModelCommand
|
33
|
-
|
34
|
-
option :csv, type: true,
|
35
|
-
description: 'CSV output'
|
36
|
-
|
37
|
-
option :xml, type: true,
|
38
|
-
description: 'XML output'
|
39
|
-
|
40
|
-
option :yaml, type: true,
|
41
|
-
description: 'YAML output'
|
42
|
-
|
43
|
-
option :json, type: true,
|
44
|
-
description: 'JSON output'
|
45
|
-
|
46
|
-
#
|
47
|
-
# Default method performs the query and prints the found resources.
|
48
|
-
#
|
49
|
-
# @since 1.1.0
|
50
|
-
#
|
51
|
-
# @api semipublic
|
52
|
-
#
|
53
|
-
def execute
|
54
|
-
if @import
|
55
|
-
self.class.model.import(@import) do |resource|
|
56
|
-
print_info "Imported #{resource}"
|
57
|
-
end
|
58
|
-
else
|
59
|
-
print_resources(query)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
#
|
64
|
-
# Sets the model used by the command.
|
65
|
-
#
|
66
|
-
# @see ModelCommand.model
|
67
|
-
#
|
68
|
-
# @since 1.3.0
|
69
|
-
#
|
70
|
-
def self.model(model=nil)
|
71
|
-
if (model && model < Model::Importable)
|
72
|
-
option :import, type: String,
|
73
|
-
flag: '-i',
|
74
|
-
usage: 'FILE',
|
75
|
-
description: 'The file to import'
|
76
|
-
end
|
77
|
-
|
78
|
-
return super(model)
|
79
|
-
end
|
80
|
-
|
81
|
-
#
|
82
|
-
# Default method which will print every queried resource.
|
83
|
-
#
|
84
|
-
# @param [DataMapper::Resource] resource
|
85
|
-
# A queried resource from the Database.
|
86
|
-
#
|
87
|
-
# @since 1.1.0
|
88
|
-
#
|
89
|
-
# @api semipublic
|
90
|
-
#
|
91
|
-
def print_resource(resource)
|
92
|
-
puts resource
|
93
|
-
end
|
94
|
-
|
95
|
-
#
|
96
|
-
# Prints multiple resources.
|
97
|
-
#
|
98
|
-
# @param [DataMapper::Collection] resources
|
99
|
-
# The query to print.
|
100
|
-
#
|
101
|
-
# @since 1.1.0
|
102
|
-
#
|
103
|
-
# @api semipublic
|
104
|
-
#
|
105
|
-
def print_resources(resources)
|
106
|
-
if csv? then puts resources.to_csv
|
107
|
-
elsif xml? then puts resources.to_xml
|
108
|
-
elsif yaml? then puts resources.to_yaml
|
109
|
-
elsif json? then puts resources.to_json
|
110
|
-
else
|
111
|
-
resources.each { |resource| print_resource(resource) }
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|