ronin-wordlists 0.1.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.document +4 -0
- data/.github/workflows/ruby.yml +43 -0
- data/.gitignore +14 -0
- data/.rspec +1 -0
- data/.rubocop.yml +18 -0
- data/.ruby-version +1 -0
- data/.yardopts +1 -0
- data/COPYING.txt +165 -0
- data/ChangeLog.md +10 -0
- data/Gemfile +37 -0
- data/README.md +180 -0
- data/Rakefile +45 -0
- data/bin/ronin-wordlists +34 -0
- data/data/completions/ronin-wordlists +107 -0
- data/data/completions/ronin-wordlists.yml +7 -0
- data/data/wordlists.yml +260 -0
- data/gemspec.yml +40 -0
- data/lib/ronin/wordlists/cache_dir.rb +257 -0
- data/lib/ronin/wordlists/cli/command.rb +40 -0
- data/lib/ronin/wordlists/cli/commands/completion.rb +61 -0
- data/lib/ronin/wordlists/cli/commands/download.rb +109 -0
- data/lib/ronin/wordlists/cli/commands/list.rb +79 -0
- data/lib/ronin/wordlists/cli/commands/purge.rb +60 -0
- data/lib/ronin/wordlists/cli/commands/remove.rb +74 -0
- data/lib/ronin/wordlists/cli/commands/search.rb +145 -0
- data/lib/ronin/wordlists/cli/commands/update.rb +98 -0
- data/lib/ronin/wordlists/cli/wordlist_dir_option.rb +64 -0
- data/lib/ronin/wordlists/cli/wordlist_index.rb +178 -0
- data/lib/ronin/wordlists/cli/wordlist_option.rb +66 -0
- data/lib/ronin/wordlists/cli.rb +56 -0
- data/lib/ronin/wordlists/exceptions.rb +47 -0
- data/lib/ronin/wordlists/mixin.rb +106 -0
- data/lib/ronin/wordlists/root.rb +28 -0
- data/lib/ronin/wordlists/search_paths.rb +153 -0
- data/lib/ronin/wordlists/version.rb +26 -0
- data/lib/ronin/wordlists/wordlist_dir.rb +194 -0
- data/lib/ronin/wordlists/wordlist_file.rb +141 -0
- data/lib/ronin/wordlists/wordlist_metadata.rb +43 -0
- data/lib/ronin/wordlists/wordlist_repo.rb +167 -0
- data/lib/ronin/wordlists.rb +96 -0
- data/man/ronin-wordlists-completion.1 +76 -0
- data/man/ronin-wordlists-completion.1.md +78 -0
- data/man/ronin-wordlists-download.1 +47 -0
- data/man/ronin-wordlists-download.1.md +48 -0
- data/man/ronin-wordlists-list.1 +42 -0
- data/man/ronin-wordlists-list.1.md +44 -0
- data/man/ronin-wordlists-purge.1 +39 -0
- data/man/ronin-wordlists-purge.1.md +39 -0
- data/man/ronin-wordlists-remove.1 +43 -0
- data/man/ronin-wordlists-remove.1.md +44 -0
- data/man/ronin-wordlists-search.1 +37 -0
- data/man/ronin-wordlists-search.1.md +37 -0
- data/man/ronin-wordlists-update.1 +43 -0
- data/man/ronin-wordlists-update.1.md +44 -0
- data/man/ronin-wordlists.1 +65 -0
- data/man/ronin-wordlists.1.md +64 -0
- data/ronin-wordlists.gemspec +62 -0
- data/scripts/setup +58 -0
- metadata +154 -0
data/data/wordlists.yml
ADDED
@@ -0,0 +1,260 @@
|
|
1
|
+
#
|
2
|
+
# YAML Schema
|
3
|
+
# ===========
|
4
|
+
#
|
5
|
+
# wordlist-name:
|
6
|
+
# :url: https://...
|
7
|
+
# :summary: ...
|
8
|
+
# :categories:
|
9
|
+
# - ...
|
10
|
+
# - ...
|
11
|
+
#
|
12
|
+
# Note: the wordlist's URL may be a regular `http://` or `https://` URL to a
|
13
|
+
# file, or a `https://` Git URL (ex: `https://github.com/foo/bar.git`).
|
14
|
+
#
|
15
|
+
---
|
16
|
+
alexa-top-1000:
|
17
|
+
:url: https://github.com/urbanadventurer/WhatWeb/blob/master/plugin-development/alexa-top-1000.txt
|
18
|
+
:summary: The Alexa Top 1000 domain names.
|
19
|
+
:categories:
|
20
|
+
- dns
|
21
|
+
- domains
|
22
|
+
|
23
|
+
subdomains:
|
24
|
+
:url: https://raw.githubusercontent.com/rbsec/dnscan/master/subdomains.txt
|
25
|
+
:summary: List of common subdomain names used by the dnscan util.
|
26
|
+
:categories:
|
27
|
+
- dns
|
28
|
+
- subdomains
|
29
|
+
|
30
|
+
subdomains-100:
|
31
|
+
:url: https://raw.githubusercontent.com/rbsec/dnscan/master/subdomains-100.txt
|
32
|
+
:summary: Top 100 most common subdomain names used by the dnscan util.
|
33
|
+
:categories:
|
34
|
+
- dns
|
35
|
+
- subdomains
|
36
|
+
|
37
|
+
subdomains-500:
|
38
|
+
:url: https://raw.githubusercontent.com/rbsec/dnscan/master/subdomains-500.txt
|
39
|
+
:summary: Top 500 most common subdomain names used by the dnscan util.
|
40
|
+
:categories:
|
41
|
+
- dns
|
42
|
+
- subdomains
|
43
|
+
|
44
|
+
subdomains-1000:
|
45
|
+
:url: https:/raw.githubusercontent./com/rbsec/dnscan/master/subdomains-1000.txt
|
46
|
+
:summary: Top 1000 most common subdomain names used by the dnscan util.
|
47
|
+
:categories:
|
48
|
+
- dns
|
49
|
+
- subdomains
|
50
|
+
|
51
|
+
subdomains-10000:
|
52
|
+
:url: https://raw.githubusercontent.com/rbsec/dnscan/master/subdomains-10000.txt
|
53
|
+
:summary: Top 10000 most common subdomain names used by the dnscan util.
|
54
|
+
:categories:
|
55
|
+
- dns
|
56
|
+
- subdomains
|
57
|
+
|
58
|
+
subdomains-uk-500:
|
59
|
+
:url: https://raw.githubusercontent.com/rbsec/dnscan/master/subdomains-uk-500.txt
|
60
|
+
:summary: Top 500 most common UK subdomain names used by the dnscan util.
|
61
|
+
:categories:
|
62
|
+
- dns
|
63
|
+
- subdomains
|
64
|
+
|
65
|
+
subdomains-uk-1000:
|
66
|
+
:url: https://raw.githubusercontent.com/rbsec/dnscan/master/subdomains-uk-1000.txt
|
67
|
+
:summary: Top 1000 most common UK subdomain names used by the dnscan util.
|
68
|
+
:categories:
|
69
|
+
- dns
|
70
|
+
- subdomains
|
71
|
+
|
72
|
+
suffixes:
|
73
|
+
:url: https://raw.githubusercontent.com/rbsec/dnscan/master/suffixes.txt
|
74
|
+
:summary: List of common domain suffixes used by the dnscan util.
|
75
|
+
:categories:
|
76
|
+
- dns
|
77
|
+
- public-suffixes
|
78
|
+
|
79
|
+
tlds:
|
80
|
+
:url: https://raw.githubusercontent.com/rbsec/dnscan/master/tlds.txt
|
81
|
+
:summary: List of common TLDs used by the dnscan util.
|
82
|
+
:categories:
|
83
|
+
- dns
|
84
|
+
- tlds
|
85
|
+
|
86
|
+
argon:
|
87
|
+
:url: http://www.mediafire.com/file/zd3zhzfezl9wd96/Argon_Wordlist_v2.gz
|
88
|
+
:summary: Really big password list.
|
89
|
+
:categories:
|
90
|
+
- passwords
|
91
|
+
|
92
|
+
hashes.org-2012-2015:
|
93
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/hashes.org-2012-2015.7z
|
94
|
+
:summary: Hashes.org archive of passwords found in 2012 - 2015.
|
95
|
+
:categories:
|
96
|
+
- passwords
|
97
|
+
|
98
|
+
hashes.org-2016:
|
99
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/hashes.org-2016.7z
|
100
|
+
:summary: Hashes.org archive of passwords found in 2016.
|
101
|
+
:categories:
|
102
|
+
- passwords
|
103
|
+
|
104
|
+
hashes.org-2017:
|
105
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/hashes.org-2017.7z
|
106
|
+
:summary: Hashes.org archive of passwords found in 2017.
|
107
|
+
:categories:
|
108
|
+
- passwords
|
109
|
+
|
110
|
+
hashes.org-2018:
|
111
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/hashes.org-2018.7z
|
112
|
+
:summary: Hashes.org archive of passwords found in 2018.
|
113
|
+
:categories:
|
114
|
+
- passwords
|
115
|
+
|
116
|
+
hashes.org-2019:
|
117
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/hashes.org-2019.7z
|
118
|
+
:summary: Hashes.org archive of passwords found in 2019.
|
119
|
+
:categories:
|
120
|
+
- passwords
|
121
|
+
|
122
|
+
hashes.org-2020:
|
123
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/hashes.org-2020.7z
|
124
|
+
:summary: Hashes.org archive of passwords found in 2020.
|
125
|
+
:categories:
|
126
|
+
- passwords
|
127
|
+
|
128
|
+
hashes.org-2021:
|
129
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/hashes.org-2021.txt
|
130
|
+
:summary: Hashes.org archive of passwords found in 2021.
|
131
|
+
:categories:
|
132
|
+
- passwords
|
133
|
+
|
134
|
+
hashkiller-dict:
|
135
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/hashkiller-dict.txt
|
136
|
+
:summary: Hashkiller dictionary from hashkiller.io.
|
137
|
+
:categories:
|
138
|
+
- passwords
|
139
|
+
|
140
|
+
DailyQuiz:
|
141
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/DailyQuiz.txt
|
142
|
+
:summary: Passwords from the DailyQuiz.me data breach.
|
143
|
+
:categories:
|
144
|
+
- passwords
|
145
|
+
|
146
|
+
LiveJournal:
|
147
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/LiveJournal.txt
|
148
|
+
:summary: Passwords from the LiveJournal.com data breach.
|
149
|
+
:categories:
|
150
|
+
- passwords
|
151
|
+
|
152
|
+
Top120Million-probable-WPA:
|
153
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/Top120Million-probable-WPA.txt
|
154
|
+
:summary: Old set of popular WPA passwords.
|
155
|
+
:categories:
|
156
|
+
- passwords
|
157
|
+
- wifi
|
158
|
+
|
159
|
+
zxcvbn:
|
160
|
+
:url: https://hashmob.net/api/v2/downloads/research/wordlists/zxcvbn.txt
|
161
|
+
:summary: Realistic weak passwords.
|
162
|
+
:categories:
|
163
|
+
- passwords
|
164
|
+
|
165
|
+
rockyou:
|
166
|
+
:url: https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt
|
167
|
+
:summary: Common passwords list.
|
168
|
+
:categories:
|
169
|
+
- passwords
|
170
|
+
|
171
|
+
weakpass_3:
|
172
|
+
:url: https://download.weakpass.com/wordlists/1947/weakpass_3.7z
|
173
|
+
:summary: Updated Weakpass wordlist for general purpose.
|
174
|
+
:categories:
|
175
|
+
- passwords
|
176
|
+
|
177
|
+
weakpass_3w:
|
178
|
+
:url: https://download.weakpass.com/wordlists/1950/weakpass_3w.7z
|
179
|
+
:summary:
|
180
|
+
Same as weakpass_3p, but passwords length limited from 8 to 24 chars.
|
181
|
+
Specially for fast WI-FI cracking.
|
182
|
+
:categories:
|
183
|
+
- passwords
|
184
|
+
- wifi
|
185
|
+
|
186
|
+
weakpass_3p:
|
187
|
+
:url: https://download.weakpass.com/wordlists/1949/weakpass_3p.7z
|
188
|
+
:summary: Same as weakpass_3, but passwords contains only printalbe charsets.
|
189
|
+
:categories:
|
190
|
+
- passwords
|
191
|
+
|
192
|
+
weakpass_3a:
|
193
|
+
:url: https://download.weakpass.com/wordlists/1948/weakpass_3a.7z
|
194
|
+
:summary:
|
195
|
+
The most complete compilation of wordlist's - more than 1500 in one.
|
196
|
+
Contains near 8 billion of passwords with length from 4 to 25.
|
197
|
+
:categories:
|
198
|
+
- passwords
|
199
|
+
|
200
|
+
directory-list-2-3-medium:
|
201
|
+
:url: https://github.com/daviddias/node-dirbuster/raw/master/lists/directory-list-2.3-medium.txt
|
202
|
+
:summary: Common directory name wordlist used for dirbusting.
|
203
|
+
:categories:
|
204
|
+
- dirs
|
205
|
+
|
206
|
+
ws-dirs:
|
207
|
+
:url: https://raw.githubusercontent.com/3ndG4me/KaliLists/master/wfuzz/webservices/ws-dirs.txt
|
208
|
+
:summary: wfuzz webservices directories' wordlist.
|
209
|
+
:categories:
|
210
|
+
- dirs
|
211
|
+
|
212
|
+
ws-files:
|
213
|
+
:url: https://raw.githubusercontent.com/3ndG4me/KaliLists/master/wfuzz/webservices/ws-files.txt
|
214
|
+
:summary: wfuzz webservices files' wordlist.
|
215
|
+
:categories:
|
216
|
+
- files
|
217
|
+
|
218
|
+
xajkep-wordlists:
|
219
|
+
:url: https://github.com/xajkep/wordlists.git
|
220
|
+
:summary: xajkep's wordlists.
|
221
|
+
:categories:
|
222
|
+
- collection
|
223
|
+
|
224
|
+
SecLists:
|
225
|
+
:url: https://github.com/danielmiessler/SecLists.git
|
226
|
+
:summary: The SecLists repository of pentester wordlists.
|
227
|
+
:categories:
|
228
|
+
- collection
|
229
|
+
|
230
|
+
pry0cc:
|
231
|
+
:url: https://github.com/pry0cc/relevant-wordlist.git
|
232
|
+
:summary: Dynamically generated wordlists based off of news headlines.
|
233
|
+
:categories:
|
234
|
+
- collection
|
235
|
+
|
236
|
+
fuzzdb:
|
237
|
+
:url: https://github.com/fuzzdb-project/fuzzdb.git
|
238
|
+
:summary: FuzzDB repository of fuzzing wordlists.
|
239
|
+
:categories:
|
240
|
+
- collection
|
241
|
+
- fuzzing
|
242
|
+
|
243
|
+
kkrypt0nn:
|
244
|
+
:url: https://github.com/kkrypt0nn/wordlists.git
|
245
|
+
:summary: kkrypt0nn's collection of wordlists.
|
246
|
+
:categories:
|
247
|
+
- collection
|
248
|
+
|
249
|
+
trickest:
|
250
|
+
:url: https://github.com/trickest/wordlists.git
|
251
|
+
:summary: trickest's collection of wordlists.
|
252
|
+
:categories:
|
253
|
+
- collection
|
254
|
+
|
255
|
+
graphql-wordlist:
|
256
|
+
:url: https://github.com/Escape-Technologies/graphql-wordlist.git
|
257
|
+
:summary: GraphQL wordlists for Operations, field names, type names, etc.
|
258
|
+
:categories:
|
259
|
+
- collection
|
260
|
+
- graphql
|
data/gemspec.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
name: ronin-wordlists
|
2
|
+
summary: A library and tool for managing wordlists.
|
3
|
+
description: |
|
4
|
+
ronin-wordlists is a library and tool for managing wordlists. ronin-wordlists
|
5
|
+
can install and update wordlists, and contains a curated list of popular
|
6
|
+
wordlists and their download URLs.
|
7
|
+
|
8
|
+
license: LGPL-3.0
|
9
|
+
authors: Postmodern
|
10
|
+
email: postmodern.mod3@gmail.com
|
11
|
+
homepage: https://ronin-rb.dev/
|
12
|
+
has_yard: true
|
13
|
+
|
14
|
+
metadata:
|
15
|
+
documentation_uri: https://ronin-rb.dev/docs/ronin-wordlists
|
16
|
+
source_code_uri: https://github.com/ronin-rb/ronin-wordlists
|
17
|
+
bug_tracker_uri: https://github.com/ronin-rb/ronin-wordlists/issues
|
18
|
+
changelog_uri: https://github.com/ronin-rb/ronin-wordlists/blob/main/ChangeLog.md
|
19
|
+
rubygems_mfa_required: 'true'
|
20
|
+
|
21
|
+
generated_files:
|
22
|
+
- data/completions/ronin-wordlists
|
23
|
+
- man/ronin-wordlists.1
|
24
|
+
- man/ronin-wordlists-search.1
|
25
|
+
- man/ronin-wordlists-completion.1
|
26
|
+
- man/ronin-wordlists-download.1
|
27
|
+
- man/ronin-wordlists-list.1
|
28
|
+
- man/ronin-wordlists-purge.1
|
29
|
+
- man/ronin-wordlists-remove.1
|
30
|
+
- man/ronin-wordlists-update.1
|
31
|
+
|
32
|
+
required_ruby_version: ">= 3.0.0"
|
33
|
+
|
34
|
+
dependencies:
|
35
|
+
wordlist: ~> 1.1
|
36
|
+
# Ronin dependencies:
|
37
|
+
ronin-core: ~> 0.2.0.rc1
|
38
|
+
|
39
|
+
development_dependencies:
|
40
|
+
bundler: ~> 2.0
|
@@ -0,0 +1,257 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-wordlists - A library and tool for managing wordlists.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-wordlists 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-wordlists 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-wordlists. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'ronin/wordlists/wordlist_dir'
|
22
|
+
require 'ronin/wordlists/exceptions'
|
23
|
+
require 'ronin/core/home'
|
24
|
+
|
25
|
+
require 'uri'
|
26
|
+
require 'yaml'
|
27
|
+
require 'yaml/store'
|
28
|
+
require 'fileutils'
|
29
|
+
|
30
|
+
module Ronin
|
31
|
+
module Wordlists
|
32
|
+
#
|
33
|
+
# Represents the cache directory.
|
34
|
+
#
|
35
|
+
# @api private
|
36
|
+
#
|
37
|
+
class CacheDir
|
38
|
+
|
39
|
+
include Enumerable
|
40
|
+
|
41
|
+
# The `~/.cache/ronin-wordlists/` directory where all repos are stored.
|
42
|
+
PATH = Core::Home.cache_dir('ronin-wordlists')
|
43
|
+
|
44
|
+
# The path to the cache directory.
|
45
|
+
#
|
46
|
+
# @return [String]
|
47
|
+
attr_reader :path
|
48
|
+
|
49
|
+
# The directory containing the downloaded wordlists.
|
50
|
+
#
|
51
|
+
# @return [WrodlistDir]
|
52
|
+
attr_reader :wordlist_dir
|
53
|
+
|
54
|
+
#
|
55
|
+
# Initializes the repository cache.
|
56
|
+
#
|
57
|
+
# @param [String] path
|
58
|
+
# The path to the repository cache directory.
|
59
|
+
#
|
60
|
+
def initialize(path=PATH)
|
61
|
+
@path = path
|
62
|
+
|
63
|
+
@manifest_file = File.join(@path,'manifest.yml')
|
64
|
+
@wordlist_dir = WordlistDir.new(File.join(@path,'wordlists'))
|
65
|
+
|
66
|
+
@manifest = load_manifest
|
67
|
+
end
|
68
|
+
|
69
|
+
# Mapping of wordlist `type:` values and their classes.
|
70
|
+
WORDLIST_TYPES = {
|
71
|
+
git: WordlistRepo,
|
72
|
+
file: WordlistFile
|
73
|
+
}
|
74
|
+
|
75
|
+
#
|
76
|
+
# Accesses a wordlist file or repository from the cache directory.
|
77
|
+
#
|
78
|
+
# @param [String] name
|
79
|
+
# The name of the wordlist file or repository.
|
80
|
+
#
|
81
|
+
# @return [WordlistRepo, WordlistFile]
|
82
|
+
# The wordlist file or repository.
|
83
|
+
#
|
84
|
+
# @raise [WordlistNotFound]
|
85
|
+
# No wordlist with the given name exists in the cache directory.
|
86
|
+
#
|
87
|
+
# @raise [InvalidManifestFile]
|
88
|
+
# The `~/.cache/ronin-wordlists/manifest.yml` file contained invalid
|
89
|
+
# YAML data.
|
90
|
+
#
|
91
|
+
def [](name)
|
92
|
+
unless (metadata = @manifest[name])
|
93
|
+
raise(WordlistNotFound,"wordlist not downloaded: #{name.inspect}")
|
94
|
+
end
|
95
|
+
|
96
|
+
type = metadata.fetch(:type) do
|
97
|
+
raise(InvalidManifestFile,"entry #{name.inspect} is missing a :type attribute")
|
98
|
+
end
|
99
|
+
|
100
|
+
url = metadata.fetch(:url) do
|
101
|
+
raise(InvalidManifestFile,"entry #{name.inspect} is missing a :url attribute")
|
102
|
+
end
|
103
|
+
|
104
|
+
filename = metadata.fetch(:filename) do
|
105
|
+
raise(InvalidManifestFile,"entry #{name.inspect} is missing a :filename attribute")
|
106
|
+
end
|
107
|
+
|
108
|
+
path = File.join(@wordlist_dir.path,filename)
|
109
|
+
|
110
|
+
wordlist_class = WORDLIST_TYPES.fetch(type) do
|
111
|
+
raise(InvalidManifestFile,"unsupported wordlist type: #{type.inspect}")
|
112
|
+
end
|
113
|
+
|
114
|
+
return wordlist_class.new(path, url: url)
|
115
|
+
end
|
116
|
+
|
117
|
+
#
|
118
|
+
# Enumerates over every wordlist in the cache directory.
|
119
|
+
#
|
120
|
+
# @yield [name, wordlist]
|
121
|
+
#
|
122
|
+
# @yieldparam [WordlistFile, WordlistRepo] wordlist
|
123
|
+
#
|
124
|
+
# @return [Enumerator]
|
125
|
+
# If no block is given an enumerator will be returned.
|
126
|
+
#
|
127
|
+
def each
|
128
|
+
return enum_for unless block_given?
|
129
|
+
|
130
|
+
@manifest.each_key do |name|
|
131
|
+
yield self[name]
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
#
|
136
|
+
# Lists the wordlists in the cache directory.
|
137
|
+
#
|
138
|
+
# @param [String] name
|
139
|
+
# Optional file name to search for.
|
140
|
+
#
|
141
|
+
# @return [Array<String>]
|
142
|
+
# The wordlist files within the wordlist directory.
|
143
|
+
#
|
144
|
+
def list(name='*')
|
145
|
+
@wordlist_dir.list(name)
|
146
|
+
end
|
147
|
+
|
148
|
+
#
|
149
|
+
# Opens a wordlist from the wordlist directory.
|
150
|
+
#
|
151
|
+
# @param [String] name
|
152
|
+
# The wordlist file name.
|
153
|
+
#
|
154
|
+
# @return [Wordlist::File]
|
155
|
+
# The opened wordlist file.
|
156
|
+
#
|
157
|
+
# @raise [WordlistNotFound]
|
158
|
+
# No wordlist with the given name.
|
159
|
+
#
|
160
|
+
def open(name)
|
161
|
+
@wordlist_dir.open(name)
|
162
|
+
end
|
163
|
+
|
164
|
+
#
|
165
|
+
# Downloads a wordlist into the cache directory.
|
166
|
+
#
|
167
|
+
# @param [String, URI::HTTP] url
|
168
|
+
# The wordlist URL.
|
169
|
+
#
|
170
|
+
# @return [WordlistFile, WordlistRepo]
|
171
|
+
# The newly downloaded wordlist or the previously downloaded wordlist.
|
172
|
+
#
|
173
|
+
def download(url)
|
174
|
+
wordlist = @wordlist_dir.download(url)
|
175
|
+
|
176
|
+
update_manifest do |manifest|
|
177
|
+
manifest[wordlist.name] = {
|
178
|
+
type: wordlist.type,
|
179
|
+
filename: wordlist.filename,
|
180
|
+
url: wordlist.url.to_s
|
181
|
+
}
|
182
|
+
end
|
183
|
+
|
184
|
+
return wordlist
|
185
|
+
end
|
186
|
+
|
187
|
+
#
|
188
|
+
# Updates the wordlists in the cache directory.
|
189
|
+
#
|
190
|
+
def update
|
191
|
+
each(&:update)
|
192
|
+
end
|
193
|
+
|
194
|
+
#
|
195
|
+
# Deletes a wordlist from the cache directory.
|
196
|
+
#
|
197
|
+
# @param [String] name
|
198
|
+
# The wordlist file or directory name to delete.
|
199
|
+
#
|
200
|
+
def remove(name)
|
201
|
+
wordlist = self[name]
|
202
|
+
wordlist.delete
|
203
|
+
|
204
|
+
update_manifest do |manifest|
|
205
|
+
manifest.delete(name)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
#
|
210
|
+
# Purge all wordlists from the cache directory.
|
211
|
+
#
|
212
|
+
def purge
|
213
|
+
FileUtils.rm_rf(@path)
|
214
|
+
end
|
215
|
+
|
216
|
+
private
|
217
|
+
|
218
|
+
#
|
219
|
+
# Loads the manifest file.
|
220
|
+
#
|
221
|
+
# @return [Hash{String => Hash{Symbol => String}}]
|
222
|
+
#
|
223
|
+
def load_manifest
|
224
|
+
if File.file?(@manifest_file)
|
225
|
+
YAML.load_file(@manifest_file)
|
226
|
+
else
|
227
|
+
{}
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
#
|
232
|
+
# Updates both the {#manifest} and the `manifest.yml` file.
|
233
|
+
#
|
234
|
+
# @yield [manifest]
|
235
|
+
#
|
236
|
+
# @yieldparam [Hash] manifest
|
237
|
+
#
|
238
|
+
def update_manifest(&block)
|
239
|
+
yield @manifest
|
240
|
+
update_manifest_file(&block)
|
241
|
+
end
|
242
|
+
|
243
|
+
#
|
244
|
+
# Updates the `manifest.yml` file.
|
245
|
+
#
|
246
|
+
# @yield [manifest]
|
247
|
+
#
|
248
|
+
# @yieldparam [Hash] manifest
|
249
|
+
#
|
250
|
+
def update_manifest_file(&block)
|
251
|
+
manifest = YAML::Store.new(@manifest_file)
|
252
|
+
manifest.transaction(&block)
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-wordlists - A library and tool for managing wordlists.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-wordlists 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-wordlists 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-wordlists. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'ronin/wordlists/root'
|
22
|
+
|
23
|
+
require 'ronin/core/cli/command'
|
24
|
+
|
25
|
+
module Ronin
|
26
|
+
module Wordlists
|
27
|
+
class CLI
|
28
|
+
#
|
29
|
+
# Base class for all `ronin-wordlists` commands.
|
30
|
+
#
|
31
|
+
class Command < Core::CLI::Command
|
32
|
+
|
33
|
+
man_dir File.join(ROOT,'man')
|
34
|
+
|
35
|
+
bug_report_url 'https://github.com/ronin-rb/ronin-wordlists/issues/new'
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-wordlists - A library and tool for managing wordlists.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)
|
6
|
+
#
|
7
|
+
# ronin-wordlists 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-wordlists 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-wordlists. If not, see <https://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'ronin/wordlists/root'
|
22
|
+
require 'ronin/core/cli/completion_command'
|
23
|
+
|
24
|
+
module Ronin
|
25
|
+
module Wordlists
|
26
|
+
class CLI
|
27
|
+
module Commands
|
28
|
+
#
|
29
|
+
# Manages the shell completion rules for `ronin-wordlists`.
|
30
|
+
#
|
31
|
+
# ## Usage
|
32
|
+
#
|
33
|
+
# ronin-wordlists completion [options]
|
34
|
+
#
|
35
|
+
# ## Options
|
36
|
+
#
|
37
|
+
# --print Prints the shell completion file
|
38
|
+
# --install Installs the shell completion file
|
39
|
+
# --uninstall Uninstalls the shell completion file
|
40
|
+
# -h, --help Print help information
|
41
|
+
#
|
42
|
+
# ## Examples
|
43
|
+
#
|
44
|
+
# ronin-wordlists completion --print
|
45
|
+
# ronin-wordlists completion --install
|
46
|
+
# ronin-wordlists completion --uninstall
|
47
|
+
#
|
48
|
+
class Completion < Core::CLI::CompletionCommand
|
49
|
+
|
50
|
+
completion_file File.join(ROOT,'data','completions','ronin-wordlists')
|
51
|
+
|
52
|
+
man_dir File.join(ROOT,'man')
|
53
|
+
man_page 'ronin-wordlists-completion.1'
|
54
|
+
|
55
|
+
description 'Manages the shell completion rules for ronin-wordlists'
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|