
أداة هجوم لإدارة شيفرات المصدر
Source Code Management Attack Toolkit - SCMKit هي مجموعة أدوات يمكن استخدامها لمهاجمة أنظمة إدارة الكود المصدري (SCM). تسمح SCMKit للمستخدم بتحديد نظام SCM ووحدة الهجوم المراد استخدامها، بالإضافة إلى تحديد بيانات اعتماد صالحة (اسم مستخدم/كلمة مرور أو مفتاح API) لنظام SCM المعني. حاليًا، أنظمة SCM التي تدعمها SCMKit هي GitHub Enterprise و GitLab Enterprise و Bitbucket Server. تتضمن وحدات الهجوم المدعومة الاستطلاع ورفع الامتيازات والثبات. تم بناء SCMKit بطريقة نمطية، بحيث يمكن إضافة وحدات وأنظمة SCM جديدة في المستقبل من قبل مجتمع أمن المعلومات.
المكتبات الخارجية التالية تابعة لجهات ثالثة مستخدمة في هذا المشروع.
اتبع الخطوات أدناه لإعداد Visual Studio من أجل تجميع المشروع بنفسك. يتطلب هذا مكتبة .NET يمكن تثبيتها من مدير الحزم NuGet.
https://api.nuget.org/v3/index.jsonInstall-Package Costura.Fody -Version 3.3.3Install-Package OctokitInstall-Package GitLabApiClientInstall-Package Newtonsoft.Jsonالجدول أدناه يوضح مكان دعم كل وحدة
اكتشاف المستودعات المستخدمة في نظام SCM معين
قم بتوفير الوحدة listrepo، بالإضافة إلى أي معلومات مصادقة ذات صلة والرابط. سيؤدي هذا إلى إخراج اسم المستودع والرابط.
سيؤدي هذا إلى سرد جميع المستودعات التي يمكن للمستخدم رؤيتها.
SCMKit.exe -s github -m listrepo -c userName:password -u https://github.something.local
SCMKit.exe -s github -m listrepo -c apiKey -u https://github.something.local
سيؤدي هذا إلى سرد جميع المستودعات التي يمكن للمستخدم رؤيتها.
SCMKit.exe -s gitlab -m listrepo -c userName:password -u https://gitlab.something.local
SCMKit.exe -s gitlab -m listrepo -c apiKey -u https://gitlab.something.local
سيؤدي هذا إلى سرد جميع المستودعات التي يمكن للمستخدم رؤيتها.
SCMKit.exe -s bitbucket -m listrepo -c userName:password -u https://bitbucket.something.local
SCMKit.exe -s bitbucket -m listrepo -c apiKey -u https://bitbucket.something.local
C:>SCMKit.exe -s gitlab -m listrepo -c username:password -u https://gitlab.hogwarts.local
================================================== Module: listrepo System: gitlab Auth Type: Username/Password Options: Target URL: https://gitlab.hogwarts.local
Name | Visibility | URL
MaraudersMap | Private | https://gitlab.hogwarts.local/hpotter/maraudersmap
testingStuff | Internal | https://gitlab.hogwarts.local/adumbledore/testingstuff
Spellbook | Internal | https://gitlab.hogwarts.local/hpotter/spellbook
findShortestPathToGryffindorSword | Internal | https://gitlab.hogwarts.local/hpotter/findShortestPathToGryffindorSword
charms | Public | https://gitlab.hogwarts.local/hgranger/charms
Secret-Spells | Internal | https://gitlab.hogwarts.local/adumbledore/secret-spells
Monitoring | Internal | https://gitlab.hogwarts.local/gitlab-instance-10590c85/Monitoring
### البحث عن المستودعات
#### حالة الاستخدام
> *البحث عن المستودعات حسب اسم المستودع في نظام إدارة الشيفرات المصدرية (SCM) معين*
#### الصيغة
قم بتوفير وحدة `searchrepo` ومعايير البحث الخاصة بك في مفتاح سطر الأوامر `-o`، إلى جانب أي معلومات مصادقة ذات صلة وعنوان URL. سيؤدي ذلك إلى إخراج اسم المستودع المطابق وعنوان URL الخاص به.
##### GitHub Enterprise
بحث مستودعات GitHub هو بحث "يحتوي على" حيث السلسلة النصية التي تدخلها ستبحث عن المستودعات بأسماء تحتوي على مصطلح البحث الخاص بك.
`SCMKit.exe -s github -m searchrepo -c userName:password -u https://github.something.local -o "some search term"`
`SCMKit.exe -s github -m searchrepo -c apikey -u https://github.something.local -o "some search term"`
##### GitLab Enterprise
بحث مستودعات GitLab هو بحث "يحتوي على" حيث السلسلة النصية التي تدخلها ستبحث عن المستودعات بأسماء تحتوي على مصطلح البحث الخاص بك.
`SCMKit.exe -s gitlab -m searchrepo -c userName:password -u https://gitlab.something.local -o "some search term"`
`SCMKit.exe -s gitlab -m searchrepo -c apikey -u https://gitlab.something.local -o "some search term"`
##### Bitbucket Server
بحث مستودعات Bitbucket هو بحث "يبدأ بـ" حيث السلسلة النصية التي تدخلها ستبحث عن المستودعات بأسماء تبدأ بمصطلح البحث الخاص بك.
`SCMKit.exe -s bitbucket -m searchrepo -c userName:password -u https://bitbucket.something.local -o "some search term"`
`SCMKit.exe -s bitbucket -m searchrepo -c apikey -u https://bitbucket.something.local -o "some search term"`
#### مثال على المخرجات```
C:\>SCMKit.exe -s gitlab -m searchrepo -c apiKey -u https://gitlab.hogwarts.local -o "spell"
==================================================
Module: searchrepo
System: gitlab
Auth Type: API Key
Options: spell
Target URL: https://gitlab.hogwarts.local
Timestamp: 1/14/2022 8:32:30 PM
==================================================
Name | Visibility | URL
----------------------------------------------------------------------------------------------------------
Spellbook | Internal | https://gitlab.hogwarts.local/hpotter/spellbook
Secret-Spells | Internal | https://gitlab.hogwarts.local/adumbledore/secret-spells
البحث عن كود يحتوي على كلمة مفتاحية معينة في نظام إدارة المصدر (SCM) معين
قم بتوفير وحدة searchcode ومعايير البحث الخاصة بك في مفتاح سطر الأوامر -o، بالإضافة إلى أي معلومات مصادقة ذات صلة وعنوان URL. سيقوم هذا بإخراج عنوان URL لملف الكود المطابق، مع السطر في الكود الذي تطابق.
بحث كود GitHub هو بحث "يحتوي على" حيث السلسلة التي تدخلها ستبحث عن كود يحتوي على مصطلح البحث الخاص بك في أي سطر.
SCMKit.exe -s github -m searchcode -c userName:password -u https://github.something.local -o "some search term"
SCMKit.exe -s github -m searchcode -c apikey -u https://github.something.local -o "some search term"
بحث كود GitLab هو بحث "يحتوي على" حيث السلسلة التي تدخلها ستبحث عن كود يحتوي على مصطلح البحث الخاص بك في أي سطر.
SCMKit.exe -s gitlab -m searchcode -c userName:password -u https://gitlab.something.local -o "some search term"
SCMKit.exe -s gitlab -m searchcode -c apikey -u https://gitlab.something.local -o "some search term"
بحث كود Bitbucket هو بحث "يحتوي على" حيث السلسلة التي تدخلها ستبحث عن كود يحتوي على مصطلح البحث الخاص بك في أي سطر.
SCMKit.exe -s bitbucket -m searchcode -c userName:password -u https://bitbucket.something.local -o "some search term"
SCMKit.exe -s bitbucket -m searchcode -c apikey -u https://bitbucket.something.local -o "some search term"
C:>SCMKit.exe -s gitlab -m searchcode -c username:password -u https://gitlab.hogwarts.local -o "api_key"
================================================== Module: searchcode System: gitlab Auth Type: Username/Password Options: api_key Target URL: https://gitlab.hogwarts.local
[>] URL: https://gitlab.hogwarts.local/adumbledore/secret-spells/stuff.txt |_ API_KEY=abc123
Total number of items matching code search: 1
### البحث عن الملفات
#### حالة الاستخدام
> *البحث عن الملفات في المستودعات التي تحتوي على كلمة مفتاحية معينة في اسم الملف في نظام إدارة المصادر (SCM) محدد*
#### الصيغة
قم بتوفير وحدة `searchfile` ومعايير البحث في الخيار `-o` في سطر الأوامر، بالإضافة إلى أي معلومات مصادقة ذات صلة وعنوان URL. سيؤدي ذلك إلى إخراج عنوان URL للملف المطابق في المستودع الخاص به.
##### GitHub Enterprise
بحث ملفات GitLab هو بحث "يحتوي على" حيث السلسلة التي تدخلها ستبحث عن الملفات التي تحتوي على مصطلح البحث الخاص بك في اسم الملف.
`SCMKit.exe -s github -m searchfile -c userName:password -u https://github.something.local -o "some search term"`
`SCMKit.exe -s github -m searchfile -c apikey -u https://github.something.local -o "some search term"`
##### GitLab Enterprise
بحث ملفات GitLab هو بحث "يحتوي على" حيث السلسلة التي تدخلها ستبحث عن الملفات التي تحتوي على مصطلح البحث الخاص بك في اسم الملف.
`SCMKit.exe -s gitlab -m searchfile -c userName:password -u https://gitlab.something.local -o "some search term"`
`SCMKit.exe -s gitlab -m searchfile -c apikey -u https://gitlab.something.local -o "some search term"`
##### Bitbucket Server
بحث ملفات Bitbucket هو بحث "يحتوي على" حيث السلسلة التي تدخلها ستبحث عن الملفات التي تحتوي على مصطلح البحث الخاص بك في اسم الملف.
`SCMKit.exe -s bitbucket -m searchfile -c userName:password -u https://bitbucket.something.local -o "some search term"`
`SCMKit.exe -s bitbucket -m searchfile -c apikey -u https://bitbucket.something.local -o "some search term"`
#### مثال للإخراج```
C:\source\SCMKit\SCMKit\bin\Release>SCMKit.exe -s bitbucket -m searchfile -c apikey -u http://bitbucket.hogwarts.local:7990 -o jenkinsfile
==================================================
Module: searchfile
System: bitbucket
Auth Type: API Key
Options: jenkinsfile
Target URL: http://bitbucket.hogwarts.local:7990
Timestamp: 1/14/2022 10:17:59 PM
==================================================
[>] REPO: http://bitbucket.hogwarts.local:7990/scm/~HPOTTER/hpotter
[>] FILE: Jenkinsfile
[>] REPO: http://bitbucket.hogwarts.local:7990/scm/STUD/cred-decryption
[>] FILE: subDir/Jenkinsfile
Total matching results: 2
سرد المقتطفات المملوكة للمستخدم الحالي في GitLab
قم بتوفير وحدة listsnippet، بالإضافة إلى أي معلومات مصادقة ذات صلة وعنوان URL.
SCMKit.exe -s gitlab -m listsnippet -c userName:password -u https://gitlab.something.local
SCMKit.exe -s gitlab -m listsnippet -c apikey -u https://gitlab.something.local
C:>SCMKit.exe -s gitlab -m listsnippet -c username:password -u https://gitlab.hogwarts.local
================================================== Module: listsnippet System: gitlab Auth Type: Username/Password Options: Target URL: https://gitlab.hogwarts.local
Title | Raw URL
spell-script | https://gitlab.hogwarts.local/-/snippets/2/raw
### قائمة العمال
#### حالة الاستخدام
> *سرد جميع عمال GitLab المتاحة للمستخدم الحالي في GitLab*
#### الصيغة
قم بتوفير الوحدة `listrunner`، إلى جانب أي معلومات مصادقة ذات صلة وعنوان URL. إذا كان المستخدم مسؤولاً، فستتمكن من سرد جميع العمال داخل مثيل GitLab Enterprise، والذي يشمل العمال المشتركين والعمال الجماعيين.
##### GitLab Enterprise
`SCMKit.exe -s gitlab -m listrunner -c userName:password -u https://gitlab.something.local`
`SCMKit.exe -s gitlab -m listrunner -c apikey -u https://gitlab.something.local`
#### مثال على المخرجات```
C:\>SCMKit.exe -s gitlab -m listrunner -c username:password -u https://gitlab.hogwarts.local
==================================================
Module: listrunner
System: gitlab
Auth Type: Username/Password
Options:
Target URL: https://gitlab.hogwarts.local
Timestamp: 1/25/2022 11:40:08 AM
==================================================
ID | Name | Repo Assigned
---------------------------------------------------------------------------------
2 | gitlab-runner | https://gitlab.hogwarts.local/hpotter/spellbook.git
3 | gitlab-runner | https://gitlab.hogwarts.local/hpotter/maraudersmap.git
قائمة الجيستات المملوكة من قبل المستخدم الحالي في GitHub
قم بتوفير الوحدة النمطية listgist، إلى جانب أي معلومات توثيق وعنوان URL ذات صلة.
SCMKit.exe -s github -m listgist -c userName:password -u https://github.something.local
SCMKit.exe -s github -m listgist -c apikey -u https://github.something.local
C:>SCMKit.exe -s github -m listgist -c username:password -u https://github-enterprise.hogwarts.local
================================================== Module: listgist System: github Auth Type: Username/Password Options: Target URL: https://github-enterprise.hogwarts.local
Description | Visibility | URL
Shell Script to Decode Spell | public | https://github-enterprise.hogwarts.local/gist/c11c6bb3f47fe67183d5bc9f048412a1
### قائمة المنظمات
#### حالة الاستخدام
> *سرد جميع المنظمات التي ينتمي إليها المستخدم الحالي في GitHub*
#### الصيغة
قم بتوفير الوحدة `listorg`، إلى جانب معلومات المصادقة ذات الصلة وعنوان URL.
##### GitHub Enterprise
`SCMKit.exe -s github -m listorg -c userName:password -u https://github.something.local`
`SCMKit.exe -s github -m listorg -c apiKey -u https://github.something.local`
#### مثال على الإخراج```
C:\>SCMKit.exe -s github -m listorg -c username:password -u https://github-enterprise.hogwarts.local
==================================================
Module: listorg
System: github
Auth Type: Username/Password
Options:
Target URL: https://github-enterprise.hogwarts.local
Timestamp: 1/14/2022 9:44:48 PM
==================================================
Name | URL
-----------------------------------------------------------------------------------
Hogwarts | https://github-enterprise.hogwarts.local/api/v3/orgs/Hogwarts/repos
الحصول على الصلاحيات المخصصة لرمز الوصول المستخدم في نظام SCM معين
قم بتوفير وحدة privs، بالإضافة إلى مفتاح API وعنوان URL.
SCMKit.exe -s github -m privs -c apiKey -u https://github.something.local
SCMKit.exe -s gitlab -m privs -c apiKey -u https://gitlab.something.local
C:>SCMKit.exe -s gitlab -m privs -c apikey -u https://gitlab.hogwarts.local
================================================== Module: privs System: gitlab Auth Type: API Key Options: Target URL: https://gitlab.hogwarts.local
Token Name | Active? | Privilege | Description
hgranger-api-token | True | api | Read-write for the complete API, including all groups and projects, the Container Registry, and the Package Registry. hgranger-api-token | True | read_user | Read-only for endpoints under /users. Essentially, access to any of the GET requests in the Users API. hgranger-api-token | True | read_api | Read-only for the complete API, including all groups and projects, the Container Registry, and the Package Registry. hgranger-api-token | True | read_repository | Read-only (pull) for the repository through git clone. hgranger-api-token | True | write_repository | Read-write (pull, push) for the repository through git clone. Required for accessing Git repositories over HTTP when 2FA is enabled.
### إضافة مشرف
#### حالة الاستخدام
> *رفع مستخدم عادي إلى دور إداري في نظام SCM معين*
#### البنية
قم بتوفير وحدة `addadmin`، بالإضافة إلى أي معلومات مصادقة ذات صلة وURL. أيضًا، قدم المستخدم الهدف الذي ترغب في إضافة دور إداري له.
##### GitHub Enterprise
`SCMKit.exe -s github -m addadmin -c userName:password -u https://github.something.local -o targetUserName`
`SCMKit.exe -s github -m addadmin -c apikey -u https://github.something.local -o targetUserName`
##### GitLab Enterprise
`SCMKit.exe -s gitlab -m addadmin -c userName:password -u https://gitlab.something.local -o targetUserName`
`SCMKit.exe -s gitlab -m addadmin -c apikey -u https://gitlab.something.local -o targetUserName`
##### Bitbucket Server
فقط المصادقة باسم المستخدم وكلمة المرور مدعومة لتنفيذ إجراءات غير متعلقة بالمستودعات أو المشاريع في Bitbucket.
`SCMKit.exe -s bitbucket -m addadmin -c userName:password -u https://bitbucket.something.local -o targetUserName`
#### مثال على الإخراج```
C:\>SCMKit.exe -s gitlab -m addadmin -c apikey -u https://gitlab.hogwarts.local -o hgranger
==================================================
Module: addadmin
System: gitlab
Auth Type: API Key
Options: hgranger
Target URL: https://gitlab.hogwarts.local
Timestamp: 1/14/2022 9:19:32 PM
==================================================
[+] SUCCESS: The hgranger user was successfully added to the admin role.
تخفيض صلاحية مستخدم مسؤول إلى دور مستخدم عادي في نظام إدارة المصادر (SCM) معين
قدم الوحدة removeadmin، بالإضافة إلى أي معلومات مصادقة ذات صلة وعنوان URL. كما قدم المستخدم الهدف الذي ترغب في إزالة الدور الإداري منه.
SCMKit.exe -s github -m removeadmin -c userName:password -u https://github.something.local -o targetUserName
SCMKit.exe -s github -m removeadmin -c apikey -u https://github.something.local -o targetUserName
SCMKit.exe -s gitlab -m removeadmin -c userName:password -u https://gitlab.something.local -o targetUserName
SCMKit.exe -s gitlab -m removeadmin -c apikey -u https://gitlab.something.local -o targetUserName
يُدعم فقط مصادقة اسم المستخدم/كلمة المرور لتنفيذ الإجراءات غير المتعلقة بالمستودعات أو المشاريع في Bitbucket.
SCMKit.exe -s bitbucket -m removeadmin -c userName:password -u https://bitbucket.something.local -o targetUserName
C:>SCMKit.exe -s gitlab -m removeadmin -c username:password -u https://gitlab.hogwarts.local -o hgranger
================================================== Module: removeadmin System: gitlab Auth Type: Username/Password Options: hgranger Target URL: https://gitlab.hogwarts.local
[+] SUCCESS: The hgranger user was successfully removed from the admin role.
### إنشاء رمز الوصول
#### حالة الاستخدام
> *إنشاء رمز وصول لاستخدامه في نظام SCM معين*
#### الصيغة
قم بتوفير وحدة `createpat`، بالإضافة إلى أي معلومات مصادقة ذات صلة وعنوان URL. بالإضافة إلى ذلك، قم بتوفير المستخدم المستهدف الذي ترغب في إنشاء رمز وصول له.
##### GitLab Enterprise
يمكن إجراء هذا فقط كمسؤول. ستقوم بتوفير اسم المستخدم الذي ترغب في إنشاء PAT له.
`SCMKit.exe -s gitlab -m createpat -c userName:password -u https://gitlab.something.local -o targetUserName`
`SCMKit.exe -s gitlab -m createpat -c apikey -u https://gitlab.something.local -o targetUserName`
##### Bitbucket Server
ينشئ PAT للمستخدم الحالي الذي يقوم بالمصادقة. في Bitbucket، لا يمكنك إنشاء PAT لمستخدم آخر، حتى كمسؤول. يتم دعم مصادقة اسم المستخدم/كلمة المرور فقط لتنفيذ إجراءات لا تتعلق بالمستودعات أو المشاريع في Bitbucket. قم بتدوين معرف PAT الذي يظهر بعد الإنشاء. ستحتاج إليه عندما تحتاج إلى إزالة PAT في المستقبل.
`SCMKit.exe -s bitbucket -m createpat -c userName:password -u https://bitbucket.something.local `
#### مثال على الإخراج```
C:\>SCMKit.exe -s gitlab -m createpat -c username:password -u https://gitlab.hogwarts.local -o hgranger
==================================================
Module: createpat
System: gitlab
Auth Type: Username/Password
Options: hgranger
Target URL: https://gitlab.hogwarts.local
Timestamp: 1/20/2022 1:51:23 PM
==================================================
ID | Name | Token
-----------------------------------------------------
59 | SCMKIT-AaCND | R3ySx_8HUn6UQ_6onETx
[+] SUCCESS: The hgranger user personal access token was successfully added.
سرد رموز الوصول لمستخدم على نظام SCM معين
قم بتوفير الوحدة listpat، بالإضافة إلى أي معلومات مصادقة ذات صلة وعنوان URL.
يتطلب صلاحيات المسؤول فقط إذا كنت تريد سرد رموز PAT لمستخدم آخر. يمكن للمستخدم العادي سرد رموز PAT الخاصة به.
SCMKit.exe -s gitlab -m listpat -c userName:password -u https://gitlab.something.local -o targetUser
SCMKit.exe -s gitlab -m listpat -c apikey -u https://gitlab.something.local -o targetUser
سرد رموز الوصول للمستخدم الحالي. يتم دعم مصادقة اسم المستخدم/كلمة المرور فقط لتنفيذ إجراءات لا تتعلق بالمستودعات أو المشاريع في Bitbucket.
SCMKit.exe -s bitbucket -m listpat -c userName:password -u https://bitbucket.something.local
سرد رموز الوصول لمستخدم آخر (يتطلب صلاحيات المسؤول). يتم دعم مصادقة اسم المستخدم/كلمة المرور فقط لتنفيذ إجراءات لا تتعلق بالمستودعات أو المشاريع في Bitbucket.
SCMKit.exe -s bitbucket -m listpat -c userName:password -u https://bitbucket.something.local -o targetUser
C:>SCMKit.exe -s gitlab -m listpat -c username:password -u https://gitlab.hogwarts.local -o hgranger
================================================== Module: listpat System: gitlab Auth Type: Username/Password Options: hgranger Target URL: https://gitlab.hogwarts.local
59 | SCMKIT-AaCND | True | api, read_repository, write_repository
### إزالة رمز الوصول
#### حالة الاستخدام
> *إزالة رمز وصول لمستخدم في نظام SCM معين*
#### الصيغة
قم بتوفير الوحدة `removepat`، بالإضافة إلى أي معلومات مصادقة ذات صلة وعنوان URL. بالإضافة إلى ذلك، قم بتوفير معرف PAT الخاص بالمستخدم المستهدف الذي ترغب في إزالة رمز الوصول له.
##### GitLab Enterprise
يتطلب مسؤولًا فقط إذا كنت تريد إزالة PAT لمستخدم آخر. يمكن للمستخدم العادي إزالة PAT الخاص به. يجب عليك تقديم معرف PAT المراد إزالته. يتم عرض هذا المعرف عند إنشاء PAT وأيضًا عند سرد PAT.
`SCMKit.exe -s gitlab -m removepat -c userName:password -u https://gitlab.something.local -o patID`
`SCMKit.exe -s gitlab -m removepat -c apikey -u https://gitlab.something.local -o patID`
##### Bitbucket Server
يتم دعم مصادقة اسم المستخدم/كلمة المرور فقط لتنفيذ الإجراءات غير المتعلقة بالمستودعات أو المشاريع في Bitbucket. يجب عليك تقديم معرف PAT المراد إزالته. يتم عرض هذا المعرف عند إنشاء PAT.
`SCMKit.exe -s bitbucket -m removepat -c userName:password -u https://bitbucket.something.local -o patID`
#### مثال على الإخراج
```text
C:>SCMKit.exe -s gitlab -m removepat -c apikey -u https://gitlab.hogwarts.local -o 58
================================================== Module: removepat System: gitlab Auth Type: API Key Options: 59 Target URL: https://gitlab.hogwarts.local
[*] INFO: Revoking personal access token of ID: 59
[+] SUCCESS: The personal access token of ID 59 was successfully revoked.
### إنشاء مفتاح SSH
#### حالة الاستخدام
> *إنشاء مفتاح SSH لاستخدامه في نظام SCM معين*
#### الصيغة
قم بتوفير الوحدة النمطية `createsshkey`، إلى جانب أي معلومات توثيق وعنوان URL ذي صلة.
##### GitHub Enterprise
ينشئ مفتاح SSH للمستخدم الحالي الذي يتم المصادقة باسمه.
`SCMKit.exe -s github -m createsshkey -c userName:password -u https://github.something.local -o "ssh public key"`
`SCMKit.exe -s github -m createsshkey -c apiToken -u https://github.something.local -o "ssh public key"`
##### GitLab Enterprise
ينشئ مفتاح SSH للمستخدم الحالي الذي يتم المصادقة باسمه. لاحظ معرف مفتاح SSH الذي يظهر بعد الإنشاء. ستحتاج إليه عندما تحتاج إلى إزالة مفتاح SSH في المستقبل.
`SCMKit.exe -s gitlab -m createsshkey -c userName:password -u https://gitlab.something.local -o "ssh public key"`
`SCMKit.exe -s gitlab -m createsshkey -c apiToken -u https://gitlab.something.local -o "ssh public key"`
##### Bitbucket Server
ينشئ مفتاح SSH للمستخدم الحالي الذي يتم المصادقة باسمه. يُدعم فقط توثيق اسم المستخدم/كلمة المرور لتنفيذ إجراءات غير متعلقة بالمستودعات أو المشاريع في Bitbucket. لاحظ معرف مفتاح SSH الذي يظهر بعد الإنشاء. ستحتاج إليه عندما تحتاج إلى إزالة مفتاح SSH في المستقبل.
`SCMKit.exe -s bitbucket -m createsshkey -c userName:password -u https://bitbucket.something.local -o "ssh public key"`
#### مثال على الإخراج```
C:\>SCMKit.exe -s bitbucket -m createsshkey -c username:password -u https://bitbucket.hogwarts.local -o "ssh-rsa..."
==================================================
Module: createsshkey
System: bitbucket
Auth Type: Username/Password
Options: ssh-rsa ...
Target URL: http://bitbucket.hogwarts.local:7990
Timestamp: 2/7/2022 1:02:31 PM
==================================================
SSH Key ID
------------
16
[+] SUCCESS: The hpotter user SSH key was successfully added.
قم بإدراج مفاتيح SSH لمستخدم معين في نظام إدارة الكود المصدري (SCM) محدد
قم بتوفير الوحدة النمطية listsshkey، بالإضافة إلى أي معلومات مصادقة ذات صلة وعنوان URL.
قم بإدراج مفاتيح SSH للمستخدم الحالي. سيتضمن ذلك معرفات مفاتيح SSH، وهو أمر مطلوب عند الرغبة في إزالة مفتاح SSH.
SCMKit.exe -s github -m listsshkey -c userName:password -u https://github.something.local
SCMKit.exe -s github -m listsshkey -c apiToken -u https://github.something.local
قم بإدراج مفاتيح SSH للمستخدم الحالي.
SCMKit.exe -s gitlab -m listsshkey -c userName:password -u https://gitlab.something.local
SCMKit.exe -s gitlab -m listsshkey -c apiToken -u https://gitlab.something.local
قم بإدراج مفاتيح SSH للمستخدم الحالي. يُدعم فقط مصادقة اسم المستخدم/كلمة المرور لتنفيذ الإجراءات غير المتعلقة بالمستودعات أو المشاريع في Bitbucket.
SCMKit.exe -s bitbucket -m listsshkey -c userName:password -u https://bitbucket.something.local
C:>SCMKit.exe -s gitlab -m listsshkey -u http://gitlab.hogwarts.local -c apiToken
================================================== Module: listsshkey System: gitlab Auth Type: API Key Options: Target URL: https://gitlab.hogwarts.local
9 | .....p50edigBAF4lipVZkAM= | SCMKIT-RLzie
10 | .....vGJLPGHiTwIxW9i+xAs= | SCMKIT-muFGU
### إزالة مفتاح SSH
#### حالة الاستخدام
> *إزالة مفتاح SSH لمستخدم في نظام إدارة المصادر (SCM) معين*
#### الصيغة
قم بتوفير الوحدة النمطية `removesshkey`، إلى جانب أي معلومات مصادقة ذات صلة وURL. بالإضافة إلى ذلك، قم بتوفير معرف مفتاح SSH للمستخدم المستهدف لإزالته.
##### GitHub Enterprise
يجب عليك توفير معرف مفتاح SSH لإزالته. يتم عرض هذا المعرف عند سرد مفاتيح SSH.
`SCMKit.exe -s github -m removesshkey -c userName:password -u https://github.something.local -o sshKeyID`
`SCMKit.exe -s github -m removesshkey -c apiToken -u https://github.something.local -o sshKeyID`
##### GitLab Enterprise
يجب عليك توفير معرف مفتاح SSH لإزالته. يتم عرض هذا المعرف عند إنشاء مفتاح SSH ويتم عرضه أيضًا عند سرد مفاتيح SSH.
`SCMKit.exe -s gitlab -m removesshkey -c userName:password -u https://gitlab.something.local -o sshKeyID`
`SCMKit.exe -s gitlab -m removesshkey -c apiToken -u https://gitlab.something.local -o sshKeyID`
##### Bitbucket Server
يتم دعم المصادقة باسم المستخدم/كلمة المرور فقط لتنفيذ الإجراءات غير المتعلقة بالمستودعات أو المشاريع في Bitbucket. يجب عليك توفير معرف مفتاح SSH لإزالته. يتم عرض هذا المعرف عند إنشاء مفتاح SSH ويتم عرضه أيضًا عند سرد مفاتيح SSH.
`SCMKit.exe -s bitbucket -m removesshkey -c userName:password -u https://bitbucket.something.local -o sshKeyID`
#### مثال الإخراج```
C:\>SCMKit.exe -s bitbucket -m removesshkey -u http://bitbucket.hogwarts.local:7990 -c username:password -o 16
==================================================
Module: removesshkey
System: bitbucket
Auth Type: Username/Password
Options: 16
Target URL: http://bitbucket.hogwarts.local:7990
Timestamp: 2/7/2022 1:48:03 PM
==================================================
[+] SUCCESS: The SSH key of ID 16 was successfully revoked.
عرض إحصائيات المشرف في GitHub Enterprise
قم بتوفير الوحدة النمطية adminstats، إلى جانب أي معلومات مصادقة ذات صلة وعنوان URL. مطلوب صلاحية مشرف الموقع في GitHub Enterprise لاستخدام هذه الوحدة
SCMKit.exe -s github -m adminstats -c userName:password -u https://github.something.local
SCMKit.exe -s github -m adminstats -c apikey -u https://github.something.local
C:>SCMKit.exe -s github -m adminstats -c username:password -u https://github-enterprise.hogwarts.local
================================================== Module: adminstats System: github Auth Type: Username/Password Options: Target URL: https://github-enterprise.hogwarts.local
Admin Users | Suspended Users | Total Users
1 | 0 | 5
Total Repos | Total Wikis
4 | 0
Total Orgs | Total Team Members | Total Teams
1 | 0 | 0
0 | 1
### قائمة حماية الفرع
#### حالة الاستخدام
> *قائمة حماية الفروع في GitHub Enterprise*
#### الصياغة
قم بتوفير وحدة `protection`، إلى جانب أي معلومات مصادقة ذات صلة وعنوان URL. اختياريًا، قم بتوفير سلسلة نصية في معلمة الخيارات لإرجاع النتائج المطابقة الموجودة في أسماء المستودعات.
##### GitHub Enterprise
`SCMKit.exe -s github -m protection -c userName:password -u https://github.something.local`
`SCMKit.exe -s github -m protection -c apikey -u https://github.something.local`
`SCMKit.exe -s github -m protection -c apikey -u https://github.something.local -o reponame`
#### مثال على الإخراج```
C:\>.\SCMKit.exe -u http://github.hogwarts.local -s github -c apiToken -m protection -o public-r
==================================================
Module: protection
System: github
Auth Type: API Key
Options: public-r
Target URL: http://github.hogwarts.local
Timestamp: 8/29/2022 2:02:42 PM
==================================================
Repo | Branch | Protection
----------------------------------------------------------------------------------------------------------
public-repo | dev | Protected: True
Status checks must pass before merge:
Branch must be up-to-date before merge: True
Owner review required before merge: True
Approvals required before merge: 2
Protections apply to repo admins: True
public-repo | main | Protected: False
فيما يلي توقيعات ثابتة للاستخدام المحدد لهذه الأداة في حالتها الافتراضية:
{266C644A-69B1-426B-A47C-1CF32B211F80}
SCMKIT-5dc493ada400c79dd318abbe770dac7c
SCMKIT-.للحصول على إرشادات الكشف عن التقنيات المستخدمة من قبل الأداة، راجع منشور المدونة لـ X-Force Red.
| المكتبة | الرابط | الترخيص |
|---|
| Octokit | https://github.com/octokit/octokit.net | MIT License |
| Fody | https://github.com/Fody/Fody | MIT License |
| GitLabApiClient | https://github.com/nmklotas/GitLabApiClient | MIT License |
| Newtonsoft.Json | https://github.com/JamesNK/Newtonsoft.Json | MIT License |
| سيناريو الهجوم | الوحدة | يتطلب مسؤولًا؟ | GitHub Enterprise | GitLab Enterprise | Bitbucket Server |
|---|
| استطلاع | listrepo | لا | X | X | X |
| استطلاع | searchrepo | لا | X | X | X |
| استطلاع | searchcode | لا | X | X | X |
| استطلاع | searchfile | لا | X | X | X |
| استطلاع | listsnippet | لا | X | ||
| استطلاع | listrunner | لا | X | ||
| استطلاع | listgist | لا | X | ||
| استطلاع | listorg | لا | X | ||
| استطلاع | privs | لا | X | X | |
| استطلاع | protection | لا | X | ||
| ثبات | listsshkey | لا | X | X | X |
| ثبات | removesshkey | لا | X | X | X |
| ثبات | createsshkey | لا | X | X | X |
| ثبات | listpat | لا | X | X | |
| ثبات | removepat | لا | X | X | |
| ثبات | createpat | نعم (GitLab Enterprise فقط) | X | X | |
| رفع امتيازات | addadmin | نعم | X | X | X |
| رفع امتيازات | removeadmin | نعم | X | X | X |
| استطلاع | adminstats | نعم | X |