
स्रोत कोड प्रबंधन आक्रमण टूलकिट
सोर्स कोड मैनेजमेंट अटैक टूलकिट - SCMKit एक टूलकिट है जिसका उपयोग SCM सिस्टम पर हमला करने के लिए किया जा सकता है। SCMKit उपयोगकर्ता को SCM सिस्टम और उपयोग करने के लिए अटैक मॉड्यूल निर्दिष्ट करने की अनुमति देता है, साथ ही संबंधित SCM सिस्टम के लिए मान्य क्रेडेंशियल (उपयोगकर्ता नाम/पासवर्ड या API कुंजी) निर्दिष्ट करता है। वर्तमान में, SCMKit द्वारा समर्थित SCM सिस्टम GitHub Enterprise, GitLab Enterprise और Bitbucket Server हैं। समर्थित अटैक मॉड्यूल में रिकॉनिसेंस, प्रिविलेज एस्केलेशन और पर्सिस्टेंस शामिल हैं। SCMKit को मॉड्यूलर दृष्टिकोण में बनाया गया था, ताकि भविष्य में सूचना सुरक्षा समुदाय द्वारा नए मॉड्यूल और SCM सिस्टम जोड़े जा सकें।
इस प्रोजेक्ट में निम्नलिखित तृतीय-पक्ष लाइब्रेरी का उपयोग किया गया है।
प्रोजेक्ट को स्वयं संकलित करने के लिए Visual Studio सेटअप करने हेतु नीचे दिए गए चरणों का पालन करें। इसके लिए .NET लाइब्रेरी की आवश्यकता है जिसे NuGet पैकेज मैनेजर से स्थापित किया जा सकता है।
https://api.nuget.org/v3/index.json के साथ एक पैकेज स्रोत जोड़ेंInstall-Package Costura.Fody -Version 3.3.3Install-Package OctokitInstall-Package GitLabApiClientInstall-Package Newtonsoft.Jsonनीचे दी गई तालिका दर्शाती है कि प्रत्येक मॉड्यूल कहाँ समर्थित है
किसी विशेष SCM सिस्टम में उपयोग हो रही रिपॉजिटरी को खोजें
listrepo मॉड्यूल, प्रासंगिक प्रमाणीकरण जानकारी और URL के साथ प्रदान करें। यह रिपॉजिटरी का नाम और URL आउटपुट करेगा।
यह सभी रिपॉजिटरी सूचीबद्ध करेगा जो एक उपयोगकर्ता देख सकता है।
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 एंटरप्राइज
GitHub रिपॉजिटरी खोज एक "contains" खोज है, जहाँ आप जो स्ट्रिंग दर्ज करेंगे, वह उन रिपॉजिटरी को खोजेगा जिनके नामों में आपकी खोज शब्द शामिल है।
`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 एंटरप्राइज
GitLab रिपॉजिटरी खोज एक "contains" खोज है, जहाँ आप जो स्ट्रिंग दर्ज करेंगे, वह उन रिपॉजिटरी को खोजेगा जिनके नामों में आपकी खोज शब्द शामिल है।
`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 सर्वर
Bitbucket रिपॉजिटरी खोज एक "starts with" खोज है, जहाँ आप जो स्ट्रिंग दर्ज करेंगे, वह उन रिपॉजिटरी को खोजेगा जिनके नाम आपकी खोज शब्द से शुरू होते हैं।
`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 सिस्टम में किसी दिए गए कीवर्ड वाले कोड को खोजें
-o कमांड-लाइन स्विच में searchcode मॉड्यूल और अपने खोज मापदंड प्रदान करें, साथ ही कोई भी प्रासंगिक प्रमाणीकरण जानकारी और URL भी दें। यह मिलान करने वाली कोड फ़ाइल का URL, साथ ही कोड की वह पंक्ति आउटपुट करेगा जो मिलान हुई।
GitHub कोड खोज एक "contains" खोज है जहां आपके द्वारा दर्ज की गई स्ट्रिंग किसी भी पंक्ति में आपके खोज शब्द वाले कोड को खोजेगी।
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 कोड खोज एक "contains" खोज है जहां आपके द्वारा दर्ज की गई स्ट्रिंग किसी भी पंक्ति में आपके खोज शब्द वाले कोड को खोजेगी।
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 कोड खोज एक "contains" खोज है जहां आपके द्वारा दर्ज की गई स्ट्रिंग किसी भी पंक्ति में आपके खोज शब्द वाले कोड को खोजेगी।
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
The GitLab file search is a "contains" search where the string you enter it will search for files that contains your search term in the file name.
`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
The GitLab file search is a "contains" search where the string you enter it will search for files that contains your search term in the file name.
`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
The Bitbucket file search is a "contains" search where the string you enter it will search for files that contains your search term in the file name.
`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 प्रणाली में उपयोग किए जा रहे एक्सेस टोकन को निर्दिष्ट विशेषाधिकार प्राप्त करें
एक API कुंजी और URL के साथ privs मॉड्यूल प्रदान करें।
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
बिटबकेट में रिपॉजिटरी या प्रोजेक्ट से संबंधित नहीं होने वाली कार्रवाइयां करने के लिए केवल उपयोगकर्ता नाम/पासवर्ड प्रमाणीकरण समर्थित है।
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 ID पर ध्यान दें। भविष्य में 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 ID प्रदान करें जिसके लिए आप एक्सेस टोकन हटाना चाहते हैं।
##### GitLab Enterprise
यदि आप किसी अन्य उपयोगकर्ता का PAT हटाना चाहते हैं तो केवल व्यवस्थापक (admin) की आवश्यकता है। एक सामान्य उपयोगकर्ता अपना स्वयं का PAT हटा सकता है। हटाने के लिए आपको PAT ID प्रदान करनी होगी। यह ID तब दिखाई गई थी जब आपने 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
बिटबकेट में रेपो या प्रोजेक्ट से संबंधित नहीं होने वाली कार्रवाइयाँ करने के लिए केवल उपयोगकर्ता नाम/पासवर्ड प्रमाणीकरण समर्थित है। हटाने के लिए आपको PAT ID प्रदान करनी होगी। यह ID तब दिखाई गई थी जब आपने PAT बनाया था।
`SCMKit.exe -s bitbucket -m removepat -c userName:password -u https://bitbucket.something.local -o patID`
#### उदाहरण आउटपुट```
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
Timestamp: 1/20/2022 1:56:47 PM
==================================================
[*] INFO: Revoking personal access token of ID: 59
[+] SUCCESS: The personal access token of ID 59 was successfully revoked.
किसी विशेष SCM प्रणाली में उपयोग करने के लिए SSH कुंजी बनाएँ
createsshkey मॉड्यूल प्रदान करें, साथ ही किसी भी प्रासंगिक प्रमाणीकरण जानकारी और URL के साथ।
वर्तमान उपयोगकर्ता के रूप में प्रमाणित करने के लिए 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"
वर्तमान उपयोगकर्ता के रूप में प्रमाणित करने के लिए SSH कुंजी बनाता है। बनने के बाद दिखाई गई SSH कुंजी ID पर ध्यान दें। जब आपको भविष्य में 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"
वर्तमान उपयोगकर्ता के रूप में प्रमाणित करने के लिए SSH कुंजी बनाता है। Bitbucket में रिपॉजिटरी या परियोजनाओं से संबंधित कार्यों को करने के लिए केवल उपयोगकर्ता नाम/पासवर्ड प्रमाणीकरण समर्थित है। बनने के बाद दिखाई गई SSH कुंजी ID पर ध्यान दें। जब आपको भविष्य में 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
16
[+] SUCCESS: The hpotter user SSH key was successfully added.
### SSH कुंजियाँ सूचीबद्ध करें
#### उपयोग केस
> *किसी विशेष SCM सिस्टम पर उपयोगकर्ता के लिए SSH कुंजियाँ सूचीबद्ध करें*
#### सिंटैक्स
`listsshkey` मॉड्यूल प्रदान करें, साथ ही किसी भी प्रासंगिक प्रमाणीकरण जानकारी और URL के साथ।
##### GitHub Enterprise
वर्तमान उपयोगकर्ता के लिए 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`
##### GitLab Enterprise
वर्तमान उपयोगकर्ता के लिए 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`
##### Bitbucket Server
वर्तमान उपयोगकर्ता के लिए 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
Timestamp: 2/7/2022 4:09:40 PM
==================================================
SSH Key ID | SSH Key Value | Title
---------------------------------------------------------------
9 | .....p50edigBAF4lipVZkAM= | SCMKIT-RLzie
10 | .....vGJLPGHiTwIxW9i+xAs= | SCMKIT-muFGU
किसी विशेष SCM सिस्टम में उपयोगकर्ता के लिए SSH कुंजी हटाएं
removesshkey मॉड्यूल प्रदान करें, साथ ही कोई भी प्रासंगिक प्रमाणीकरण जानकारी और URL प्रदान करें। इसके अतिरिक्त, हटाने के लिए लक्ष्य उपयोगकर्ता SSH कुंजी ID प्रदान करें।
आपको हटाने के लिए SSH कुंजी ID प्रदान करनी होगी। यह ID तब दिखाई देती है जब आप 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
आपको हटाने के लिए SSH कुंजी ID प्रदान करनी होगी। यह ID तब दिखाई गई थी जब आपने 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
Only username/password auth is supported to perform actions not related to repos or projects in Bitbucket. आपको हटाने के लिए SSH कुंजी ID प्रदान करनी होगी। यह ID तब दिखाई गई थी जब आपने 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
[+] SUCCESS: The SSH key of ID 16 was successfully revoked.
### व्यवस्थापक आँकड़े सूचीबद्ध करें
#### उपयोग मामला
> *GitHub Enterprise में व्यवस्थापक आँकड़े सूचीबद्ध करें*
#### सिंटैक्स
`adminstats` मॉड्यूल प्रदान करें, साथ ही किसी भी प्रासंगिक प्रमाणीकरण जानकारी और URL के साथ। इस मॉड्यूल का उपयोग करने के लिए GitHub Enterprise में साइट व्यवस्थापक पहुंच आवश्यक है।
##### 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
Timestamp: 1/14/2022 9:45:50 PM
==================================================
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
Private Gists | Public Gists
-----------------------------------
0 | 1
GitHub Enterprise में शाखा सुरक्षाओं को सूचीबद्ध करें
protection मॉड्यूल प्रदान करें, साथ ही कोई भी प्रासंगिक प्रमाणीकरण जानकारी और URL। वैकल्पिक रूप से, रेपो नामों में निहित मिलान परिणामों को वापस करने के लिए options पैरामीटर में एक स्ट्रिंग प्रदान करें।
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
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
## पहचान
नीचे इस उपकरण के डिफ़ॉल्ट अवस्था में विशिष्ट उपयोग के लिए स्थिर हस्ताक्षर दिए गए हैं:
* प्रोजेक्ट GUID - `{266C644A-69B1-426B-A47C-1CF32B211F80}`
* इस रेपो में [SCMKit Yara Rule](https://github.com/h4wkst3r/scmkit/blob/HEAD/Detections/SCMKit.yar) देखें।
* उपयोगकर्ता एजेंट स्ट्रिंग - `SCMKIT-5dc493ada400c79dd318abbe770dac7c`
* इस रेपो में [SCMKit Snort Rule](https://github.com/h4wkst3r/scmkit/blob/HEAD/Detections/SCMKit.rules) देखें।
* एक्सेस टोकन और SSH कुंजी नाम - उपकरण का उपयोग करके बनाए गए एक्सेस टोकन और SSH कुंजियों के नाम में `SCMKIT-` उपसर्ग जोड़ा जाता है।
उपकरण द्वारा उपयोग की गई तकनीकों की पहचान मार्गदर्शन के लिए, X-Force Red [ब्लॉग पोस्ट](https://securityintelligence.com/posts/abusing-source-code-management-systems) देखें।
## संदर्भ
* Bitbucket API दस्तावेज़ीकरण
* https://developer.atlassian.com/server/bitbucket/reference/rest-api/
* Octokit दस्तावेज़ीकरण
* https://octokitnet.readthedocs.io/en/latest/
* https://github.com/octokit/octokit.net
* GitHub API दस्तावेज़ीकरण
* https://docs.github.com/en/rest/overview
* GitLab API दस्तावेज़ीकरण
* https://docs.gitlab.com/ee/api/api_resources.html
* GitLabApiClient Nuget पैकेज दस्तावेज़ीकरण
* https://github.com/nmklotas/GitLabApiClient
| लाइब्रेरी | URL | लाइसेंस |
|---|
| 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 |