Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
SCMKit — 소스 코드 관리 공격 툴킷 | Kitploit
도구/GitHubGitHub/h4wkst3r/scmkit
Privilege EscalationReconnaissancePersistence MechanismsPenetration TestingRed Teaming
GitHubh4wkst3r/scmkit

SCMKit

소스 코드 관리 공격 툴킷

저장소 보기
229543년 전Kitploit 검토 완료

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

SCMKit

Description

소스 코드 관리 공격 툴킷 - SCMKit는 SCM 시스템을 공격하는 데 사용할 수 있는 툴킷입니다. SCMKit를 사용하면 사용자는 사용할 SCM 시스템과 공격 모듈을 지정하고, 해당 SCM 시스템에 대한 유효한 자격 증명(사용자 이름/비밀번호 또는 API 키)을 지정할 수 있습니다. 현재 SCMKit가 지원하는 SCM 시스템은 GitHub Enterprise, GitLab Enterprise 및 Bitbucket Server입니다. 지원되는 공격 모듈에는 정찰, 권한 상승 및 지속성이 포함됩니다. SCMKit는 모듈식 접근 방식으로 구축되어, 미래에 정보 보안 커뮤니티에서 새로운 모듈과 SCM 시스템을 추가할 수 있습니다.

Release

  • SCMKit 버전 1.2는 릴리스에서 확인할 수 있습니다.

Table of Contents

  • SCMKit
  • Table of Contents
  • Installation/Building
    • Libraries Used
    • Pre-Compiled
    • Building Yourself
  • Usage
    • Arguments/Options
    • Systems
    • Modules
    • Module Details Table
  • Examples
    • List Repos
    • Search Repos
    • Search Code
    • Search Files
    • List Snippets
    • List Runners
    • List Gists
    • List Orgs
    • Get Privileges of API Key
    • Add Admin
    • Remove Admin
    • Create Access Token
    • List Access Tokens
    • Remove Access Token
    • Create SSH Key
    • List SSH Keys
    • Remove SSH Key
    • List Admin Stats
    • List Branch Protection
  • Detection
  • References

Installation/Building

Libraries Used

이 프로젝트에서는 다음과 같은 타사 라이브러리가 사용됩니다.

Pre-Compiled

  • 릴리스의 미리 컴파일된 바이너리를 사용하세요.

Building Yourself

프로젝트를 직접 컴파일하려면 아래 단계에 따라 Visual Studio를 설정하세요. 이 작업은 NuGet 패키지 관리자에서 설치할 수 있는 .NET 라이브러리가 필요합니다.

  • Load the Visual Studio project up and go to "Tools" --> "NuGet Package Manager" --> "Package Manager Settings"
  • Go to "NuGet Package Manager" --> "Package Sources"
  • Add a package source with the URL https://api.nuget.org/v3/index.json
  • 아래 NuGet 패키지를 설치하세요.
    • Install-Package Costura.Fody -Version 3.3.3
    • Install-Package Octokit
    • Install-Package GitLabApiClient
    • Install-Package Newtonsoft.Json
  • 이제 프로젝트를 직접 빌드할 수 있습니다!

Usage

Arguments/Options

  • -c, -credential - 인증을 위한 자격 증명 (사용자 이름:비밀번호 또는 apiKey)
  • -s, -system - 공격할 시스템 (github,gitlab,bitbucket)
  • -u, -url - GitHub Enterprise, GitLab Enterprise 또는 Bitbucket Server의 URL
  • -m, -module - 실행할 모듈
  • -o, -option - 옵션 (해당되는 경우)

Systems (-s, -system)

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

Modules (-m, -module)

  • listrepo: 현재 사용자가 볼 수 있는 모든 리포지토리 나열
  • searchrepo: 주어진 리포지토리 검색
  • searchcode: 키워드 검색어가 포함된 코드 검색
  • searchfile: 키워드 검색어가 포함된 파일 이름 검색
  • listsnippet: 현재 사용자의 모든 스니펫 나열
  • listrunner: 현재 사용자가 사용할 수 있는 모든 GitLab 러너 나열
  • listgist: 현재 사용자의 모든 Gist 나열
  • listorg: 현재 사용자가 속한 모든 조직 나열
  • privs: 현재 API 토큰의 권한 가져오기
  • addadmin: 지정된 사용자를 관리자 역할로 승격
  • removeadmin: 지정된 사용자를 관리자 역할에서 강등
  • createpat: 대상 사용자에 대한 개인 액세스 토큰 생성
  • listpat: 대상 사용자에 대한 개인 액세스 토큰 나열
  • removepat: 대상 사용자에 대한 개인 액세스 토큰 제거
  • createsshkey: 현재 사용자에 대한 SSH 키 생성
  • listsshkey: 현재 사용자에 대한 SSH 키 나열
  • removesshkey: 현재 사용자에 대한 SSH 키 제거
  • adminstats: 관리자 통계(사용자, 리포지토리, 조직, Gist)
  • protection: 브랜치 보호 설정 가져오기

Module Details Table

아래 표는 각 모듈이 지원되는 위치를 보여줍니다.

Examples

List Repos

Use Case

특정 SCM 시스템에서 사용 중인 리포지토리 발견

Syntax

listrepo 모듈을 관련 인증 정보 및 URL과 함께 제공하세요. 그러면 리포지토리 이름과 URL이 출력됩니다.

GitHub Enterprise

사용자가 볼 수 있는 모든 리포지토리를 나열합니다.

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

사용자가 볼 수 있는 모든 리포지토리를 나열합니다.

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

사용자가 볼 수 있는 모든 리포지토리를 나열합니다.

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

Example Output```

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:~
### 저장소 검색

#### 사용 사례

> *특정 SCM 시스템에서 저장소 이름으로 저장소를 검색합니다*

#### 구문

`-o` 명령줄 스위치에 `searchrepo` 모듈과 검색 조건을 제공하고, 관련 인증 정보 및 URL을 함께 입력합니다. 그러면 일치하는 저장소 이름과 URL이 출력됩니다.

##### GitHub Enterprise

GitHub 저장소 검색은 "포함" 검색으로, 입력한 문자열이 저장소 이름에 포함된 저장소를 검색합니다.

`SCMKit.exe -s github -m searchrepo -c userName:password -u https://github.something.local -o "some search term"`

`SCMKit.exe -s github -m searchrepo -c apikey -u https://github.something.local -o "some search term"`

##### GitLab Enterprise

GitLab 저장소 검색은 "포함" 검색으로, 입력한 문자열이 저장소 이름에 포함된 저장소를 검색합니다.

`SCMKit.exe -s gitlab -m searchrepo -c userName:password -u https://gitlab.something.local -o "some search term"`

`SCMKit.exe -s gitlab -m searchrepo -c apikey -u https://gitlab.something.local -o "some search term"`

##### Bitbucket Server

Bitbucket 저장소 검색은 "시작" 검색으로, 입력한 문자열로 시작하는 이름의 저장소를 검색합니다.

`SCMKit.exe -s bitbucket -m searchrepo -c userName:password -u https://bitbucket.something.local -o "some search term"`

`SCMKit.exe -s bitbucket -m searchrepo -c apikey -u https://bitbucket.something.local -o "some search term"`

#### 예제 출력

Searching for internal...```

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

root@kitploit:~
                                Name | Visibility |                                                URL

root@kitploit:~
                           Spellbook |   Internal |    https://gitlab.hogwarts.local/hpotter/spellbook
                       Secret-Spells |   Internal | https://gitlab.hogwarts.local/adumbledore/secret-spells
root@kitploit:~
### 코드 검색

#### 사용 사례

> *특정 SCM 시스템에서 주어진 키워드가 포함된 코드를 검색합니다*

#### 구문

`-o` 명령줄 스위치에 `searchcode` 모듈과 검색 기준을 제공하고, 관련 인증 정보 및 URL을 함께 입력합니다. 그러면 일치하는 코드 파일의 URL과 일치하는 코드 줄이 출력됩니다.

##### GitHub Enterprise

GitHub 코드 검색은 "포함" 검색으로, 입력한 문자열이 코드 어느 줄에든 포함된 코드를 검색합니다.

`SCMKit.exe -s github -m searchcode -c userName:password -u https://github.something.local -o "some search term"`

`SCMKit.exe -s github -m searchcode -c apikey -u https://github.something.local -o "some search term"`

##### GitLab Enterprise

GitLab 코드 검색은 "포함" 검색으로, 입력한 문자열이 코드 어느 줄에든 포함된 코드를 검색합니다.

`SCMKit.exe -s gitlab -m searchcode -c userName:password -u https://gitlab.something.local -o "some search term"`

`SCMKit.exe -s gitlab -m searchcode -c apikey -u https://gitlab.something.local -o "some search term"`

##### Bitbucket Server

Bitbucket 코드 검색은 "포함" 검색으로, 입력한 문자열이 코드 어느 줄에든 포함된 코드를 검색합니다.

`SCMKit.exe -s bitbucket -m searchcode -c userName:password -u https://bitbucket.something.local -o "some search term"`

`SCMKit.exe -s bitbucket -m searchcode -c apikey -u https://bitbucket.something.local -o "some search term"`

#### 예시 출력```

C:\>SCMKit.exe -s gitlab -m searchcode -c username:password -u https://gitlab.hogwarts.local -o "api_key"

==================================================
Module:         searchcode
System:         gitlab
Auth Type:      Username/Password
Options:        api_key
Target URL:     https://gitlab.hogwarts.local

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

파일 검색

사용 사례

특정 SCM 시스템의 저장소에서 파일 이름에 특정 키워드가 포함된 파일을 검색합니다

구문

searchfile 모듈과 검색 조건을 -o 명령줄 스위치에 제공하고, 관련 인증 정보와 URL을 함께 입력합니다. 이렇게 하면 일치하는 파일의 URL을 해당 저장소에서 출력합니다.

GitHub Enterprise

GitLab 파일 검색은 "포함(contains)" 검색으로, 입력한 문자열을 파일 이름에 포함하는 파일을 검색합니다.

SCMKit.exe -s github -m searchfile -c userName:password -u https://github.something.local -o "some search term"

SCMKit.exe -s github -m searchfile -c apikey -u https://github.something.local -o "some search term"

GitLab Enterprise

GitLab 파일 검색은 "포함(contains)" 검색으로, 입력한 문자열을 파일 이름에 포함하는 파일을 검색합니다.

SCMKit.exe -s gitlab -m searchfile -c userName:password -u https://gitlab.something.local -o "some search term"

SCMKit.exe -s gitlab -m searchfile -c apikey -u https://gitlab.something.local -o "some search term"

Bitbucket Server

Bitbucket 파일 검색은 "포함(contains)" 검색으로, 입력한 문자열을 파일 이름에 포함하는 파일을 검색합니다.

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

root@kitploit:~
### 스니펫 목록

#### 사용 사례

> *GitLab에서 현재 사용자가 소유한 스니펫을 나열합니다*

#### 구문

`listsnippet` 모듈과 관련 인증 정보 및 URL을 제공합니다.

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

#### 예제 출력```

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

               Title |                                                                Raw URL
---------------------------------------------------------------------------------------------
        spell-script |                         https://gitlab.hogwarts.local/-/snippets/2/raw

List Runners

사용 사례

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

root@kitploit:~
2 |        gitlab-runner | https://gitlab.hogwarts.local/hpotter/spellbook.git
3 |        gitlab-runner | https://gitlab.hogwarts.local/hpotter/maraudersmap.git
root@kitploit:~
### Gist 목록

#### 사용 사례

> *현재 사용자가 GitHub에서 소유한 Gist 목록*

#### 구문

`listgist` 모듈과 관련 인증 정보 및 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`

#### 예제 출력```

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

                             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

root@kitploit:~
                      Name |                                                URL

root@kitploit:~
                  Hogwarts | https://github-enterprise.hogwarts.local/api/v3/orgs/Hogwarts/repos
                  
root@kitploit:~
### API Token의 권한 가져오기

#### 사용 사례

> *특정 SCM 시스템에서 사용 중인 액세스 토큰에 할당된 권한을 가져옵니다.*

#### 구문

`privs` 모듈과 API 키 및 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`

#### 예제 출력

[](https://github.com/h4wkst3r/scmkit/blob/HEAD/images/placeholder.png)```

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

          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

예시 출력

명령출력
SCMKit.exe -s github -m addadmin -c apikey -u https://github.something.com -o target예시 출력
SCMKit.exe -s github -m addproject -c apikey -u https://github.something.com -o project_name예시 출력

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.

root@kitploit:~
### Remove Admin

#### 사용 사례

> *특정 SCM 시스템에서 관리 사용자를 일반 사용자 역할로 강등*

#### 구문

`removeadmin` 모듈을 해당 인증 정보 및 URL과 함께 제공합니다. 또한 관리자 역할을 제거하려는 대상 사용자를 제공합니다.

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

Bitbucket에서 저장소나 프로젝트와 관련되지 않은 작업을 수행하려면 사용자 이름/비밀번호 인증만 지원됩니다.

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

#### 출력 예시```

C:\>SCMKit.exe -s gitlab -m removeadmin -c username:password -u https://gitlab.hogwarts.local -o hgranger

==================================================
Module:         removeadmin
System:         gitlab
Auth Type:      Username/Password
Options:        hgranger
Target URL:     https://gitlab.hogwarts.local

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


[+] 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.

root@kitploit:~
### 액세스 토큰 목록

#### 사용 사례

> *특정 SCM 시스템에서 사용자의 액세스 토큰을 나열합니다*

#### 구문

`listpat` 모듈과 관련 인증 정보 및 URL을 제공합니다.

##### GitLab Enterprise

다른 사용자의 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 Server

현재 사용자의 액세스 토큰을 나열합니다. 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

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

   ID |                 Name |    Active? |                                             Scopes
----------------------------------------------------------------------------------------------
   59 |         SCMKIT-AaCND |       True |             api, read_repository, write_repository
    

액세스 토큰 제거

사용 사례

특정 SCM 시스템에서 사용자의 액세스 토큰 제거

구문

removepat 모듈과 함께 필요한 인증 정보 및 URL을 제공합니다. 또한 액세스 토큰을 제거하려는 대상 사용자의 PAT ID를 제공합니다.

GitLab Enterprise

다른 사용자의 PAT를 제거하려는 경우에만 관리자 권한이 필요합니다. 일반 사용자는 자신의 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

Bitbucket에서 저장소나 프로젝트와 관련되지 않은 작업을 수행하려면 사용자 이름/비밀번호 인증만 지원됩니다. 제거할 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.

root@kitploit:~
### SSH 키 생성

#### 사용 사례

> *특정 SCM 시스템에서 사용할 SSH 키 생성*

#### 구문

`createsshkey` 모듈과 관련 인증 정보 및 URL을 제공합니다.

##### GitHub Enterprise

인증 중인 현재 사용자에 대한 SSH 키를 생성합니다.

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

`SCMKit.exe -s github -m createsshkey -c apiToken -u https://github.something.local -o "ssh public key"`

##### GitLab Enterprise

인증 중인 현재 사용자에 대한 SSH 키를 생성합니다. 생성 후 표시되는 SSH 키 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"`

##### Bitbucket Server

인증 중인 현재 사용자에 대한 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

Timestamp:      2/7/2022 1:02:31 PM
==================================================

  SSH Key ID
------------
          16

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


SSH 키 목록 보기

사용 사례

특정 SCM 시스템에서 사용자의 SSH 키를 나열합니다

구문

listsshkey 모듈과 함께 관련 인증 정보 및 URL을 제공합니다.

GitHub Enterprise

현재 사용자의 SSH 키를 나열합니다. 여기에는 SSH 키 ID가 포함되며, 이는 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

예시 출력

Example output

An example of listing SSH keys for the current user. SSHKey ID : 1 SSHKey Type : deployment_key ...```

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

root@kitploit:~
       9 | .....p50edigBAF4lipVZkAM= |         SCMKIT-RLzie
      10 | .....vGJLPGHiTwIxW9i+xAs= |         SCMKIT-muFGU
root@kitploit:~
### SSH 키 제거

#### 사용 사례

> *특정 SCM 시스템에서 사용자의 SSH 키를 제거합니다*

#### 구문

`removesshkey` 모듈과 관련 인증 정보 및 URL을 제공합니다. 또한 제거할 대상 사용자의 SSH 키 ID를 제공합니다.

##### GitHub Enterprise

제거할 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`

##### GitLab Enterprise

 제거할 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`

##### Bitbucket Server

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

Timestamp:      2/7/2022 1:48:03 PM
==================================================


[+] SUCCESS: The SSH key of ID 16 was successfully revoked.

Admin 통계 나열

사용 사례

GitHub Enterprise에서 Admin 통계 나열

구문

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

root@kitploit:~
 Admin Users |  Suspended Users |      Total Users

root@kitploit:~
           1 |                0 |                5


 Total Repos |      Total Wikis

root@kitploit:~
           4 |                0


  Total Orgs |   Total Team Members |      Total Teams

root@kitploit:~
           1 |                    0 |                0

Private Gists | Public Gists

root@kitploit:~
           0 |                1
           
root@kitploit:~
### 브랜치 보호 목록

#### 사용 사례

> *GitHub Enterprise에서 브랜치 보호 나열*

#### 구문

`protection` 모듈과 관련 인증 정보 및 URL을 제공하세요. 선택적으로, 옵션 매개변수에 문자열을 제공하면 저장소 이름에 포함된 일치하는 결과를 반환합니다.

##### GitHub Enterprise

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

`SCMKit.exe -s github -m protection -c apikey -u https://github.something.local`

`SCMKit.exe -s github -m protection -c apikey -u https://github.something.local -o reponame`

#### 예제 출력```
C:\>.\SCMKit.exe -u http://github.hogwarts.local -s github -c apiToken -m protection -o public-r

==================================================
Module:         protection
System:         github
Auth Type:      API Key
Options:        public-r
Target URL:     http://github.hogwarts.local

Timestamp:      8/29/2022 2:02:42 PM
==================================================

                     Repo |                    Branch |                                         Protection
----------------------------------------------------------------------------------------------------------
              public-repo |                       dev | Protected: True
                                                        Status checks must pass before merge:
                                                          Branch must be up-to-date before merge: True
                                                        Owner review required before merge: True
                                                        Approvals required before merge: 2
                                                        Protections apply to repo admins: True
              public-repo |                      main | Protected: False

탐지

다음은 이 도구를 기본 상태에서 사용할 때의 정적 시그니처입니다:

  • 프로젝트 GUID - {266C644A-69B1-426B-A47C-1CF32B211F80}
    • 이 저장소의 SCMKit Yara 규칙을 참조하세요.
  • 사용자 에이전트 문자열 - SCMKIT-5dc493ada400c79dd318abbe770dac7c
    • 이 저장소의 SCMKit Snort 규칙을 참조하세요.
  • 액세스 토큰 및 SSH 키 이름 - 이 도구를 사용하여 생성된 액세스 토큰과 SSH 키의 이름 앞에는 SCMKIT-가 붙습니다.

도구에서 사용하는 기술에 대한 탐지 지침은 X-Force Red 블로그 게시물을 참조하세요.

참고 자료

  • Bitbucket API Documentation
    • https://developer.atlassian.com/server/bitbucket/reference/rest-api/
  • Octokit Documentation
    • https://octokitnet.readthedocs.io/en/latest/
    • https://github.com/octokit/octokit.net
  • GitHub API Documentation
    • https://docs.github.com/en/rest/overview
  • GitLab API Documentation
    • https://docs.gitlab.com/ee/api/api_resources.html
  • GitLabApiClient Nuget 패키지 문서
    • https://github.com/nmklotas/GitLabApiClient
도구 다운로드
라이브러리URL라이선스
Octokithttps://github.com/octokit/octokit.netMIT License
Fodyhttps://github.com/Fody/FodyMIT License
GitLabApiClienthttps://github.com/nmklotas/GitLabApiClientMIT License
Newtonsoft.Jsonhttps://github.com/JamesNK/Newtonsoft.JsonMIT License
Attack ScenarioModuleRequires Admin?GitHub EnterpriseGitLab EnterpriseBitbucket Server
정찰listrepo아니요XXX
정찰searchrepo아니요XXX
정찰searchcode아니요XXX
정찰searchfile아니요XXX
정찰listsnippet아니요X
정찰listrunner아니요X
정찰listgist아니요X
정찰listorg아니요X
정찰privs아니요XX
정찰protection아니요X
지속성listsshkey아니요XXX
지속성removesshkey아니요XXX
지속성createsshkey아니요XXX
지속성listpat아니요XX
지속성removepat아니요XX
지속성createpat예 (GitLab Enterprise 전용)XX
권한 상승addadmin예XXX
권한 상승removeadmin예XXX
정찰adminstats예X