Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
wordlist.rb — ワードリストの生成と操作のためのRubyライブラリおよびCLI。 | Kitploit
ツール/GitHubGitHub/postmodern/wordlist.rb
パスワード攻撃ファジングペネトレーションテストユーティリティとフレームワーク
GitHubpostmodern/wordlist.rb

wordlist.rb

ワードリストの生成と操作のためのRubyライブラリおよびCLI。

リポジトリを見る
4837ヶ月前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

Wordlist

CI Code Climate Gem Version

  • Source
  • Issues
  • Documentation

Description

Wordlist は、ワードリストを効率的に読み取り、結合、変異、構築するための Ruby ライブラリおよび CLI です。

Features

  • .txt ワードリストと、.gz、.bz2、.xz、.zip、.7z 圧縮ワードリストの読み取りに対応。
  • 任意のテキストからワードリストを構築可能。.gz, .bz2, .xz, .zip, .7z 圧縮にも対応。
  • テキストを単語に解析する高度なレキサーを提供。
    • 数字、特殊文字、整数、頭字語を解析/スキップ可能。
    • 大文字小文字、アポストロフィ、頭字語を正規化可能。
  • 複数のワードリストを組み合わせるワードリスト操作に対応。
  • ワードリスト内の単語をその場で修正または変異させるワードリスト変更操作に対応。
  • また、wordlist コマンド を提供します。
  • そこそこ高速

Examples

読み取り

ワードリストを読み取り用に開く:

root@kitploit:~
wordlist = Wordlist.open("passwords.txt")

圧縮されたワードリストを読み取り用に開く:

root@kitploit:~
wordlist = Wordlist.open("rockyou.txt.gz")

ワードリストを列挙する:

root@kitploit:~
wordlist.each do |word|
  puts word
end

リテラル単語のインメモリリストを作成する:

root@kitploit:~
words = Wordlist::Words["foo", "bar", "baz"]

リスト操作

2つのワードリストを連結する:

root@kitploit:~
(wordlist1 + wordlist2).each do |word|
  puts word
end

2つのワードリストの和集合を取る:

root@kitploit:~
(wordlist1 | wordlist2).each do |word|
  puts word
end

一方のワードリストからもう一方を減算する:

root@kitploit:~
(wordlist1 - wordlist2).each do |word|
  puts word
end

wordlist1 のすべての単語と wordlist2 の単語を組み合わせる:

root@kitploit:~
(wordlist1 * wordlist2).each do |word|
  puts word
end

ワードリストをそれ自体と複数回組み合わせる:

root@kitploit:~
(wordslist ** 3).each do |word|
  puts word
end

複数のワードリストから重複を除外する:

root@kitploit:~
(wordlist1 + wordlist2 + wordlist3).uniq.each do |word|
  puts word
end

文字列操作

ワードリスト内のすべての単語を小文字に変換する:

root@kitploit:~
wordlist.downcase.each do |word|
  puts word
end

ワードリスト内のすべての単語を大文字に変換する:

root@kitploit:~
wordlist.upcase.each do |word|
  puts word
end

ワードリスト内のすべての単語の先頭文字を大文字にする:

root@kitploit:~
wordlist.capitalize.each do |word|
  puts word
end

ワードリスト内のすべての単語に String#tr を実行する:

root@kitploit:~
wordlist.tr('_','-').each do |word|
  puts word
end

ワードリスト内のすべての単語に String#sub を実行する:

root@kitploit:~
wordlist.sub("fish","phish").each do |word|
  puts word
end

ワードリスト内のすべての単語に String#gsub を実行する:

root@kitploit:~
wordlist.gsub(/\d+/,"").each do |word|
  puts word
end

ワードリスト内の各単語の可能なすべての変異を実行する:

root@kitploit:~
wordlist.mutate(/[oae]/, {'o' => '0', 'a' => '@', 'e' => '3'}).each do |word|
  puts word
end
# dog
# d0g
# firefox
# fir3fox
# firef0x
# fir3f0x
# ...

ワードリスト内のすべての単語の可能なすべての大文字小文字のバリエーションを列挙する:

root@kitploit:~
wordlist.mutate_case.each do |word|
  puts word
end
# cat
# Cat
# cAt
# caT
# CAt
# CaT
# cAT
# CAT
# ...

ワードリストの構築

root@kitploit:~
Wordlist::Builder.open('path/to/file.txt.gz') do |builder|
  # ...
end

個々の単語を追加する:

root@kitploit:~
builder.add(word)

単語の配列を追加する:

root@kitploit:~
builder.append(words)

テキストを解析する:

root@kitploit:~
builder.parse(text)

ファイルの内容を解析する:

root@kitploit:~
builder.parse_file(path)

Requirements

  • ruby >= 3.0.0
  • zcat/gzip (.gz ワードリストの読み書き用)
  • bzcat/bzip2 (.bz2 ワードリストの読み書き用)
  • xzcat/xz (.xz ワードリストの読み書き用)
  • unzip/zip (.zip ワードリストの読み書き用)
  • 7za (.7z ワードリストの読み書き用)

Install

root@kitploit:~
$ gem install wordlist

gemspec

root@kitploit:~
gem.add_dependency 'wordlist', '~> 1.0'

Gemfile

root@kitploit:~
gem 'wordlist', '~> 1.0'

Synopsis

root@kitploit:~
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

ワードリストを読み取る:

root@kitploit:~
$ wordlist rockyou.txt.gz

複数のワードリストを読み取る:

root@kitploit:~
$ wordlist sport_teams.txt beers.txt

あるワードリストのすべての単語を別のワードリストと組み合わせる:

root@kitploit:~
$ wordlist sport_teams.txt -p beers.txt -p all_four_digits.txt
coors0000
coors0001
coors0002
coors0003
...

あるワードリストのすべての単語を、N回、それ自体と組み合わせる:

root@kitploit:~
$ wordlist words.txt -P 3

ワードリスト内のすべての単語を変異させる:

root@kitploit:~
$ wordlist passwords.txt -m o:0 -m e:3 -m a:@
dog
d0g
firefox
fir3fox
firef0x
fir3f0x
...

ワードリスト内の各単語に対してコマンドを実行する:

root@kitploit:~
$ wordlist directories.txt --exec "curl -X POST -F 'user=joe&password={}' -o /dev/null -w '%{http_code} {}' https://$TARGET/login"

.txt ファイルのディレクトリからワードリストを構築する:

root@kitploit:~
$ wordlist --build wordlist.txt dir/*.txt

STDIN からワードリストを構築する:

root@kitploit:~
$ cat *.txt | wordlist --build wordlist.txt

Benchmarks

root@kitploit:~
                                               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)

License

Copyright (c) 2009-2023 Hal Brodigan

詳細については {file:LICENSE.txt} を参照してください。

ツールをダウンロード