
مكتبة Ruby وأداة سطر أوامر (CLI) لتوليد قوائم الكلمات والعمل معها.
Wordlist هي مكتبة Ruby وواجهة سطر أوامر (CLI) لقراءة قوائم الكلمات ودمجها وتحويرها وبناؤها بكفاءة.
.txt، وقوائم الكلمات المضغوطة بصيغ .gz و.bz2 و.xz و.zip و.7z..gz و.bz2, و.xz و.zip و.7z.wordlist.افتح قائمة كلمات للقراءة:
wordlist = Wordlist.open("passwords.txt")
افتح قائمة كلمات مضغوطة للقراءة:
wordlist = Wordlist.open("rockyou.txt.gz")
التعداد عبر قائمة كلمات:
wordlist.each do |word|
puts word
end
إنشاء قائمة في الذاكرة من كلمات حرفية:
words = Wordlist::Words["foo", "bar", "baz"]
ربط قائمتي كلمات معًا:
(wordlist1 + wordlist2).each do |word|
puts word
end
اتحاد قائمتي كلمات معًا:
(wordlist1 | wordlist2).each do |word|
puts word
end
طرح قائمة كلمات من الأخرى:
(wordlist1 - wordlist2).each do |word|
puts word
end
دمج كل كلمة من wordlist1 مع كلمات wordlist2:
(wordlist1 * wordlist2).each do |word|
puts word
end
دمج قائمة الكلمات مع نفسها عدة مرات:
(wordslist ** 3).each do |word|
puts word
end
تصفية التكرارات من قوائم كلمات متعددة:
(wordlist1 + wordlist2 + wordlist3).uniq.each do |word|
puts word
end
تحويل كل كلمة في قائمة الكلمات إلى أحرف صغيرة:
wordlist.downcase.each do |word|
puts word
end
تحويل كل كلمة في قائمة الكلمات إلى أحرف كبيرة:
wordlist.upcase.each do |word|
puts word
end
جعل الحرف الأول من كل كلمة في قائمة الكلمات كبيرًا:
wordlist.capitalize.each do |word|
puts word
end
تشغيل String#tr على كل كلمة في قائمة الكلمات:
wordlist.tr('_','-').each do |word|
puts word
end
تشغيل String#sub على كل كلمة في قائمة الكلمات:
wordlist.sub("fish","phish").each do |word|
puts word
end
تشغيل String#gsub على كل كلمة في قائمة الكلمات:
wordlist.gsub(/\d+/,"").each do |word|
puts word
end
تنفيذ كل تحوير ممكن لكل كلمة في قائمة الكلمات:
wordlist.mutate(/[oae]/, {'o' => '0', 'a' => '@', 'e' => '3'}).each do |word|
puts word
end
# dog
# d0g
# firefox
# fir3fox
# firef0x
# fir3f0x
# ...
تعداد كل تباين ممكن لحالة الأحرف لكل كلمة في قائمة الكلمات:
wordlist.mutate_case.each do |word|
puts word
end
# cat
# Cat
# cAt
# caT
# CAt
# CaT
# cAT
# CAT
# ...
Wordlist::Builder.open('path/to/file.txt.gz') do |builder|
# ...
end
إضافة كلمات فردية:
builder.add(word)
إضافة مصفوفة من الكلمات:
builder.append(words)
تحليل نص:
builder.parse(text)
تحليل محتوى ملف:
builder.parse_file(path)
zcat/gzip (لقراءة/كتابة قوائم الكلمات .gz)bzcat/bzip2 (لقراءة/كتابة قوائم الكلمات .bz2)xzcat/xz (لقراءة/كتابة قوائم الكلمات .xz)unzip/zip (لقراءة/كتابة قوائم الكلمات .zip)7za (لقراءة/كتابة قوائم الكلمات .7z)$ gem install wordlist
gem.add_dependency 'wordlist', '~> 1.0'
gem 'wordlist', '~> 1.0'
usage: wordlist { [options] WORDLIST ... | --build WORDLIST [FILE ...] }
Wordlist Reading Options:
-f {txt|gzip|bz2|xz|zip|7zip}, Sets the desired wordlist format
--format
--exec COMMAND Runs the command with each word from the wordlist.
The string "{}" will be replaced with each word.
Wordlist Operations:
-U, --union WORDLIST Unions the wordlist with the other WORDLIST
-I, --intersect WORDLIST Intersects the wordlist with the other WORDLIST
-S, --subtract WORDLIST Subtracts the words from the WORDLIST
-p, --product WORDLIST Combines every word with the other words from WORDLIST
-P, --power NUM Combines every word with the other words from WORDLIST
-u, --unique Filters out duplicate words
Wordlist Modifiers:
-C, --capitalize Capitalize each word
--uppercase, --upcase Converts each word to UPPERCASE
--lowercase, --downcase Converts each word to lowercase
-t, --tr CHARS:REPLACE Translates the characters of each word
-s, --sub PATTERN:SUB Replaces PATTERN with SUB in each word
-g, --gsub PATTERN:SUB Replaces all PATTERNs with SUB in each word
-m, --mutate PATTERN:SUB Performs every possible substitution on each word
-M, --mutate-case Switches the case of each letter in each word
Wordlist Building Options:
-b, --build WORDLIST Builds a wordlist
-a, --[no-]append Appends to the new wordlist instead of overwriting it
-L, --lang LANG The language to expect
--stop-words WORDS... Ignores the stop words
--ignore-words WORDS... Ignore the words
--[no-]digits Allow digits in the middle of words
--special-chars CHARS Allows the given special characters inside of words
--[no-]numbers Parses whole numbers in addition to words
--[no-]acronyms Parses acronyms in addition to words
--[no-]normalize-case Converts all words to lowercase
--[no-]normalize-apostrophes Removes "'s" from words
--[no-]normalize-acronyms Removes the dots from acronyms
General Options:
-V, --version Print the version
-h, --help Print the help output
Examples:
wordlist rockyou.txt.gz
wordlist passwords_short.txt passwords_long.txt
wordlist sport_teams.txt -p beers.txt -p digits.txt
cat *.txt | wordlist --build custom.txt
قراءة قائمة كلمات:
$ wordlist rockyou.txt.gz
قراءة قوائم كلمات متعددة:
$ wordlist sport_teams.txt beers.txt
دمج كل كلمة من قائمة كلمات مع أخرى:
$ wordlist sport_teams.txt -p beers.txt -p all_four_digits.txt
coors0000
coors0001
coors0002
coors0003
...
دمج كل كلمة من قائمة كلمات مع نفسها، N مرات:
$ wordlist words.txt -P 3
تحوير كل كلمة في قائمة كلمات:
$ wordlist passwords.txt -m o:0 -m e:3 -m a:@
dog
d0g
firefox
fir3fox
firef0x
fir3f0x
...
تنفيذ أمر على كل كلمة في قائمة الكلمات:
$ wordlist directories.txt --exec "curl -X POST -F 'user=joe&password={}' -o /dev/null -w '%{http_code} {}' https://$TARGET/login"
بناء قائمة كلمات من مجلد يحتوي ملفات .txt:
$ wordlist --build wordlist.txt dir/*.txt
بناء قائمة كلمات من STDIN:
$ cat *.txt | wordlist --build wordlist.txt
user system total real
Wordlist::Builder#parse_text (size=5.4M) 1.943605 0.003809 1.947414 ( 1.955960)
Wordlist::File#each (N=1000) 0.000544 0.000000 0.000544 ( 0.000559)
Wordlist::File#concat (N=1000) 0.001143 0.000000 0.001143 ( 0.001153)
Wordlist::File#subtract (N=1000) 0.001360 0.000000 0.001360 ( 0.001375)
Wordlist::File#product (N=1000) 0.536518 0.005959 0.542477 ( 0.545536)
Wordlist::File#power (N=1000) 0.000015 0.000001 0.000016 ( 0.000014)
Wordlist::File#intersect (N=1000) 0.001389 0.000000 0.001389 ( 0.001407)
Wordlist::File#union (N=1000) 0.001310 0.000000 0.001310 ( 0.001317)
Wordlist::File#uniq (N=1000) 0.000941 0.000000 0.000941 ( 0.000948)
Wordlist::File#tr (N=1000) 0.000725 0.000000 0.000725 ( 0.000736)
Wordlist::File#sub (N=1000) 0.000863 0.000000 0.000863 ( 0.000870)
Wordlist::File#gsub (N=1000) 0.001240 0.000000 0.001240 ( 0.001249)
Wordlist::File#capittalize (N=1000) 0.000821 0.000000 0.000821 ( 0.000828)
Wordlist::File#upcase (N=1000) 0.000760 0.000000 0.000760 ( 0.000769)
Wordlist::File#downcase (N=1000) 0.000544 0.000001 0.000545 ( 0.000545)
Wordlist::File#mutate (N=1000) 0.004656 0.000000 0.004656 ( 0.004692)
Wordlist::File#mutate_case (N=1000) 24.178521 0.000000 24.178521 ( 24.294962)
حقوق النشر (c) 2009-2023 Hal Brodigan
انظر {file:LICENSE.txt} للتفاصيل.