Skip to content
KitploitKITPLOIT
OutilsBlog
Soumettre
OutilsBlog
Soumettre

Outils de Hacking, PenTest et Cybersécurité pour votre Arsenal de Sécurité !

Kitploit est un répertoire d'outils de hacking, de cybersécurité et de pentesting. Découvrez les dernières mises à jour des projets pour trouver des vulnérabilités, analyser des systèmes, automatiser les tests et renforcer votre sécurité.

··Flux·Contact·Confidentialité·© 2026 Kitploit

Répertoire d'outils

Catégories

Voir toutes les catégories
Loading categories
SCMKit — Boîte à outils d'attaque de gestion de code source | Kitploit
Outils/GitHubGitHub/xforcered/scmkit
Escalade de PrivilègesReconnaissanceMécanismes de PersistanceCollecte d'InformationsPost-ExploitationTests d'IntrusionRed Teaming
GitHubxforcered/scmkit

SCMKit

Boîte à outils d'attaque de gestion de code source

Voir le dépôt
134193il y a 3 ansVérifié par Kitploit

Populaires

Voir tout →

Découvrez les outils les plus utilisés par notre communauté.

Explorer tous les outils

Parcourez notre collection d'outils

Voir tous les outils →
Partager

SCMKit

Description

Source Code Management Attack Toolkit - SCMKit est une boîte à outils qui peut être utilisée pour attaquer les systèmes SCM. SCMKit permet à l'utilisateur de spécifier le système SCM et le module d'attaque à utiliser, ainsi que de fournir des identifiants valides (nom d'utilisateur/mot de passe ou clé API) au système SCM respectif. Actuellement, les systèmes SCM pris en charge par SCMKit sont GitHub Enterprise, GitLab Enterprise et Bitbucket Server. Les modules d'attaque pris en charge incluent la reconnaissance, l'élévation de privilèges et la persistance. SCMKit a été conçu de manière modulaire, afin que de nouveaux modules et systèmes SCM puissent être ajoutés à l'avenir par la communauté de la sécurité de l'information.

Release

  • La version 1.2 de SCMKit est disponible dans Releases

Table des matières

  • SCMKit
  • Table des matières
  • Installation/Compilation
    • Bibliothèques utilisées
    • Pré-compilé
    • Compiler soi-même
  • Utilisation
    • Arguments/Options
    • Systèmes
    • Modules
    • Tableau des détails des modules
  • Exemples
    • Lister les dépôts
    • Rechercher des dépôts
    • Rechercher du code
    • Rechercher des fichiers
    • Lister les snippets
    • Lister les runners
    • Lister les gists
    • Lister les organisations
    • Obtenir les privilèges de la clé API
    • Ajouter un administrateur
    • Retirer un administrateur
    • Créer un jeton d'accès
    • Lister les jetons d'accès
    • Supprimer un jeton d'accès
    • Créer une clé SSH
    • Lister les clés SSH
    • Supprimer une clé SSH
    • Lister les statistiques d'administration
    • Lister la protection de branche
  • Détection
  • Références

Installation/Compilation

Bibliothèques utilisées

Les bibliothèques tierces suivantes sont utilisées dans ce projet.

Pré-compilé

  • Utilisez le binaire pré-compilé dans Releases

Compiler soi-même

Suivez les étapes ci-dessous pour configurer Visual Studio afin de compiler le projet vous-même. Cela nécessite une bibliothèque .NET qui peut être installée à partir du gestionnaire de packages NuGet.

  • Chargez le projet Visual Studio et allez dans "Tools" --> "NuGet Package Manager" --> "Package Manager Settings"
  • Allez dans "NuGet Package Manager" --> "Package Sources"
  • Ajoutez une source de packages avec l'URL https://api.nuget.org/v3/index.json
  • Installez les packages NuGet suivants
    • Install-Package Costura.Fody -Version 3.3.3
    • Install-Package Octokit
    • Install-Package GitLabApiClient
    • Install-Package Newtonsoft.Json
  • Vous pouvez maintenant compiler le projet vous-même !

Utilisation

Arguments/Options

  • -c, -credential - identifiants pour l'authentification (nom d'utilisateur:mot de passe ou clé API)
  • -s, -system - système à attaquer (github,gitlab,bitbucket)
  • -u, -url - URL pour GitHub Enterprise, GitLab Enterprise ou Bitbucket Server
  • -m, -module - module à exécuter
  • -o, -option - options (le cas échéant)

Systèmes (-s, -system)

  • github : GitHub Enterprise
  • gitlab : GitLab Enterprise
  • bitbucket : Bitbucket Server

Modules (-m, -module)

  • listrepo : lister tous les dépôts que l'utilisateur courant peut voir
  • searchrepo : rechercher un dépôt donné
  • searchcode : rechercher du code contenant le terme de recherche
  • searchfile : rechercher un nom de fichier contenant le terme de recherche
  • listsnippet : lister tous les snippets de l'utilisateur courant
  • listrunner : lister tous les runners GitLab disponibles pour l'utilisateur courant
  • listgist : lister tous les gists de l'utilisateur courant
  • listorg : lister toutes les organisations auxquelles l'utilisateur courant appartient
  • privs : obtenir les privilèges du jeton API courant
  • addadmin : promouvoir l'utilisateur donné au rôle d'administrateur
  • removeadmin : rétrograder l'utilisateur donné du rôle d'administrateur
  • createpat : créer un jeton d'accès personnel pour l'utilisateur cible
  • listpat : lister les jetons d'accès personnels d'un utilisateur cible
  • removepat : supprimer un jeton d'accès personnel d'un utilisateur cible
  • createsshkey : créer une clé SSH pour l'utilisateur courant
  • listsshkey : lister les clés SSH de l'utilisateur courant
  • removesshkey : supprimer la clé SSH de l'utilisateur courant
  • adminstats : obtenir les statistiques d'administration (utilisateurs, dépôts, organisations, gists)
  • protection : obtenir les paramètres de protection de branche

Tableau des détails des modules

Le tableau ci-dessous indique où chaque module est pris en charge

Exemples

Lister les dépôts

Cas d'utilisation

Découvrir les dépôts utilisés dans un système SCM particulier

Syntaxe

Fournissez le module listrepo, ainsi que les informations d'authentification pertinentes et l'URL. Cela affichera le nom du dépôt et son URL.

GitHub Enterprise

Cela listera tous les dépôts qu'un utilisateur peut voir.

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

GitLab Enterprise

Cela listera tous les dépôts qu'un utilisateur peut voir.

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

Bitbucket Server

Cela listera tous les dépôts qu'un utilisateur peut voir.

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

Exemple de sortie```

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

Timestamp: 1/14/2022 8:30:47 PM

root@kitploit:~
                                Name | Visibility |                                                URL

root@kitploit:~
                        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
root@kitploit:~
### Recherche de dépôts

#### Cas d'utilisation

> *Rechercher des dépôts par nom de dépôt dans un système SCM particulier.*

#### Syntaxe

Fournissez le module `searchrepo` et vos critères de recherche dans l'option de ligne de commande `-o`, ainsi que les informations d'authentification et l'URL pertinentes. Cela affichera le nom et l'URL du dépôt correspondant.

##### GitHub Enterprise

La recherche de dépôts GitHub est une recherche « contient » dans laquelle la chaîne que vous saisissez recherche les dépôts dont les noms contiennent votre terme de recherche.

`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

La recherche de dépôts GitLab est une recherche « contient » dans laquelle la chaîne que vous saisissez recherche les dépôts dont les noms contiennent votre terme de recherche.

`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

La recherche de dépôts Bitbucket est une recherche « commence par » dans laquelle la chaîne que vous saisissez recherche les dépôts dont les noms commencent par votre terme de recherche.

`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"`

#### Exemple de sortie```

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

Recherche de code

Cas d'utilisation

Rechercher du code contenant un mot-clé donné dans un système SCM particulier

Syntaxe

Fournissez le module searchcode et vos critères de recherche dans le paramètre de ligne de commande -o, ainsi que les informations d'authentification et l'URL pertinentes. Cela affichera l'URL du fichier de code correspondant, ainsi que la ligne du code qui correspond.

GitHub Enterprise

La recherche de code GitHub est une recherche de type « contient » où la chaîne que vous saisissez recherchera le code contenant votre terme de recherche dans n'importe quelle ligne.

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 Enterprise

La recherche de code GitLab est une recherche de type « contient » où la chaîne que vous saisissez recherchera le code contenant votre terme de recherche dans n'importe quelle ligne.

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 Server

La recherche de code Bitbucket est une recherche de type « contient » où la chaîne que vous saisissez recherchera le code contenant votre terme de recherche dans n'importe quelle ligne.

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"

Exemple de sortie```

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

Timestamp: 1/14/2022 8:34:14 PM

[>] URL: https://gitlab.hogwarts.local/adumbledore/secret-spells/stuff.txt |_ API_KEY=abc123

Total number of items matching code search: 1

root@kitploit:~
### Recherche de fichiers

#### Cas d'utilisation

> *Rechercher des fichiers dans les dépôts contenant un mot-clé donné dans le nom de fichier dans un système SCM particulier*

#### Syntaxe

Fournissez le module `searchfile` et vos critères de recherche dans le commutateur de ligne de commande `-o`, ainsi que les informations d'authentification et l'URL pertinentes. Cela affichera l'URL du fichier correspondant dans son dépôt respectif.

##### GitHub Enterprise

La recherche de fichiers GitLab est une recherche de type "contient" : la chaîne que vous saisissez recherchera les fichiers dont le nom de fichier contient votre terme de recherche.

`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

La recherche de fichiers GitLab est une recherche de type "contient" : la chaîne que vous saisissez recherchera les fichiers dont le nom de fichier contient votre terme de recherche.

`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

La recherche de fichiers Bitbucket est une recherche de type "contient" : la chaîne que vous saisissez recherchera les fichiers dont le nom de fichier contient votre terme de recherche.

`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"`

#### Exemple de sortie```

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

Lister les snippets

Cas d'utilisation

Lister les snippets appartenant à l'utilisateur actuel dans GitLab

Syntaxe

Fournissez le module listsnippet, ainsi que les informations d'authentification et l'URL pertinentes.

GitLab Enterprise

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

Exemple de sortie```

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

Timestamp: 1/14/2022 9:17:36 PM

root@kitploit:~
           Title |                                                                Raw URL

root@kitploit:~
    spell-script |                         https://gitlab.hogwarts.local/-/snippets/2/raw
root@kitploit:~
### Lister les runners

#### Cas d'utilisation

> *Lister tous les runners GitLab disponibles pour l'utilisateur actuel dans GitLab*

#### Syntaxe

Fournissez le module `listrunner`, ainsi que toute information d'authentification pertinente et l'URL. Si l'utilisateur est un administrateur, vous pourrez lister tous les runners de l'instance GitLab Enterprise, y compris les runners partagés et ceux de groupe.

##### 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`

#### Exemple de sortie```

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
    

Lister les gists

Cas d'utilisation

Lister les gists appartenant à l'utilisateur actuel sur GitHub

Syntaxe

Fournissez le module listgist, ainsi que toute information d'authentification et URL pertinentes.

GitHub Enterprise

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

Exemple de sortie```

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

Timestamp: 1/14/2022 9:43:23 PM

root@kitploit:~
                         Description | Visibility |                                                URL

root@kitploit:~
        Shell Script to Decode Spell |     public | https://github-enterprise.hogwarts.local/gist/c11c6bb3f47fe67183d5bc9f048412a1
        
root@kitploit:~
### Lister les organisations

#### Cas d'utilisation

> *Lister toutes les organisations auxquelles l'utilisateur actuel appartient sur GitHub*

#### Syntaxe

Fournissez le module `listorg`, ainsi que toutes les informations d'authentification et l'URL pertinentes.

##### 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`

#### Exemple de sortie```

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
                      

Obtenir les privilèges d'un jeton API

Cas d'utilisation

Obtenir les privilèges attribués à un jeton d'accès utilisé dans un système SCM particulier

Syntaxe

Fournissez le module privs, avec une clé API et une URL.

GitHub Enterprise

SCMKit.exe -s github -m privs -c apiKey -u https://github.something.local

GitLab Enterprise

SCMKit.exe -s gitlab -m privs -c apiKey -u https://gitlab.something.local

Exemple de sortie```

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

Timestamp: 1/14/2022 9:18:27 PM

root@kitploit:~
      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.

root@kitploit:~
### Ajouter un administrateur

#### Cas d'utilisation

> *Promouvoir un utilisateur normal à un rôle d'administrateur dans un système SCM particulier*

#### Syntaxe

Fournissez le module `addadmin`, ainsi que les informations d'authentification pertinentes et l'URL. De plus, fournissez l'utilisateur cible auquel vous souhaitez ajouter un rôle administratif.

##### 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

Seule l'authentification par nom d'utilisateur/mot de passe est prise en charge pour effectuer des actions non liées aux dépôts ou aux projets dans Bitbucket.

`SCMKit.exe -s bitbucket -m addadmin -c userName:password -u https://bitbucket.something.local -o targetUserName`

#### Exemple de sortie```

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.

Supprimer l'administrateur

Cas d'utilisation

Rétrograder un utilisateur administratif à un rôle d'utilisateur normal dans un système SCM particulier

Syntaxe

Fournissez le module removeadmin, ainsi que les informations d'authentification et l'URL pertinentes. En outre, fournissez l'utilisateur cible dont vous souhaitez supprimer le rôle administratif.

GitHub Enterprise

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

GitLab Enterprise

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 Server

Seule l'authentification par nom d'utilisateur/mot de passe est prise en charge pour effectuer des actions non liées aux dépôts ou aux projets dans Bitbucket.

SCMKit.exe -s bitbucket -m removeadmin -c userName:password -u https://bitbucket.something.local -o targetUserName

Exemple de sortie```

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

Timestamp: 1/14/2022 9:20:12 PM

[+] SUCCESS: The hgranger user was successfully removed from the admin role.

root@kitploit:~
### Créer un jeton d'accès

#### Cas d'utilisation

> *Créer un jeton d'accès à utiliser dans un système SCM particulier*

#### Syntaxe

Fournissez le module `createpat`, ainsi que toute information d'authentification et URL pertinentes. En outre, fournissez l'utilisateur cible pour lequel vous souhaitez créer un jeton d'accès.

##### GitLab Enterprise

Cette opération ne peut être effectuée qu'en tant qu'administrateur. Vous fournirez le nom d'utilisateur pour lequel vous souhaitez créer un 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

Crée un PAT pour l'utilisateur actuellement authentifié. Dans Bitbucket, vous ne pouvez pas créer un PAT pour un autre utilisateur, même en tant qu'administrateur. Seule l'authentification par nom d'utilisateur/mot de passe est prise en charge pour effectuer des actions non liées aux dépôts ou aux projets dans Bitbucket. Notez l'identifiant PAT affiché après la création. Vous en aurez besoin lorsqu'il vous faudra supprimer le PAT à l'avenir.

`SCMKit.exe -s bitbucket -m createpat -c userName:password -u https://bitbucket.something.local `

#### Exemple de sortie```

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.


Lister les jetons d'accès

Cas d'utilisation

Répertorier les jetons d'accès pour un utilisateur sur un système SCM particulier

Syntaxe

Fournissez le module listpat, ainsi que toute information d'authentification pertinente et l'URL.

GitLab Enterprise

Nécessite uniquement les droits d'administrateur si vous souhaitez lister les PAT d'un autre utilisateur. Un utilisateur régulier peut lister ses propres 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 Server

Répertorie les jetons d'accès pour l'utilisateur actuel. Seule l'authentification par nom d'utilisateur/mot de passe est prise en charge pour effectuer des actions non liées aux dépôts ou aux projets dans Bitbucket.

SCMKit.exe -s bitbucket -m listpat -c userName:password -u https://bitbucket.something.local

Répertorie les jetons d'accès pour un autre utilisateur (nécessite les droits d'administrateur). Seule l'authentification par nom d'utilisateur/mot de passe est prise en charge pour effectuer des actions non liées aux dépôts ou aux projets dans Bitbucket.

SCMKit.exe -s bitbucket -m listpat -c userName:password -u https://bitbucket.something.local -o targetUser

Exemple de sortie```

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

Timestamp: 1/20/2022 1:54:41 PM

ID | Name | Active? | Scopes

59 | SCMKIT-AaCND | True | api, read_repository, write_repository

root@kitploit:~
### Supprimer le jeton d'accès

#### Cas d'utilisation

> *Supprimer un jeton d'accès pour un utilisateur dans un système SCM particulier*

#### Syntaxe

Fournissez le module `removepat`, ainsi que les informations d'authentification et l'URL pertinentes. En outre, fournissez l'ID PAT de l'utilisateur cible pour lequel vous souhaitez supprimer un jeton d'accès.

##### GitLab Enterprise

Nécessite uniquement les droits d'administration si vous souhaitez supprimer le PAT d'un autre utilisateur. Un utilisateur standard peut supprimer son propre PAT. Vous devez fournir l'ID du PAT à supprimer. Cet ID était affiché lors de la création du PAT ainsi que lors de la liste des 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

Seule l'authentification par nom d'utilisateur/mot de passe est prise en charge pour effectuer des actions non liées aux dépôts ou aux projets dans Bitbucket. Vous devez fournir l'ID du PAT à supprimer. Cet ID était affiché lors de la création du PAT.

`SCMKit.exe -s bitbucket -m removepat -c userName:password -u https://bitbucket.something.local -o patID`

#### Exemple de sortie```

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.

Créer une clé SSH

Cas d'utilisation

Créer une clé SSH à utiliser dans un système SCM particulier

Syntaxe

Fournissez le module createsshkey, ainsi que toutes les informations d'authentification et l'URL pertinentes.

GitHub Enterprise

Crée une clé SSH pour l'utilisateur actuel qui s'authentifie.

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

Crée une clé SSH pour l'utilisateur actuel qui s'authentifie. Notez l'ID de la clé SSH affiché après sa création. Vous en aurez besoin lorsque vous devrez supprimer la clé SSH à l'avenir.

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

Crée une clé SSH pour l'utilisateur actuel qui s'authentifie. Seule l'authentification par nom d'utilisateur/mot de passe est prise en charge pour effectuer des actions non liées aux dépôts ou aux projets dans Bitbucket. Notez l'ID de la clé SSH affiché après sa création. Vous en aurez besoin lorsque vous devrez supprimer la clé SSH à l'avenir.

SCMKit.exe -s bitbucket -m createsshkey -c userName:password -u https://bitbucket.something.local -o "ssh public key"

Exemple de sortie```

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

root@kitploit:~
      16

[+] SUCCESS: The hpotter user SSH key was successfully added.

root@kitploit:~
### Lister les clés SSH

#### Cas d'utilisation

> *Lister les clés SSH d'un utilisateur sur un système SCM particulier.*

#### Syntaxe

Fournissez le module `listsshkey`, ainsi que toutes les informations d'authentification pertinentes et l'URL. 

##### GitHub Enterprise

Liste les clés SSH de l'utilisateur actuel. Cela inclura les identifiants des clés SSH, qui sont nécessaires si vous souhaitez supprimer une clé 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

Liste les clés SSH de l'utilisateur actuel.

`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

Liste les clés SSH de l'utilisateur actuel. Seule l'authentification par nom d'utilisateur/mot de passe est prise en charge pour effectuer des actions non liées aux dépôts ou aux projets dans Bitbucket.

`SCMKit.exe -s bitbucket -m listsshkey -c userName:password -u https://bitbucket.something.local`


#### Exemple de sortie```

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
    

Supprimer une clé SSH

Cas d'utilisation

Supprimer une clé SSH pour un utilisateur dans un système SCM particulier

Syntaxe

Fournissez le module removesshkey, ainsi que toutes les informations d'authentification pertinentes et l'URL. De plus, fournissez l'ID de la clé SSH de l'utilisateur cible à supprimer.

GitHub Enterprise

Vous devez fournir l'ID de la clé SSH à supprimer. Cet ID est affiché lorsque vous listez les clés 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

Vous devez fournir l'ID de la clé SSH à supprimer. Cet ID est affiché lorsque vous créez la clé SSH et également lorsque vous listez les clés 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

Seule l'authentification par nom d'utilisateur/mot de passe est prise en charge pour effectuer des actions non liées aux dépôts ou aux projets dans Bitbucket. Vous devez fournir l'ID de la clé SSH à supprimer. Cet ID est affiché lorsque vous créez la clé SSH et également lorsque vous listez les clés SSH.

SCMKit.exe -s bitbucket -m removesshkey -c userName:password -u https://bitbucket.something.local -o sshKeyID

Exemple de sortie```

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.

root@kitploit:~
### List Admin Stats

#### Use Case

> *Lister les statistiques d'administration dans GitHub Enterprise*

#### Syntaxe

Fournissez le module `adminstats`, ainsi que les informations d'authentification et l'URL pertinentes. Un accès administrateur de site dans GitHub Enterprise est requis pour utiliser ce module.

##### 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`

#### Exemple de sortie```

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
               

Lister les protections de branche

Cas d'utilisation

Lister les protections de branche dans GitHub Enterprise

Syntaxe

Fournissez le module protection, ainsi que les informations d'authentification et l'URL pertinentes. Vous pouvez éventuellement fournir une chaîne dans le paramètre options pour renvoyer les résultats correspondants contenus dans les noms de dépôts.

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

Exemple de sortie```

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

root@kitploit:~
                 Repo |                    Branch |                                         Protection

root@kitploit:~
          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
root@kitploit:~
## Détection

Vous trouverez ci-dessous des signatures statiques pour l'utilisation spécifique de cet outil dans son état par défaut :

* GUID du projet - `{266C644A-69B1-426B-A47C-1CF32B211F80}`
  * Voir [règle Yara SCMKit](https://github.com/xforcered/scmkit/blob/main/Detections/SCMKit.yar) dans ce dépôt.
* Chaîne User-Agent - `SCMKIT-5dc493ada400c79dd318abbe770dac7c`
  * Voir [règle Snort SCMKit](https://github.com/xforcered/scmkit/blob/main/Detections/SCMKit.rules) dans ce dépôt.
* Noms des jetons d'accès et des clés SSH - Les jetons d'accès et les clés SSH créés à l'aide de l'outil sont préfixés par `SCMKIT-` pour le nom.

Pour des conseils de détection des techniques utilisées par l'outil, consultez le [billet de blog](https://securityintelligence.com/posts/abusing-source-code-management-systems) de X-Force Red.

## Références
* Documentation de l'API Bitbucket 
  * https://developer.atlassian.com/server/bitbucket/reference/rest-api/
* Documentation Octokit
  * https://octokitnet.readthedocs.io/en/latest/
  * https://github.com/octokit/octokit.net
* Documentation de l'API GitHub
  * https://docs.github.com/en/rest/overview
* Documentation de l'API GitLab
  * https://docs.gitlab.com/ee/api/api_resources.html
* Documentation du package Nuget GitLabApiClient
  * https://github.com/nmklotas/GitLabApiClient
Télécharger l’outil
BibliothèqueURLLicence
Octokithttps://github.com/octokit/octokit.netLicence MIT
Fodyhttps://github.com/Fody/FodyLicence MIT
GitLabApiClienthttps://github.com/nmklotas/GitLabApiClientLicence MIT
Newtonsoft.Jsonhttps://github.com/JamesNK/Newtonsoft.JsonLicence MIT
Scénario d'attaqueModuleNécessite un administrateur ?GitHub EnterpriseGitLab EnterpriseBitbucket Server
ReconnaissancelistrepoNonXXX
ReconnaissancesearchrepoNonXXX
ReconnaissancesearchcodeNonXXX
ReconnaissancesearchfileNonXXX
ReconnaissancelistsnippetNonX
ReconnaissancelistrunnerNonX
ReconnaissancelistgistNonX
ReconnaissancelistorgNonX
ReconnaissanceprivsNonXX
ReconnaissanceprotectionNonX
PersistancelistsshkeyNonXXX
PersistanceremovesshkeyNonXXX
PersistancecreatesshkeyNonXXX
PersistancelistpatNonXX
PersistanceremovepatNonXX
PersistancecreatepatOui (GitLab Enterprise uniquement)XX
Élévation de privilègesaddadminOuiXXX
Élévation de privilègesremoveadminOuiXXX
ReconnaissanceadminstatsOuiX