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 — Kit d'attaque pour la gestion de code source | Kitploit
Outils/GitHubGitHub/h4wkst3r/scmkit
Escalade de PrivilègesReconnaissanceMécanismes de PersistanceTests d'IntrusionRed Teaming
GitHubh4wkst3r/scmkit

SCMKit

Kit d'attaque pour la gestion de code source

Voir le dépôt
22954il 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 des identifiants valides (nom d'utilisateur/mot de passe ou clé API) pour le système SCM correspondant. 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é informatique.

Version

  • La version 1.2 de SCMKit est disponible dans la section Releases

Table des matières

  • SCMKit
  • Table des matières
  • Installation/Compilation
    • Bibliothèques utilisées
    • Pré-compilé
    • Compilation manuelle
  • Utilisation
    • Arguments/Options
    • Systèmes
    • Modules
    • Tableau des détails des modules
  • Exemples
    • Liste des dépôts
    • Recherche de dépôts
    • Recherche de code
    • Recherche de fichiers
    • Liste des snippets
    • Liste des runners
    • Liste des gists
    • Liste des organisations
    • Obtenir les privilèges d'une clé API
    • Ajouter un administrateur
    • Supprimer un administrateur
    • Créer un jeton d'accès
    • Liste des jetons d'accès
    • Supprimer un jeton d'accès
    • Créer une clé SSH
    • Liste des clés SSH
    • Supprimer une clé SSH
    • Statistiques administrateur
    • 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 la section Releases

Compilation manuelle

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

  • Ouvrez le projet Visual Studio, allez dans "Tools" --> "NuGet Package Manager" --> "Package Manager Settings"
  • Allez dans "NuGet Package Manager" --> "Package Sources"
  • Ajoutez une source de paquets avec l'URL https://api.nuget.org/v3/index.json
  • Installez les paquets 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 - identifiant 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 actuel peut voir
  • searchrepo: rechercher un dépôt donné
  • searchcode: rechercher du code contenant un terme de recherche
  • searchfile: rechercher un nom de fichier contenant un terme de recherche
  • listsnippet: lister tous les snippets de l'utilisateur actuel
  • listrunner: lister tous les runners GitLab disponibles pour l'utilisateur actuel
  • listgist: lister tous les gists de l'utilisateur actuel
  • listorg: lister toutes les organisations auxquelles l'utilisateur actuel appartient
  • privs: obtenir les privilèges du jeton API actuel
  • addadmin: promouvoir un utilisateur donné au rôle d'administrateur
  • removeadmin: rétrograder un utilisateur donné du rôle d'administrateur
  • createpat: créer un jeton d'accès personnel pour un utilisateur cible
  • listpat: lister les jetons d'accès personnels pour un utilisateur cible
  • removepat: supprimer un jeton d'accès personnel pour un utilisateur cible
  • createsshkey: créer une clé SSH pour l'utilisateur actuel
  • listsshkey: lister les clés SSH pour l'utilisateur actuel
  • removesshkey: supprimer une clé SSH pour l'utilisateur actuel
  • adminstats: obtenir les statistiques administrateur (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 les systèmes pris en charge pour chaque module

Exemples

Liste des 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:~
### Rechercher des 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 le paramètre de ligne de commande `-o`, ainsi que toutes les informations d'authentification pertinentes et l'URL. Cela renverra le nom et l'URL du dépôt correspondant.

##### GitHub Enterprise

La recherche de dépôts GitHub est une recherche de type « contient » où la chaîne que vous saisissez recherchera les dépôts dont le nom contient 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 de type « contient » où la chaîne que vous saisissez recherchera les dépôts dont le nom contient 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 de type « commence par » où la chaîne que vous saisissez recherchera les dépôts dont le nom commence 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 l'option -o de la ligne de commande, ainsi que les informations d'authentification et l'URL correspondantes. 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 « contient » où la chaîne que vous saisissez recherchera du code contenant votre terme de recherche sur 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 « contient » où la chaîne que vous saisissez recherchera du code contenant votre terme de recherche sur 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 « contient » où la chaîne que vous saisissez recherchera du code contenant votre terme de recherche sur 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:~
### Rechercher des 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 toute information d'authentification pertinente et l'URL. Cela affichera l'URL du fichier correspondant dans son dépôt respectif.

##### GitHub Enterprise

La recherche de fichiers GitLab est une recherche « contient » où la chaîne que vous saisissez recherchera les fichiers qui contiennent votre terme de recherche dans le nom de fichier.

`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 « contient » où la chaîne que vous saisissez recherchera les fichiers qui contiennent votre terme de recherche dans le nom de fichier.

`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 « contient » où la chaîne que vous saisissez recherchera les fichiers qui contiennent votre terme de recherche dans le nom de fichier.

`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 toute information d'authentification et 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

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

#### Syntaxe

Fournissez le module `listrunner`, ainsi que toutes les informations d'authentification et l'URL pertinentes. Si l'utilisateur est un administrateur, vous pourrez lister tous les runners de l'instance GitLab Enterprise, y compris les runners partagés et 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 dans GitHub

Syntaxe

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

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 dans GitHub*

#### Syntaxe

Fournissez le module `listorg`, ainsi que 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 du 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, ainsi qu'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 toute information d'authentification pertinente et l'URL. De plus, indiquez l'utilisateur cible auquel vous souhaitez ajouter un rôle d'administration.

##### 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 administrateur à 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. De plus, fournissez l'utilisateur cible dont vous souhaitez supprimer le rôle d'administrateur.

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 pertinente. De plus, fournissez l'utilisateur cible pour lequel vous souhaitez créer un jeton d'accès.

##### GitLab Enterprise

Cela ne peut être effectué que par un 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 actuel qui s'authentifie. Dans Bitbucket, vous ne pouvez pas créer de 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 projets dans Bitbucket. Notez l'ID du PAT qui s'affiche après sa création. Vous en aurez besoin lorsque vous devrez 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

Liste les jetons d'accès pour un utilisateur sur un système SCM particulier

Syntaxe

Fournissez le module listpat, ainsi que les éventuelles informations d'authentification et l'URL.

GitLab Enterprise

Nécessite seulement les droits administrateur si vous souhaitez lister les PAT d'un autre utilisateur. Un utilisateur normal 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

Liste 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 projets dans Bitbucket.

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

Liste les jetons d'accès pour un autre utilisateur (nécessite les droits 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 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. De plus, fournissez l'ID du PAT de l'utilisateur cible pour lequel vous souhaitez supprimer un jeton d'accès.

##### GitLab Enterprise

Nécessite seulement les droits d'administrateur si vous voulez supprimer le PAT d'un autre utilisateur. Un utilisateur régulier peut supprimer son propre PAT. Vous devez fournir l'ID du PAT à supprimer. Cet ID était affiché lors de la création du PAT et également 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éez une clé SSH à utiliser dans un système SCM particulier

Syntaxe

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

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. Prenez note de 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. Prenez note de 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

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

#### Syntaxe

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

##### GitHub Enterprise

Liste les clés SSH pour l'utilisateur actuel. Cela inclut les identifiants des clés SSH, 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 pour 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 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 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 spécifique

Syntaxe

Fournissez le module removesshkey, ainsi que 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é chaque fois que 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 lors de la liste des 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 lors de la liste des 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:~
### Lister les statistiques d'administration

#### Cas d'utilisation

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

#### Syntaxe

Fournissez le module `adminstats`, ainsi que toute information d'authentification et URL pertinente. L'accès administrateur du 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 résultat```

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
               

Protection des Branches Listées

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 appropriées. En option, indiquez une chaîne dans le paramètre options pour renvoyer les résultats correspondants contenus dans les noms de dépôt.

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 les 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/h4wkst3r/scmkit/blob/HEAD/Detections/SCMKit.yar) dans ce dépôt.
* Chaîne User-Agent - `SCMKIT-5dc493ada400c79dd318abbe770dac7c`
  * Voir [Règle Snort SCMKit](https://github.com/h4wkst3r/scmkit/blob/HEAD/Detections/SCMKit.rules) dans ce dépôt.
* Noms des jetons d'accès et clés SSH - Les jetons d'accès et les clés SSH créés à l'aide de l'outil sont précédés de `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 Admin ?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