
文書を解析してパスワード候補を検出するDocker化されたアプリケーション。
ブログ記事 DeepPass — ディープラーニングでパスワードを見つける では、このアプローチとモデルの開発について詳しく説明されています。
実行方法: docker-compose up
これにより http://localhost:5000 が公開され、文書をアップロードできます。
APIは手動で http://localhost:5000/api/passwords から利用できます:
C:\Users\harmj0y\Documents\GitHub\DeepPass>curl -F "file=@test_doc.docx" http://localhost:5000/api/passwords
[{"file_name": "test_doc.docx", "model_password_candidates": [{"left_context": ["for", "the", "production", "server", "is:"], "password": "P@ssword123!", "right_context": ["Please", "dont", "tell", "anyone", "on"]}, {"left_context": ["that", "the", "other", "password", "is"], "password": "LiverPool1", "right_context": [".", "This", "is", "our", "backup."]}], "regex_password_candidates": [{"left_context": ["for", "the", "production", "server", "is:"], "password": "P@ssword123!", "right_context": ["Please", "dont", "tell", "anyone", "on"]}], "custom_regex_matches": null}]
Apache Tika は さまざまな文書形式 からデータを抽出するために使用されます。Tensorflow Serving はモデルの提供に使用されます。
ニューラルネットワークは双方向LSTM(Bidirectional LSTM)です:
embedding_dimension = 20
dropout = 0.5
cells = 200
model = Sequential()
model.add(Embedding(total_chars, embedding_dimension, input_length=32, mask_zero=True))
model.add(Bidirectional(LSTM(cells)))
model.add(Dropout(dropout))
model.add(Dense(1, activation='sigmoid'))
このモデルは、この流出パスワードリスト からランダムに選択された2,000,000件のパスワードと、さまざまなGoogle Dork検索で収集された文書から抽出された2,000,000件の用語で学習されました。.1テストセットの統計は以下のとおりです:
------------------
loss : 0.04804224148392677
tn : 199446.0
fp : 731.0
fn : 3281.0
tp : 196542.0
------------------
accuracy : 0.9899700284004211
precision : 0.9962944984436035
recall : 0.983580470085144
------------------
F1 score. : 0.9898966618590025
------------------
モデルのトレーニングノートブックは ./notebooks/password_model_bilstm.ipynb にあります。