ronin-db 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d310dd9211968ccd20e1f7f7962673217fac978bb9d1698a443db713196be894
4
- data.tar.gz: a279d215f78d2e40d04a2ff6519537ed275be707d1adeba2450bbe805a688009
3
+ metadata.gz: eb843bad7ea3acbc3e60ab034a6a7eae3d89b95433a46e80ee92c49d38a0d7e1
4
+ data.tar.gz: 37af4e6642c8a551df6b83547ae96c642359c3e3964e0bae173cbd9bf7d34e39
5
5
  SHA512:
6
- metadata.gz: 73778356b09c0ec1f7ff37f7faba38c64c46d23d5b44aeed49a78248bd5c72794e2057a690c1bacdced48d522f2cdec4dc65b628e64580dc0a9d640d5a6968c6
7
- data.tar.gz: 18edf72f11d0748f17b4a8f18541fdcdc45b541053231cbf3b75c40f5dbb68a8a943e19654b8081a28b5d3348c9772304ead95f38810825fc448e5ed6ceb442b
6
+ metadata.gz: 1480524a5b1356e1206f1a24dc928faf9c37e7b54109949180626dd5be4bd0b32e93f36a3b3527a9fe6f9ed70d3699ab94bd50c1fcf38f185ef1359afac734e6
7
+ data.tar.gz: 8a02d484ff3620a7165940d5eb77b5815f57571768c6353aaffdba5358700ea9114f629f42918a97d70938b77a5bd9547ac6851e7fd875be2136b4c92c44d77c
data/.document CHANGED
@@ -2,4 +2,3 @@ lib/**/*.rb
2
2
  -
3
3
  ChangeLog.md
4
4
  COPYING.txt
5
- man/*.md
data/ChangeLog.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 0.1.2 / 2023-09-19
2
+
3
+ * Fixed a typo in an exception message in {Ronin::DB.connect}.
4
+ * Documentation fixes and improvements.
5
+
1
6
  ### 0.1.1 / 2023-06-09
2
7
 
3
8
  #### CLI
data/README.md CHANGED
@@ -9,7 +9,6 @@
9
9
  * [Issues](https://github.com/ronin-rb/ronin-db/issues)
10
10
  * [Documentation](https://ronin-rb.dev/docs/ronin-db/frames)
11
11
  * [Discord](https://discord.gg/6WAb3PsVX9) |
12
- [Twitter](https://twitter.com/ronin_rb) |
13
12
  [Mastodon](https://infosec.exchange/@ronin_rb)
14
13
 
15
14
  ## Description
@@ -26,11 +26,11 @@ module Ronin
26
26
  class CLI
27
27
  module Commands
28
28
  #
29
- # Queries all credentials in the database.
29
+ # Manages all credentials in the database.
30
30
  #
31
31
  # ## Usage
32
32
  #
33
- # ronin creds [options]
33
+ # ronin-db creds [options]
34
34
  #
35
35
  # ## Options
36
36
  #
@@ -41,8 +41,8 @@ module Ronin
41
41
  # --import FILE Imports the values from the FILE into the database
42
42
  # --delete VALUE Deletes a value from the database
43
43
  # --delete-all Deletes all values from the database
44
- # -u, --user [USER] Username to search for.
45
- # -p, --password [PASS] Password to search for.
44
+ # -u, --for-user USER Username to search for
45
+ # -p, --with-password PASSWORD Password to search for
46
46
  #
47
47
  class Creds < ModelCommand
48
48
 
@@ -51,25 +51,25 @@ module Ronin
51
51
  model_file 'ronin/db/credential'
52
52
  model_name 'Credential'
53
53
 
54
- option :user, short: '-u',
55
- value: {
56
- type: String,
57
- usage: 'USER'
58
- },
59
- desc: 'Username to search for' do |user|
60
- @query_method_calls << [:for_user, [user]]
61
- end
62
-
63
- option :password, short: '-P',
54
+ option :for_user, short: '-u',
64
55
  value: {
65
56
  type: String,
66
- usage: 'PASSWORD'
57
+ usage: 'USER'
67
58
  },
68
- desc: 'Password to search for' do |password|
69
- @query_method_calls << [:with_password, [password]]
59
+ desc: 'Username to search for' do |user|
60
+ @query_method_calls << [:for_user, [user]]
70
61
  end
71
62
 
72
- description 'Queries all credentials in the database'
63
+ option :with_password, short: '-P',
64
+ value: {
65
+ type: String,
66
+ usage: 'PASSWORD'
67
+ },
68
+ desc: 'Password to search for' do |password|
69
+ @query_method_calls << [:with_password, [password]]
70
+ end
71
+
72
+ description 'Manages all credentials in the database'
73
73
 
74
74
  man_page 'ronin-db-creds.1'
75
75
 
@@ -21,6 +21,6 @@
21
21
  module Ronin
22
22
  module DB
23
23
  # ronin-db version
24
- VERSION = '0.1.1'
24
+ VERSION = '0.1.2'
25
25
  end
26
26
  end
data/lib/ronin/db.rb CHANGED
@@ -86,8 +86,10 @@ module Ronin
86
86
  # Specifies whether to load all models or just connect to the database.
87
87
  #
88
88
  # @raise [UnknownDatabase]
89
+ # The database name was not listed in the config file.
89
90
  #
90
91
  # @raise [ArgumentError]
92
+ # The given database was not a Symbol or a Hash.
91
93
  #
92
94
  # @api semipublic
93
95
  #
@@ -100,7 +102,7 @@ module Ronin
100
102
  raise(UnknownDatabase,"unknown database: #{database.inspect}")
101
103
  end
102
104
  else
103
- raise(ArgumentError,"#{self.class}.#{__method__} only accepts a Symbol or a Hash")
105
+ raise(ArgumentError,"#{self}.#{__method__} only accepts a Symbol or a Hash")
104
106
  end
105
107
 
106
108
  # load activerecord
data/man/ronin-db-asn.1 CHANGED
@@ -20,8 +20,16 @@ The database name to connect to\. Defaults to \fBdefault\fR if not given\.
20
20
  .LP
21
21
  .TP
22
22
  \fB--db-uri\fR \fIURI\fP
23
- The explicit database URI to connect to
24
- (ex: \fBpostgres://user:password@host/db\fR)\.
23
+ The explicit database URI to connect to\.
24
+ .LP
25
+ .RS
26
+ .IP \(bu 2
27
+ \fBsqlite3\fP: \fBsqlite3:relative/path.db\fR or \fBsqlite3:///absolute/path.db\fR
28
+ .IP \(bu 2
29
+ \fBmysql\fP: \fBmysql://user:password@host/database\fR
30
+ .IP \(bu 2
31
+ \fBpostgres\fP: \fBpostgres://user:password@host/database\fR
32
+ .RE
25
33
  .LP
26
34
  .TP
27
35
  \fB-v\fR, \fB--verbose\fR
@@ -14,8 +14,11 @@ Queries or updates Autonomous System Numbers (ASNs) in the database.
14
14
  The database name to connect to. Defaults to `default` if not given.
15
15
 
16
16
  `--db-uri` *URI*
17
- The explicit database URI to connect to
18
- (ex: `postgres://user:password@host/db`).
17
+ The explicit database URI to connect to.
18
+
19
+ * **sqlite3**: `sqlite3:relative/path.db` or `sqlite3:///absolute/path.db`
20
+ * **mysql**: `mysql://user:password@host/database`
21
+ * **postgres**: `postgres://user:password@host/database`
19
22
 
20
23
  `-v`, `--verbose`
21
24
  Enables verbose output
data/man/ronin-db-creds.1 CHANGED
@@ -20,8 +20,16 @@ The database to connect to\. Defaults to \fBdefault\fR if not given\.
20
20
  .LP
21
21
  .TP
22
22
  \fB--db-uri\fR \fIURI\fP
23
- The explicit database URI to connect to
24
- (ex: \fBmysql://user:password@host/ronin\fR)\.
23
+ The explicit database URI to connect to\.
24
+ .LP
25
+ .RS
26
+ .IP \(bu 2
27
+ \fBsqlite3\fP: \fBsqlite3:relative/path.db\fR or \fBsqlite3:///absolute/path.db\fR
28
+ .IP \(bu 2
29
+ \fBmysql\fP: \fBmysql://user:password@host/database\fR
30
+ .IP \(bu 2
31
+ \fBpostgres\fP: \fBpostgres://user:password@host/database\fR
32
+ .RE
25
33
  .LP
26
34
  .TP
27
35
  \fB-v\fR, \fB--verbose\fR
@@ -45,11 +53,15 @@ Deletes every credential from the database\.
45
53
  .LP
46
54
  .TP
47
55
  \fB-u\fR, \fB--for-user\fR \fIUSER\fP
48
- Searches for credentials associated with the USER\.
56
+ Searches for credentials associated with the \fIUSER\fP\.
49
57
  .LP
50
58
  .TP
51
59
  \fB-p\fR, \fB--with-password\fR \fIPASSWORD\fP
52
- Searches for credentials that have the PASSWORD\.
60
+ Searches for credentials that have the \fIPASSWORD\fP\.
61
+ .LP
62
+ .TP
63
+ \fB-h\fR, \fB--help\fR
64
+ Print help information\.
53
65
  .LP
54
66
  .SH ENVIRONMENT
55
67
  .LP
@@ -14,8 +14,11 @@ Manages credentials.
14
14
  The database to connect to. Defaults to `default` if not given.
15
15
 
16
16
  `--db-uri` *URI*
17
- The explicit database URI to connect to
18
- (ex: `mysql://user:password@host/ronin`).
17
+ The explicit database URI to connect to.
18
+
19
+ * **sqlite3**: `sqlite3:relative/path.db` or `sqlite3:///absolute/path.db`
20
+ * **mysql**: `mysql://user:password@host/database`
21
+ * **postgres**: `postgres://user:password@host/database`
19
22
 
20
23
  `-v`, `--verbose`
21
24
  Enable verbose output.
@@ -33,10 +36,13 @@ Manages credentials.
33
36
  Deletes every credential from the database.
34
37
 
35
38
  `-u`, `--for-user` *USER*
36
- Searches for credentials associated with the USER.
39
+ Searches for credentials associated with the *USER*.
37
40
 
38
41
  `-p`, `--with-password` *PASSWORD*
39
- Searches for credentials that have the PASSWORD.
42
+ Searches for credentials that have the *PASSWORD*.
43
+
44
+ `-h`, `--help`
45
+ Print help information.
40
46
 
41
47
  ## ENVIRONMENT
42
48
 
@@ -20,8 +20,16 @@ The database to connect to\. Defaults to \fBdefault\fR if not given\.
20
20
  .LP
21
21
  .TP
22
22
  \fB--db-uri\fR \fIURI\fP
23
- The explicit database URI to connect to
24
- (ex: \fBmysql://user:password@host/ronin\fR)\.
23
+ The explicit database URI to connect to\.
24
+ .LP
25
+ .RS
26
+ .IP \(bu 2
27
+ \fBsqlite3\fP: \fBsqlite3:relative/path.db\fR or \fBsqlite3:///absolute/path.db\fR
28
+ .IP \(bu 2
29
+ \fBmysql\fP: \fBmysql://user:password@host/database\fR
30
+ .IP \(bu 2
31
+ \fBpostgres\fP: \fBpostgres://user:password@host/database\fR
32
+ .RE
25
33
  .LP
26
34
  .TP
27
35
  \fB-v\fR, \fB--verbose\fR
@@ -55,6 +63,10 @@ Searches for email addresses associated with the IP address\.
55
63
  \fB-u\fR, \fB--with-users\fR \fINAME\fP \[lB]\.\.\.\[rB]
56
64
  Searches for email addresses associated with the user NAME(s)\.
57
65
  .LP
66
+ .TP
67
+ \fB-h\fR, \fB--help\fR
68
+ Print help information\.
69
+ .LP
58
70
  .SH ENVIRONMENT
59
71
  .LP
60
72
  .TP
@@ -14,8 +14,11 @@ Manages email addresses.
14
14
  The database to connect to. Defaults to `default` if not given.
15
15
 
16
16
  `--db-uri` *URI*
17
- The explicit database URI to connect to
18
- (ex: `mysql://user:password@host/ronin`).
17
+ The explicit database URI to connect to.
18
+
19
+ * **sqlite3**: `sqlite3:relative/path.db` or `sqlite3:///absolute/path.db`
20
+ * **mysql**: `mysql://user:password@host/database`
21
+ * **postgres**: `postgres://user:password@host/database`
19
22
 
20
23
  `-v`, `--verbose`
21
24
  Enable verbose output.
@@ -41,6 +44,9 @@ Manages email addresses.
41
44
  `-u`, `--with-users` *NAME* [...]
42
45
  Searches for email addresses associated with the user NAME(s).
43
46
 
47
+ `-h`, `--help`
48
+ Print help information.
49
+
44
50
  ## ENVIRONMENT
45
51
 
46
52
  *HOME*
data/man/ronin-db-hosts.1 CHANGED
@@ -20,8 +20,16 @@ The database to connect to\. Defaults to \fBdefault\fR if not given\.
20
20
  .LP
21
21
  .TP
22
22
  \fB--db-uri\fR \fIURI\fP
23
- The explicit database URI to connect to
24
- (ex: \fBmysql://user:password@host/ronin\fR)\.
23
+ The explicit database URI to connect to\.
24
+ .LP
25
+ .RS
26
+ .IP \(bu 2
27
+ \fBsqlite3\fP: \fBsqlite3:relative/path.db\fR or \fBsqlite3:///absolute/path.db\fR
28
+ .IP \(bu 2
29
+ \fBmysql\fP: \fBmysql://user:password@host/database\fR
30
+ .IP \(bu 2
31
+ \fBpostgres\fP: \fBpostgres://user:password@host/database\fR
32
+ .RE
25
33
  .LP
26
34
  .TP
27
35
  \fB-v\fR, \fB--verbose\fR
@@ -59,6 +67,10 @@ Searches for HostNames belonging to the DOMAIN (\fBco.uk\fR)\.
59
67
  \fB-T\fR, \fB--tld\fR \fITLD\fP
60
68
  Searches for HostNames with the Top\-Level\-Domain (TLD) (\fBru\fR)\.
61
69
  .LP
70
+ .TP
71
+ \fB-h\fR, \fB--help\fR
72
+ Print help information\.
73
+ .LP
62
74
  .SH ENVIRONMENT
63
75
  .LP
64
76
  .TP
@@ -14,8 +14,11 @@ Manages host names.
14
14
  The database to connect to. Defaults to `default` if not given.
15
15
 
16
16
  `--db-uri` *URI*
17
- The explicit database URI to connect to
18
- (ex: `mysql://user:password@host/ronin`).
17
+ The explicit database URI to connect to.
18
+
19
+ * **sqlite3**: `sqlite3:relative/path.db` or `sqlite3:///absolute/path.db`
20
+ * **mysql**: `mysql://user:password@host/database`
21
+ * **postgres**: `postgres://user:password@host/database`
19
22
 
20
23
  `-v`, `--verbose`
21
24
  Enable verbose output.
@@ -44,6 +47,9 @@ Manages host names.
44
47
  `-T`, `--tld` *TLD*
45
48
  Searches for HostNames with the Top-Level-Domain (TLD) (`ru`).
46
49
 
50
+ `-h`, `--help`
51
+ Print help information.
52
+
47
53
  ## ENVIRONMENT
48
54
 
49
55
  *HOME*
data/man/ronin-db-ips.1 CHANGED
@@ -20,8 +20,16 @@ The database to connect to\. Defaults to \fBdefault\fR if not given\.
20
20
  .LP
21
21
  .TP
22
22
  \fB--db-uri\fR \fIURI\fP
23
- The explicit database URI to connect to
24
- (ex: \fBmysql://user:password@host/ronin\fR)\.
23
+ The explicit database URI to connect to\.
24
+ .LP
25
+ .RS
26
+ .IP \(bu 2
27
+ \fBsqlite3\fP: \fBsqlite3:relative/path.db\fR or \fBsqlite3:///absolute/path.db\fR
28
+ .IP \(bu 2
29
+ \fBmysql\fP: \fBmysql://user:password@host/database\fR
30
+ .IP \(bu 2
31
+ \fBpostgres\fP: \fBpostgres://user:password@host/database\fR
32
+ .RE
25
33
  .LP
26
34
  .TP
27
35
  \fB-v\fR, \fB--verbose\fR
@@ -63,6 +71,10 @@ Searches for IP addresses associated with the MAC address\.
63
71
  \fB-I\fR, \fB--with-host\fR \fIHOST\fP
64
72
  Searches for IP addresses associated with the \fIHOST\fP\.
65
73
  .LP
74
+ .TP
75
+ \fB-h\fR, \fB--help\fR
76
+ Print help information\.
77
+ .LP
66
78
  .SH ENVIRONMENT
67
79
  .LP
68
80
  .TP
@@ -14,8 +14,11 @@ Manages IP addresses.
14
14
  The database to connect to. Defaults to `default` if not given.
15
15
 
16
16
  `--db-uri` *URI*
17
- The explicit database URI to connect to
18
- (ex: `mysql://user:password@host/ronin`).
17
+ The explicit database URI to connect to.
18
+
19
+ * **sqlite3**: `sqlite3:relative/path.db` or `sqlite3:///absolute/path.db`
20
+ * **mysql**: `mysql://user:password@host/database`
21
+ * **postgres**: `postgres://user:password@host/database`
19
22
 
20
23
  `-v`, `--verbose`
21
24
  Enable verbose output.
@@ -47,6 +50,9 @@ Manages IP addresses.
47
50
  `-I`, `--with-host` *HOST*
48
51
  Searches for IP addresses associated with the *HOST*.
49
52
 
53
+ `-h`, `--help`
54
+ Print help information.
55
+
50
56
  ## ENVIRONMENT
51
57
 
52
58
  *HOME*
data/man/ronin-db-irb.1 CHANGED
@@ -23,6 +23,15 @@ specified\.
23
23
  \fB--db-uri\fR \fIURI\fP
24
24
  The database URI to connect to\.
25
25
  .LP
26
+ .RS
27
+ .IP \(bu 2
28
+ \fBsqlite3\fP: \fBsqlite3:relative/path.db\fR or \fBsqlite3:///absolute/path.db\fR
29
+ .IP \(bu 2
30
+ \fBmysql\fP: \fBmysql://user:password@host/database\fR
31
+ .IP \(bu 2
32
+ \fBpostgres\fP: \fBpostgres://user:password@host/database\fR
33
+ .RE
34
+ .LP
26
35
  .TP
27
36
  \fB--no-connect\fR
28
37
  Causes the Ruby shell to not connect to a database on startup\.
@@ -17,6 +17,10 @@ Connects to a database and start an interactive Ruby shell.
17
17
  `--db-uri` *URI*
18
18
  The database URI to connect to.
19
19
 
20
+ * **sqlite3**: `sqlite3:relative/path.db` or `sqlite3:///absolute/path.db`
21
+ * **mysql**: `mysql://user:password@host/database`
22
+ * **postgres**: `postgres://user:password@host/database`
23
+
20
24
  `--no-connect`
21
25
  Causes the Ruby shell to not connect to a database on startup.
22
26
 
@@ -23,6 +23,15 @@ specified\.
23
23
  \fB--db-uri\fR \fIURI\fP
24
24
  The database URI to connect to\.
25
25
  .LP
26
+ .RS
27
+ .IP \(bu 2
28
+ \fBsqlite3\fP: \fBsqlite3:relative/path.db\fR or \fBsqlite3:///absolute/path.db\fR
29
+ .IP \(bu 2
30
+ \fBmysql\fP: \fBmysql://user:password@host/database\fR
31
+ .IP \(bu 2
32
+ \fBpostgres\fP: \fBpostgres://user:password@host/database\fR
33
+ .RE
34
+ .LP
26
35
  .TP
27
36
  \fB--no-connect\fR
28
37
  Causes the Ruby shell to not connect to a database on startup\.
@@ -17,6 +17,10 @@ Runs database migrations.
17
17
  `--db-uri` *URI*
18
18
  The database URI to connect to.
19
19
 
20
+ * **sqlite3**: `sqlite3:relative/path.db` or `sqlite3:///absolute/path.db`
21
+ * **mysql**: `mysql://user:password@host/database`
22
+ * **postgres**: `postgres://user:password@host/database`
23
+
20
24
  `--no-connect`
21
25
  Causes the Ruby shell to not connect to a database on startup.
22
26
 
data/man/ronin-db-urls.1 CHANGED
@@ -20,8 +20,16 @@ The database to connect to\. Defaults to \fBdefault\fR if not given\.
20
20
  .LP
21
21
  .TP
22
22
  \fB--db-uri\fR \fIURI\fP
23
- The explicit database URI to connect to
24
- (ex: \fBmysql://user:password@host/ronin\fR)\.
23
+ The explicit database URI to connect to\.
24
+ .LP
25
+ .RS
26
+ .IP \(bu 2
27
+ \fBsqlite3\fP: \fBsqlite3:relative/path.db\fR or \fBsqlite3:///absolute/path.db\fR
28
+ .IP \(bu 2
29
+ \fBmysql\fP: \fBmysql://user:password@host/database\fR
30
+ .IP \(bu 2
31
+ \fBpostgres\fP: \fBpostgres://user:password@host/database\fR
32
+ .RE
25
33
  .LP
26
34
  .TP
27
35
  \fB-v\fR, \fB--verbose\fR
@@ -71,6 +79,10 @@ Searches for URLs containing the query\-param NAME\.
71
79
  \fB-Q\fR, \fB--with-query-value\fR \fIVALUE\fP \[lB]\.\.\.\[rB]
72
80
  Searches for URLs containing the query\-param VALUE\.
73
81
  .LP
82
+ .TP
83
+ \fB-h\fR, \fB--help\fR
84
+ Print help information\.
85
+ .LP
74
86
  .SH ENVIRONMENT
75
87
  .LP
76
88
  .TP
@@ -14,8 +14,11 @@ Manages URLs.
14
14
  The database to connect to. Defaults to `default` if not given.
15
15
 
16
16
  `--db-uri` *URI*
17
- The explicit database URI to connect to
18
- (ex: `mysql://user:password@host/ronin`).
17
+ The explicit database URI to connect to.
18
+
19
+ * **sqlite3**: `sqlite3:relative/path.db` or `sqlite3:///absolute/path.db`
20
+ * **mysql**: `mysql://user:password@host/database`
21
+ * **postgres**: `postgres://user:password@host/database`
19
22
 
20
23
  `-v`, `--verbose`
21
24
  Enable verbose output.
@@ -53,6 +56,9 @@ Manages URLs.
53
56
  `-Q`, `--with-query-value` *VALUE* [...]
54
57
  Searches for URLs containing the query-param VALUE.
55
58
 
59
+ `-h`, `--help`
60
+ Print help information.
61
+
56
62
  ## ENVIRONMENT
57
63
 
58
64
  *HOME*
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.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-09 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3