ronin-db 0.1.3-java → 0.2.0.rc1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +1 -0
  3. data/.gitignore +1 -0
  4. data/ChangeLog.md +28 -0
  5. data/Gemfile +6 -4
  6. data/README.md +17 -5
  7. data/Rakefile +13 -35
  8. data/data/completions/ronin-db +271 -0
  9. data/gemspec.yml +17 -2
  10. data/lib/ronin/db/cli/command.rb +1 -1
  11. data/lib/ronin/db/cli/commands/add.rb +1 -1
  12. data/lib/ronin/db/cli/commands/asn.rb +12 -2
  13. data/lib/ronin/db/cli/commands/certs.rb +322 -0
  14. data/lib/ronin/db/cli/commands/completion.rb +63 -0
  15. data/lib/ronin/db/cli/commands/creds.rb +2 -1
  16. data/lib/ronin/db/cli/commands/edit.rb +1 -1
  17. data/lib/ronin/db/cli/commands/emails.rb +22 -1
  18. data/lib/ronin/db/cli/commands/hosts.rb +2 -1
  19. data/lib/ronin/db/cli/commands/ips.rb +2 -1
  20. data/lib/ronin/db/cli/commands/irb.rb +8 -4
  21. data/lib/ronin/db/cli/commands/list.rb +1 -1
  22. data/lib/ronin/db/cli/commands/migrate.rb +12 -8
  23. data/lib/ronin/db/cli/commands/open_ports.rb +102 -0
  24. data/lib/ronin/db/cli/commands/oses.rb +95 -0
  25. data/lib/ronin/db/cli/commands/passwords.rb +83 -0
  26. data/lib/ronin/db/cli/commands/people.rb +185 -0
  27. data/lib/ronin/db/cli/commands/phone_numbers.rb +136 -0
  28. data/lib/ronin/db/cli/commands/ports.rb +103 -0
  29. data/lib/ronin/db/cli/commands/remove.rb +1 -1
  30. data/lib/ronin/db/cli/commands/services.rb +102 -0
  31. data/lib/ronin/db/cli/commands/software.rb +95 -0
  32. data/lib/ronin/db/cli/commands/street_addresses.rb +129 -0
  33. data/lib/ronin/db/cli/commands/urls.rb +2 -1
  34. data/lib/ronin/db/cli/commands/web_vulns.rb +235 -0
  35. data/lib/ronin/db/cli/database_options.rb +87 -0
  36. data/lib/ronin/db/cli/deletable.rb +85 -0
  37. data/lib/ronin/db/cli/importable.rb +108 -0
  38. data/lib/ronin/db/cli/model_command.rb +8 -6
  39. data/lib/ronin/db/cli/modifiable.rb +12 -104
  40. data/lib/ronin/db/cli/printing.rb +58 -0
  41. data/lib/ronin/db/cli/ruby_shell.rb +1 -1
  42. data/lib/ronin/db/cli/uri_methods.rb +1 -1
  43. data/lib/ronin/db/cli.rb +3 -1
  44. data/lib/ronin/db/config_file.rb +1 -1
  45. data/lib/ronin/db/exceptions.rb +1 -1
  46. data/lib/ronin/db/home.rb +1 -1
  47. data/lib/ronin/db/root.rb +1 -1
  48. data/lib/ronin/db/tasks.rb +87 -0
  49. data/lib/ronin/db/version.rb +2 -2
  50. data/lib/ronin/db.rb +15 -7
  51. data/man/ronin-db-add.1 +47 -69
  52. data/man/ronin-db-add.1.md +26 -22
  53. data/man/ronin-db-asn.1 +36 -54
  54. data/man/ronin-db-asn.1.md +29 -19
  55. data/man/ronin-db-certs.1 +108 -0
  56. data/man/ronin-db-certs.1.md +106 -0
  57. data/man/ronin-db-completion.1 +76 -0
  58. data/man/ronin-db-completion.1.md +78 -0
  59. data/man/ronin-db-creds.1 +28 -46
  60. data/man/ronin-db-creds.1.md +23 -16
  61. data/man/ronin-db-edit.1 +15 -26
  62. data/man/ronin-db-edit.1.md +11 -7
  63. data/man/ronin-db-emails.1 +36 -49
  64. data/man/ronin-db-emails.1.md +30 -17
  65. data/man/ronin-db-hosts.1 +31 -51
  66. data/man/ronin-db-hosts.1.md +25 -18
  67. data/man/ronin-db-ips.1 +31 -52
  68. data/man/ronin-db-ips.1.md +26 -19
  69. data/man/ronin-db-irb.1 +22 -35
  70. data/man/ronin-db-irb.1.md +17 -10
  71. data/man/ronin-db-list.1 +16 -30
  72. data/man/ronin-db-list.1.md +13 -9
  73. data/man/ronin-db-migrate.1 +22 -35
  74. data/man/ronin-db-migrate.1.md +17 -10
  75. data/man/ronin-db-open-ports.1 +72 -0
  76. data/man/ronin-db-open-ports.1.md +70 -0
  77. data/man/ronin-db-oses.1 +72 -0
  78. data/man/ronin-db-oses.1.md +70 -0
  79. data/man/ronin-db-passwords.1 +75 -0
  80. data/man/ronin-db-passwords.1.md +73 -0
  81. data/man/ronin-db-people.1 +96 -0
  82. data/man/ronin-db-people.1.md +94 -0
  83. data/man/ronin-db-phone-numbers.1 +93 -0
  84. data/man/ronin-db-phone-numbers.1.md +91 -0
  85. data/man/ronin-db-ports.1 +87 -0
  86. data/man/ronin-db-ports.1.md +85 -0
  87. data/man/ronin-db-remove.1 +15 -28
  88. data/man/ronin-db-remove.1.md +12 -8
  89. data/man/ronin-db-services.1 +84 -0
  90. data/man/ronin-db-services.1.md +82 -0
  91. data/man/ronin-db-software.1 +72 -0
  92. data/man/ronin-db-software.1.md +70 -0
  93. data/man/ronin-db-street-addresses.1 +81 -0
  94. data/man/ronin-db-street-addresses.1.md +79 -0
  95. data/man/ronin-db-urls.1 +37 -60
  96. data/man/ronin-db-urls.1.md +28 -21
  97. data/man/ronin-db-web-vulns.1 +87 -0
  98. data/man/ronin-db-web-vulns.1.md +85 -0
  99. data/man/ronin-db.1 +118 -0
  100. data/man/ronin-db.1.md +99 -0
  101. data/scripts/setup +58 -0
  102. metadata +70 -13
  103. data/lib/ronin/db/cli/database_command.rb +0 -71
  104. data/lib/ronin/db/cli/resources_command.rb +0 -118
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.3
4
+ version: 0.2.0.rc1
5
5
  platform: java
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2024-06-23 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.1'
46
+ version: 0.2.0.rc1
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.1'
54
+ version: 0.2.0.rc1
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.1'
74
+ version: 0.2.0.rc1
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.1'
82
+ version: 0.2.0.rc1
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/database_command.rb
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/resources_command.rb
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