|
| 1 | +# Docker API Enumeration Tools |
| 2 | + |
| 3 | +These scripts query the **Docker Engine HTTP API** to collect information about containers and secrets. |
| 4 | +They are designed for security assessments and administrative auditing, providing quick insights into environment variables, secrets, and general engine configuration. |
| 5 | + |
| 6 | +**Warning**: Exposing the Docker Engine API without TLS or authentication is a serious security risk. |
| 7 | +Use these scripts only against environments you are authorized to assess. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## Scripts |
| 12 | + |
| 13 | +### 1. `docker_envs.py` |
| 14 | +Enumerates running and stopped containers, extracts their **environment variables**, and prints them to the console. |
| 15 | +Can also save the results in structured JSON. |
| 16 | + |
| 17 | +#### Features |
| 18 | +- Fetches `/info` for Docker Engine overview (version, OS, CPUs, memory, etc.). |
| 19 | +- Lists all containers (like `docker ps -a`). |
| 20 | +- Shows each container’s environment variables. |
| 21 | +- Displays a progress bar with [`alive-progress`](https://github.com/rsalmei/alive-progress). |
| 22 | +- Optionally saves results to a JSON file. |
| 23 | + |
| 24 | +#### Usage |
| 25 | + |
| 26 | +##### Environment Variables Enumeration |
| 27 | + |
| 28 | +```bash |
| 29 | +# Local Docker API (default: http://localhost:2375) |
| 30 | +python EnumEnvVars.py |
| 31 | + |
| 32 | +# Remote engine and save to file |
| 33 | +python EnumEnvVars.py --url http://docker-host:2375 --out results.json |
| 34 | + |
| 35 | +# Include full /info JSON |
| 36 | +python EnumEnvVars.py --show-info-json |
| 37 | +``` |
| 38 | + |
| 39 | +##### Secrets Enumeration |
| 40 | + |
| 41 | +```bash |
| 42 | + |
| 43 | +# Local secrets enumeration |
| 44 | +python EnumSecrets.py |
| 45 | + |
| 46 | +# Remote engine, attempt values, save to file |
| 47 | +python EnumSecrets.py --url http://docker-host:2375 --attempt-values --out secrets.json |
| 48 | + |
| 49 | +# Include full /info JSON |
| 50 | +python EnumSecrets.py --show-info-json |
| 51 | +``` |
| 52 | + |
| 53 | +#### Installation |
| 54 | + |
| 55 | +```bash |
| 56 | +pip install requests alive-progress |
| 57 | +``` |
0 commit comments