gitlabrat 1.0__tar.gz → 1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gitlabrat-1.2/PKG-INFO +91 -0
- gitlabrat-1.2/README.md +66 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/cli/agents.py +1 -1
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/cli/auth.py +3 -2
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/controllers/agents.py +1 -1
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/controllers/auth.py +8 -4
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/core/agent.py +0 -3
- {gitlabrat-1.0 → gitlabrat-1.2}/pyproject.toml +3 -3
- gitlabrat-1.0/PKG-INFO +0 -72
- gitlabrat-1.0/README.md +0 -47
- {gitlabrat-1.0 → gitlabrat-1.2}/.gitignore +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/LICENSE +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/__init__.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/cli/__init__.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/cli/common.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/cli/projects.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/cli/users.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/controllers/__init__.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/controllers/projects.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/controllers/users.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/core/__init__.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/core/config.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/core/utils.py +0 -0
- {gitlabrat-1.0 → gitlabrat-1.2}/labrat/main.py +0 -0
gitlabrat-1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitlabrat
|
|
3
|
+
Version: 1.2
|
|
4
|
+
Summary: LabRat: GitLab exploitation orchestrator
|
|
5
|
+
Project-URL: Homepage, https://github.com/JChamblee99/LabRat
|
|
6
|
+
Project-URL: Repository, https://github.com/JChamblee99/LabRat.git
|
|
7
|
+
Project-URL: Issues, https://github.com/JChamblee99/LabRat/issues
|
|
8
|
+
Author-email: John Chamblee <conway.py@proton.farm>
|
|
9
|
+
License: GPL-3.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Requires-Dist: beautifulsoup4>=4.9.0
|
|
21
|
+
Requires-Dist: gitpython>=3.1.0
|
|
22
|
+
Requires-Dist: python-gitlab>=3.0.0
|
|
23
|
+
Requires-Dist: requests>=2.25.0
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
<div align="center">
|
|
27
|
+
|
|
28
|
+
# LabRat
|
|
29
|
+
|
|
30
|
+
**GitLab exploitation orchestrator.**
|
|
31
|
+
|
|
32
|
+
[](https://pypi.org/project/gitlabrat/)
|
|
33
|
+
[](https://pypi.org/project/gitlabrat/)
|
|
34
|
+
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
35
|
+
[](https://github.com/JChamblee99/LabRat/commits/main)
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Overview
|
|
42
|
+
|
|
43
|
+
LabRat automates common GitLab exploitation workflows: credential spraying, token creation, project enumeration, repository cloning, and bulk updates.
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- **Authentication** — Spray credentials or combo lists across GitLab instances with optional LDAP support
|
|
48
|
+
- **Agent management** — Track access tokens and push SSH keys across available agents
|
|
49
|
+
- **Project operations** — Enumerate, clone, create access tokens, and perform procedural updates on repositories
|
|
50
|
+
- **User enumeration** — List users with advanced filtering and create access tokens
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install gitlabrat
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
> Requires **Python 3.8+**
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Authenticate to a GitLab instance
|
|
64
|
+
labrat auth -t https://gitlab.example.com -u username -p password
|
|
65
|
+
|
|
66
|
+
# List authenticated agents
|
|
67
|
+
labrat agents ls
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
labrat [-h] {agents,auth,projects,users} ...
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Dependencies
|
|
77
|
+
|
|
78
|
+
| Package | Purpose |
|
|
79
|
+
|---------|---------|
|
|
80
|
+
| [python-gitlab](https://python-gitlab.readthedocs.io/) | GitLab API client |
|
|
81
|
+
| [GitPython](https://gitpython.readthedocs.io/) | Git repository operations |
|
|
82
|
+
| [BeautifulSoup4](https://www.crummy.com/software/BeautifulSoup/) | HTML parsing for session auth |
|
|
83
|
+
| [Requests](https://docs.python-requests.org/) | HTTP session management |
|
|
84
|
+
|
|
85
|
+
## Disclaimer
|
|
86
|
+
|
|
87
|
+
This tool is intended for **authorized security testing and research only**. The author assumes no liability for misuse. Always obtain proper authorization before testing against any system you do not own.
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
[GNU General Public License v3.0](LICENSE)
|
gitlabrat-1.2/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# LabRat
|
|
4
|
+
|
|
5
|
+
**GitLab exploitation orchestrator.**
|
|
6
|
+
|
|
7
|
+
[](https://pypi.org/project/gitlabrat/)
|
|
8
|
+
[](https://pypi.org/project/gitlabrat/)
|
|
9
|
+
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
10
|
+
[](https://github.com/JChamblee99/LabRat/commits/main)
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
LabRat automates common GitLab exploitation workflows: credential spraying, token creation, project enumeration, repository cloning, and bulk updates.
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
- **Authentication** — Spray credentials or combo lists across GitLab instances with optional LDAP support
|
|
23
|
+
- **Agent management** — Track access tokens and push SSH keys across available agents
|
|
24
|
+
- **Project operations** — Enumerate, clone, create access tokens, and perform procedural updates on repositories
|
|
25
|
+
- **User enumeration** — List users with advanced filtering and create access tokens
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install gitlabrat
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> Requires **Python 3.8+**
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Authenticate to a GitLab instance
|
|
39
|
+
labrat auth -t https://gitlab.example.com -u username -p password
|
|
40
|
+
|
|
41
|
+
# List authenticated agents
|
|
42
|
+
labrat agents ls
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
labrat [-h] {agents,auth,projects,users} ...
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Dependencies
|
|
52
|
+
|
|
53
|
+
| Package | Purpose |
|
|
54
|
+
|---------|---------|
|
|
55
|
+
| [python-gitlab](https://python-gitlab.readthedocs.io/) | GitLab API client |
|
|
56
|
+
| [GitPython](https://gitpython.readthedocs.io/) | Git repository operations |
|
|
57
|
+
| [BeautifulSoup4](https://www.crummy.com/software/BeautifulSoup/) | HTML parsing for session auth |
|
|
58
|
+
| [Requests](https://docs.python-requests.org/) | HTTP session management |
|
|
59
|
+
|
|
60
|
+
## Disclaimer
|
|
61
|
+
|
|
62
|
+
This tool is intended for **authorized security testing and research only**. The author assumes no liability for misuse. Always obtain proper authorization before testing against any system you do not own.
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
[GNU General Public License v3.0](LICENSE)
|
|
@@ -9,7 +9,7 @@ def build_parser(parsers):
|
|
|
9
9
|
|
|
10
10
|
delete_parser = common.add_filtered_parser(subparsers, "delete", handle_delete_args, aliases=["rm"], help="Delete GitLab server from config")
|
|
11
11
|
|
|
12
|
-
add_key_parser = common.add_filtered_parser(subparsers, "
|
|
12
|
+
add_key_parser = common.add_filtered_parser(subparsers, "add_key", handle_add_key_args, help="Add SSH key to the user account", filter_required=False)
|
|
13
13
|
key_group = add_key_parser.add_mutually_exclusive_group(required=True)
|
|
14
14
|
key_group.add_argument("-k", "--key", required=False, help="Public SSH key to add")
|
|
15
15
|
key_group.add_argument("-K", "--key-file", required=False, help="Path to public SSH key file")
|
|
@@ -13,6 +13,7 @@ def build_parser(parsers):
|
|
|
13
13
|
parser.add_argument("-r", "--re-auth", action="store_true", help="Re-authenticate with stored credentials")
|
|
14
14
|
parser.add_argument("-n", "--token-name", required=False, help="Name for the access token", default="private token")
|
|
15
15
|
parser.add_argument("-s", "--scopes", required=False, help="Comma-separated list of scopes for the access token", default="api,read_repository,write_repository")
|
|
16
|
+
parser.add_argument("-a", "--access-token", required=False, help="Access token for authentication")
|
|
16
17
|
|
|
17
18
|
parser.set_defaults(func=handle_args, _parser=parser)
|
|
18
19
|
parser.set_defaults(controller=Auth())
|
|
@@ -20,7 +21,7 @@ def build_parser(parsers):
|
|
|
20
21
|
|
|
21
22
|
def handle_args(args):
|
|
22
23
|
has_targets = args.target or args.target_file
|
|
23
|
-
has_credentials = (args.username and args.password) or args.combo_list
|
|
24
|
+
has_credentials = (args.username and args.password) or args.combo_list or args.access_token
|
|
24
25
|
can_auth = has_targets and has_credentials
|
|
25
26
|
|
|
26
27
|
if args.re_auth or can_auth:
|
|
@@ -53,7 +54,7 @@ def auth(args):
|
|
|
53
54
|
scopes = args.scopes.split(",") if args.scopes else []
|
|
54
55
|
|
|
55
56
|
# Iterate over each user and target
|
|
56
|
-
for agent, err in args.controller.reauth(token_name=args.token_name, token_scopes=scopes, targets=targets, users=[user[0] for user in users]) if args.re_auth else args.controller.auth(targets, users, token_name=args.token_name, token_scopes=scopes, use_ldap=args.use_ldap):
|
|
57
|
+
for agent, err in args.controller.reauth(token_name=args.token_name, token_scopes=scopes, targets=targets, users=[user[0] for user in users]) if args.re_auth else args.controller.auth(targets, users, token_name=args.token_name, token_scopes=scopes, private_token=args.access_token, use_ldap=args.use_ldap):
|
|
57
58
|
if err:
|
|
58
59
|
print(f"[-] Authentication failed for {agent.label}: {err}")
|
|
59
60
|
else:
|
|
@@ -6,7 +6,7 @@ class Auth:
|
|
|
6
6
|
def __init__(self):
|
|
7
7
|
self.config = Config()
|
|
8
8
|
|
|
9
|
-
def auth(self, targets, users, token_name, token_scopes, use_ldap=False):
|
|
9
|
+
def auth(self, targets, users, token_name, token_scopes, private_token, use_ldap=False):
|
|
10
10
|
"""Authenticate and create a PAT for each user on each target.
|
|
11
11
|
|
|
12
12
|
Keyword arguments:
|
|
@@ -19,10 +19,14 @@ class Auth:
|
|
|
19
19
|
|
|
20
20
|
for username, password in users:
|
|
21
21
|
for target in targets:
|
|
22
|
-
agent = Agent(target, use_ldap, username, password)
|
|
23
22
|
try:
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
if private_token:
|
|
24
|
+
agent = Agent(url=target, username=username, private_token=private_token)
|
|
25
|
+
else:
|
|
26
|
+
agent = Agent(url=target, username=username, password=password, use_ldap=use_ldap)
|
|
27
|
+
agent.login()
|
|
28
|
+
agent.auth(private_token=agent.create_pat(token_name, token_scopes))
|
|
29
|
+
|
|
26
30
|
self.config[agent.section] = agent.to_dict()
|
|
27
31
|
yield agent, None
|
|
28
32
|
except Exception as e:
|
|
@@ -4,18 +4,18 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "gitlabrat"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.2"
|
|
8
8
|
description = "LabRat: GitLab exploitation orchestrator"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
11
11
|
authors = [
|
|
12
12
|
{name = "John Chamblee", email = "conway.py@proton.farm"}
|
|
13
13
|
]
|
|
14
|
-
license = {text = "
|
|
14
|
+
license = {text = "GPL-3.0"}
|
|
15
15
|
classifiers = [
|
|
16
16
|
"Development Status :: 3 - Alpha",
|
|
17
17
|
"Intended Audience :: Developers",
|
|
18
|
-
"License :: OSI Approved ::
|
|
18
|
+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
19
19
|
"Programming Language :: Python :: 3",
|
|
20
20
|
"Programming Language :: Python :: 3.8",
|
|
21
21
|
"Programming Language :: Python :: 3.9",
|
gitlabrat-1.0/PKG-INFO
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: gitlabrat
|
|
3
|
-
Version: 1.0
|
|
4
|
-
Summary: LabRat: GitLab exploitation orchestrator
|
|
5
|
-
Project-URL: Homepage, https://github.com/JChamblee99/LabRat
|
|
6
|
-
Project-URL: Repository, https://github.com/JChamblee99/LabRat.git
|
|
7
|
-
Project-URL: Issues, https://github.com/JChamblee99/LabRat/issues
|
|
8
|
-
Author-email: John Chamblee <conway.py@proton.farm>
|
|
9
|
-
License: MIT
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Classifier: Development Status :: 3 - Alpha
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
-
Requires-Python: >=3.8
|
|
20
|
-
Requires-Dist: beautifulsoup4>=4.9.0
|
|
21
|
-
Requires-Dist: gitpython>=3.1.0
|
|
22
|
-
Requires-Dist: python-gitlab>=3.0.0
|
|
23
|
-
Requires-Dist: requests>=2.25.0
|
|
24
|
-
Description-Content-Type: text/markdown
|
|
25
|
-
|
|
26
|
-
# LabRat
|
|
27
|
-
|
|
28
|
-
LabRat is a GitLab exploitation orchestrator designed for security researchers and penetration testers.
|
|
29
|
-
|
|
30
|
-
## Features
|
|
31
|
-
|
|
32
|
-
- **Authentication Management** - Authenticate to GitLab servers and manage access tokens
|
|
33
|
-
- **Project Management** - List, clone, and manipulate GitLab projects
|
|
34
|
-
- **User Management** - Enumerate and create access tokens for GitLab users
|
|
35
|
-
- **Agent Management** - Manage multiple GitLab agents and credentials
|
|
36
|
-
|
|
37
|
-
## Installation
|
|
38
|
-
|
|
39
|
-
Install LabRat from PyPI:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
pip install gitlabrat
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Usage
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
labrat --help
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Commands
|
|
52
|
-
|
|
53
|
-
- `labrat auth` - Authenticate to GitLab server(s)
|
|
54
|
-
- `labrat agents` - Manage GitLab agents
|
|
55
|
-
- `labrat projects` - Manage GitLab projects
|
|
56
|
-
- `labrat users` - Manage GitLab users
|
|
57
|
-
|
|
58
|
-
## Requirements
|
|
59
|
-
|
|
60
|
-
- Python 3.8+
|
|
61
|
-
- python-gitlab
|
|
62
|
-
- GitPython
|
|
63
|
-
- beautifulsoup4
|
|
64
|
-
- requests
|
|
65
|
-
|
|
66
|
-
## License
|
|
67
|
-
|
|
68
|
-
MIT
|
|
69
|
-
|
|
70
|
-
## Author
|
|
71
|
-
|
|
72
|
-
John Chamblee
|
gitlabrat-1.0/README.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# LabRat
|
|
2
|
-
|
|
3
|
-
LabRat is a GitLab exploitation orchestrator designed for security researchers and penetration testers.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Authentication Management** - Authenticate to GitLab servers and manage access tokens
|
|
8
|
-
- **Project Management** - List, clone, and manipulate GitLab projects
|
|
9
|
-
- **User Management** - Enumerate and create access tokens for GitLab users
|
|
10
|
-
- **Agent Management** - Manage multiple GitLab agents and credentials
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
13
|
-
|
|
14
|
-
Install LabRat from PyPI:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
pip install gitlabrat
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
labrat --help
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### Commands
|
|
27
|
-
|
|
28
|
-
- `labrat auth` - Authenticate to GitLab server(s)
|
|
29
|
-
- `labrat agents` - Manage GitLab agents
|
|
30
|
-
- `labrat projects` - Manage GitLab projects
|
|
31
|
-
- `labrat users` - Manage GitLab users
|
|
32
|
-
|
|
33
|
-
## Requirements
|
|
34
|
-
|
|
35
|
-
- Python 3.8+
|
|
36
|
-
- python-gitlab
|
|
37
|
-
- GitPython
|
|
38
|
-
- beautifulsoup4
|
|
39
|
-
- requests
|
|
40
|
-
|
|
41
|
-
## License
|
|
42
|
-
|
|
43
|
-
MIT
|
|
44
|
-
|
|
45
|
-
## Author
|
|
46
|
-
|
|
47
|
-
John Chamblee
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|