
اصطياد كلمات المرور باستخدام التعلم العميق
تطبيق يعمل داخل Docker لتحليل المستندات والبحث عن مرشّحات لكلمات المرور.
يقدّم المقال "DeepPass — Finding Passwords With Deep Learning" مزيدًا من التفاصيل حول المنهجية المستخدمة ومراحل تطوير النموذج.
للتشغيل: 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 ثنائية الاتجاه:
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 كلمة مرور تم اختيارها عشوائيًا من قائمة كلمات المرور المسربة هذه و2,000,000 مصطلح مستخرج من مستندات متنوعة تم جمعها عبر Google Dorking. إحصائيات مجموعة الاختبار .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