
Spray365 يجعل رش كلمات مرور حسابات مايكروسوفت (Office 365 / Azure AD) أمرًا سهلاً من خلال نهجه القابل للتخصيص لرش كلمات المرور على مرحلتين. تتضمن خطة التنفيذ المدمجة خيارات تحاول تجاوز القفل الذكي من Azure (Azure Smart Lockout) وسياسات الوصول الشرطي غير الآمنة.

Spray365 هي أداة لرش كلمات المرور (password spraying) تهدف إلى تحديد بيانات اعتماد صالحة لحسابات مايكروسوفت (Office 365 / Azure AD). ما الذي يميز Spray365 عن العديد من أدوات رش كلمات المرور الأخرى المتاحة؟ يتيح Spray365 رش كلمات المرور من "خطة تنفيذ" (execution plan). إلى جانب الفوائد العديدة التي توفرها خطة التنفيذ المُعدّة مسبقًا والتي تصف عملية الرش قبل حدوثها بشكل جيد، فإن هذا يسمح أيضًا باستئناف عمليات رش كلمات المرور (-R) بعد حدوث خطأ في الشبكة أو أي انقطاع آخر. على الرغم من أنه من الأسهل إنشاء خطة تنفيذ Spray365 باستخدام الأداة نفسها مباشرةً، إلا أن الأدوات الأخرى التي تُنتج بنية JSON متوافقة تجعل من السهل بناء سير عمل فريدة لرش كلمات المرور.
يكشف Spray365 عن عدد قليل من الخيارات المفيدة عند رش بيانات الاعتماد. يمكن استخدام وكلاء مستخدم عشوائيين (random user agents) للكشف عن سياسات الوصول الشرطي (conditional access policies) غير الآمنة وتجاوزها، والتي تم تكوينها للحد من أنواع الأجهزة المسموح بها. وبالمثل، فإن الوسيط --shuffle_auth_order هو طريقة رائعة لرش بيانات الاعتماد بطريقة أقل قابلية للتنبؤ. تمت إضافة هذا الخيار في محاولة لتجاوز عمليات الإغلاق الذكية للحسابات (مثل Azure Smart Lockout). على الرغم من أنه ليس مثاليًا، إلا أن ترتيب محاولات بيانات الاعتماد بشكل عشوائي له فوائد أخرى أيضًا، مثل جعل اكتشاف عمليات الرش هذه أكثر صعوبة. يدعم Spray365 أيضًا توجيه حركة المرور عبر بروكسي HTTP/HTTPS، مما يتكامل بشكل جيد مع أدوات أخرى مثل Burp Suite لمعالجة مصدر عملية الرش.



قم باستنساخ المستودع، ثبّت حزم Python المطلوبة، ثم شغّل Spray365!
$ git clone https://github.com/MarkoH17/Spray365
$ cd Spray365
~/Spray365$ pip3 install -r requirements.txt -U
~/Spray365$ python3 spray365.py
يلزم وجود خطة تنفيذ لرش بيانات الاعتماد، لذلك نحتاج إلى إنشاء واحدة! يمكن لـ Spray365 إنشاء خطة التنفيذ الخاصة به عن طريق تشغيل أمر الإنشاء في الوضع "العادي": (spray365.py generate normal). راجع التعليمات (spray365.py generate -h / spray365.py generate normal -h) لمزيد من التفاصيل.
$ python3 spray365.py generate normal -ep <execution_plan_filename> -d <domain_name> -u <file_containing_usernames> -pf <file_containing_passwords>
مثال:
$ python3 spray365.py generate normal -ep ex-plan.s365 -d example.com -u usernames -pf passwords
يمكن لـ Spray365 أيضًا تدقيق تكوينات المصادقة متعددة العوامل (MFA) وسياسات الوصول الشرطي عن طريق رش بيانات اعتماد صالحة. تحاول خطط تنفيذ أسلوب التدقيق جميع مجموعات وكيل المستخدم + معرّف عميل AAD + معرّف نقطة نهاية AAD لزوج معين من بيانات الاعتماد.
يمكن لـ Spray365 إنشاء خطة تنفيذ بأسلوب التدقيق عن طريق تشغيل أمر الإنشاء في وضع "التدقيق": (spray365.py generate audit). راجع التعليمات (spray365.py generate -h / spray365.py generate audit -h) لمزيد من التفاصيل. على الرغم من أنه من الممكن تقديم قائمة من المستخدمين وكلمات المرور بشكل منفصل (-u و -pf)، إلا أن هذه الخيارات تناسب بشكل أفضل خطط تنفيذ رش كلمات المرور (وليس التدقيق)، مما قد يتسبب في العديد من محاولات تسجيل الدخول غير الصالحة. بدلاً من ذلك، فكّر في استخدام -u / --user_file مع --passwords_in_userfile، والذي سيوجه Spray365 لاستخراج كلمات المرور من "user_file" عن طريق تقسيم كل سطر في ملف الإدخال على نقطتين، حيث يتم التعامل مع القيمة قبل النقطتين كاسم مستخدم، والقيمة بعد النقطتين ككلمة مرور (مثال: <username>:<password>، jsmith:Password01).
$ python3 spray365.py generate audit -ep <execution_plan_filename> -d <domain_name> -u <file_containing_usernames_and_passwords> --passwords_in_userfile
مثال:
$ python3 spray365.py generate audit -ep ex-plan.s365 -d example.com -u usernames --passwords_in_userfile
بمجرد إنشاء خطة التنفيذ، يمكن استخدام Spray365 لمعالجتها. سيؤدي تشغيل Spray365 في وضع "الرش" (spray365.py spray) إلى معالجة خطة التنفيذ المحددة ورش بيانات الاعتماد المناسبة. يمكن معالجة جميع أنواع خطط التنفيذ (العادية والتدقيق) في هذا الوضع. راجع التعليمات (spray365.py spray -h) لمزيد من التفاصيل.
$ python3 spray365.py spray -ep <execution_plan_filename>
مثال:
$ python3 spray365.py spray -ep ex-plan.s365
بعد رش بيانات الاعتماد من خطة تنفيذ، يُخرج Spray365 ملف JSON يحتوي على النتائج. يمكن معالجة هذا الملف باستخدام أدوات أخرى مثل JQ للحصول على رؤى حول عملية الرش بعد حدوثها. ومع ذلك، يتضمن Spray365 أيضًا أمر "مراجعة" (review) يمكن استخدامه لمعرفة:
راجع التعليمات (spray365.py review -h) لمزيد من التفاصيل.
$ python3 spray365.py review <spray_results_json_filename>
مثال:
$ python3 spray365.py review spray365_results_2022-05-20_18-58-31.json
Usage: spray365.py generate normal [OPTIONS]
Generate a vanilla (normal) execution plan
Options:
-ep, --execution_plan File path where execution plan should be saved [required]
-d, --domain Office 365 domain to authenticate against [required]
--delay Delay in seconds to wait between authentication attempts [default: 30]
-mD, --min_loop_delay Minimum time to wait between authentication attempts for a given user. This option takes into account the time one spray iteration will take, so a pre-authentication delay may not occur every time [default: 0]
User options:
-u, --user_file File containing usernames to spray (one per line without domain) [required]
Password options: [mutually_exclusive, required]
-p, --password Password to spray
-pf, --password_file File containing passwords to spray (one per line)
--passwords_in_userfile Extract passwords from user_file (colon separated)
Authentication options:
-cID, --aad_client Client ID used during authentication. Leave unspecified for random selection, or provide a comma-separated string
-eID, --aad_endpoint Endpoint ID used during authentication. Leave unspecified for random selection, or provide a comma-separated string
User Agent options: [mutually_exclusive]
-cUA, --custom_user_agent Set custom user agent for authentication requests
-rUA, --random_user_agent Randomize user agent for authentication requests [default: True]
Shuffle options: [all_or_none]
-S, --shuffle_auth_order Shuffle order of authentication attempts so that each iteration (User1:Pass1, User2:Pass1, User3:Pass1) will be sprayed in a random order with a random arrangement of passwords, e.g (User4:Pass16, User13:Pass25, User19:Pass40). Be aware this option introduces the possibility that the time between consecutive authentication attempts for a given user may occur DELAY seconds apart. Consider using the-mD/--min_loop_delay option to enforce a minimum delay between authentication attempts for any given user.
-SO, --shuffle_optimization_attempts [default: 10]
-h, --help Show this message and exit.
Usage: spray365.py generate audit [OPTIONS]
Generate an execution plan to identify flaws in MFA / Conditional Access Policies. This works best with with known credentials.
Options:
-ep, --execution_plan File path where execution plan should be saved [required]
-d, --domain Office 365 domain to authenticate against [required]
--delay Delay in seconds to wait between authentication attempts [default: 30]
-mD, --min_loop_delay Minimum time to wait between authentication attempts for a given user. This option takes into account the time one spray iteration will take, so a pre-authentication delay may not occur every time [default: 0]
User options:
-u, --user_file File containing usernames to spray (one per line without domain) [required]
Password options: [mutually_exclusive, required]
-p, --password Password to spray
-pf, --password_file File containing passwords to spray (one per line)
--passwords_in_userfile Extract passwords from user_file (colon separated)
Shuffle options: [all_or_none]
-S, --shuffle_auth_order Shuffle order of authentication attempts so that each iteration (User1:Pass1, User2:Pass1, User3:Pass1) will be sprayed in a random order with a random arrangement of passwords, e.g (User4:Pass16, User13:Pass25, User19:Pass40). Be aware this option introduces the possibility that the time between consecutive authentication attempts for a given user may occur DELAY seconds apart. Consider using the-mD/--min_loop_delay option to enforce a minimum delay between authentication attempts for any given user.
-SO, --shuffle_optimization_attempts [default: 10]
-h, --help Show this message and exit.
Usage: spray365.py spray [OPTIONS]
Password spray user accounts using an existing execution plan
Options:
-ep, --execution_plan File path to execution plan [required]
-l, --lockout Number of account lockouts to observe before aborting spraying session (disable with 0) [default: 5]
-R, --resume_index Resume spraying passwords from this position in the execution plan [x>=1]
-i, --ignore_success Ignore successful authentication attempts for users and continue to spray credentials. Setting this flag will enable spraying credentials for users even if Spray365 has already identified valid credentials.
Proxy options: [all_or_none]
-x, --proxy HTTP Proxy URL (format: http[s]://proxy.address:port)
-k, --insecure Disable HTTPS certificate verification
-h, --help Show this message and exit.
Usage: spray365.py review [OPTIONS] RESULTS
View data from password spraying results to identify valid accounts and more
Options:
--show_invalid_creds
--show_invalid_users
-h, --help Show this message and exit.
| المؤلف | الأداة / أخرى | الرابط |
|---|---|---|
| @__TexasRanger | msspray: تنفيذ هجمات رش كلمات المرور ضد Azure AD بالإضافة إلى التحقق من تنفيذ MFA على نقاط نهاية Azure و Office 365 | https://github.com/SecurityRiskAdvisors/msspray |
استخدام هذا البرنامج لمهاجمة أهداف دون موافقة مسبقة متبادلة هو غير قانوني. إنها مسؤولية المستخدم النهائي الامتثال لجميع القوانين المحلية والولائية والفيدرالية المعمول بها، بالإضافة إلى أي سياسات استخدام مقبولة سارية. استخدام هذا البرنامج يُبرئ المؤلف (المؤلفين) من أي مسؤولية عن سوء الاستخدام أو الضرر الناتج.