Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Ullaakut/Gorsair
Gorsair gives root access on remote docker containers that expose their APIs
https://github.com/Ullaakut/Gorsair
docker infosec netsec nmap penetration-testing pentesting security
Last synced: 29 days ago
JSON representation
Gorsair gives root access on remote docker containers that expose their APIs
- Host: GitHub
- URL: https://github.com/Ullaakut/Gorsair
- Owner: Ullaakut
- License: apache-2.0
- Archived: true
- Created: 2018-08-02T16:49:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-19T18:44:32.000Z (12 months ago)
- Last Synced: 2024-05-01T14:53:16.197Z (7 months ago)
- Topics: docker, infosec, netsec, nmap, penetration-testing, pentesting, security
- Language: Go
- Homepage:
- Size: 4.42 MB
- Stars: 837
- Watchers: 20
- Forks: 74
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- go-awesome - Gorsair
- awesome-docker-security - Gorsair - A penetration testing tool for discovering and remotely accessing Docker APIs from vulnerable Docker containers. (Tools / Pentesting)
- awesome-hacking-lists - Ullaakut/Gorsair - Gorsair gives root access on remote docker containers that expose their APIs (Go)
- awesome-docker-security - Gorsair - Docker API 渗透测试工具,用于发现和远程访问 Docker 容器。 (工具 / 渗透测试)
- awesome-docker-security - Gorsair - Docker API 渗透测试工具,用于发现和远程访问 Docker 容器。 (工具 / 渗透测试)
README
# Gorsair
Gorsair is a penetration testing tool for discovering and remotely accessing Docker APIs from vulnerable Docker containers. Once it has access to the docker daemon, you can use Gorsair to directly execute commands on remote containers.
Exposing the docker API on the internet is a tremendous risk, as it can let malicious agents get information on all of the other containers, images and system, as well as potentially getting privileged access to the whole system if the image uses the `root` user.
## Install
### From a release
Set the:
* `GORSAIR_VERSION` to whatever release you are interested in
* `OS` to your operating system (`linux`, `windows` or `darwin`)
* `ARCH` to your architecture (`amd64`, `arm`, or `ppc64le`)And then run the following command to install gorsair.
`curl -sS https://github.com/Ullaakut/Gorsair/releases/download/$GORSAIR_VERSION/gorsair_$OS_$ARCH --output /usr/local/bin/gorsair && chmod +x /usr/local/bin/gorsair`
### From the sources
* Make sure that you have a go version that supports modules (versions 1.11 and above)
* Make sure that your environment contains the `GO111MODULE` variable set to `on`
* Run `go build -o /usr/local/bin/gorsair cmd/*.go` from the root of this repository## Command line options
* **`-t`, `--targets`**: Set targets according to the [nmap target format](https://nmap.org/book/man-target-specification.html). Required. Example: `--targets="192.168.1.72,192.168.1.74"`
* **`-p`, `--ports`**: (Default: `2375,2376`) Set custom ports.
* **`-s`, `--speed`**: (Default: `4`) Set custom nmap discovery presets to improve speed or accuracy. It's recommended to lower it if you are attempting to scan an unstable and slow network, or to increase it if on a very performant and reliable network. You might also want to keep it low to keep your discovery stealthy. See [this for more info on the nmap timing templates](https://nmap.org/book/man-performance.html).
* **`-v`, `--verbose`**: Enable more verbose logs.
* **`-D`, `--decoys`**: List of decoy IP addresses to use (see the [decoy section of the nmap documentation](https://nmap.org/book/man-bypass-firewalls-ids.html))
* **`-e`, `--interface`**: Network interface to use
* **`--proxies`**: List of HTTP/SOCKS4 proxies to use to deplay connections with
([see documentation](https://nmap.org/book/man-bypass-firewalls-ids.html))
* **`-S`, `--spoof-ip`**: IP address to use for IP spoofing
* **`--spoof-mac`**: MAC address to use for MAC spoofing
* **`-v`, `--verbose`**: Enable verbose logging
* **`-h`, `--help`**: Display the usage information## How can I protect my containers from this attack
* Avoid putting containers that have access to the docker socket on the internet
* Avoid using the `root` account in docker containers