Skip to main content

The CLI tool that lets you easily deploy, customize and manage PwnBox containers.

Project description

pwnbox-cli

GitHub GitHub Workflow Status GitHub last commit GitHub release (latest by date) GitHub issues PyPI - Downloads PyPI - Python Version PyPI - Wheel

The CLI tool that lets you easily deploy, customize and manage PwnBox.

Features

  • A fully customizable deployment of PwnBox using a config file.
  • Automatic update checks for newer PwnBox images and CLI.
  • Verbose output so you can tell what commands are being run.
  • Easy deployment and teardown of PwnBox containers.
  • View image download progress in real-time.
  • Cool ASCII banners.

Installation

Using Python >= 3.6, you can install this CLI using pip directly:

pip install pwntools

And that's it! You're all set to use PwnBox CLI!

Usage

$ pwnbox -h # or --help
usage: pwnbox [-h] [-v] [--version] [-b] [-n] [-c CONFIG] [-t TIMEOUT] COMMAND

Launch and manage PwnBox containers.

positional arguments:
  COMMAND               The action to perform.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose output.
  --version             Print the current version of the program.
  -b, --no-banner       Disable printing the banner.
  -n, --no-update       Disable the automatic check for newer PwnBox versions.
  -c CONFIG, --config CONFIG
                        Specify the path to a PwnBox config file.
  -t TIMEOUT, --timeout TIMEOUT
                        Specify the timeout of waiting for SSH to be available.

Commands:
  up                    Starts the PwnBox container if not already started, and connects to it.
  down                  Stop the PwnBox container.
  pull                  Download the latest PwnBox image.
  generate              Write the default config to a file.

Configuration

All configuration of the PwnBox container can be done from pwnbox.conf, which is by default stored (and created on first run) at $HOME/.pwnbox/pwnbox.conf.

The configuration file syntax is as follows:

[IMAGE]
# Where to pull the image from, can be 'ghcr.io' or 'registry.hub.docker.com'
DOCKER_REPOSITORY=registry.hub.docker.com
# The tag of the image to pull. Can be any specific version you'd like
IMAGE_TAG=latest

[CONTAINER]
# Name of the container that Docker will give
NAME=pwnbox
# Hostname inside the container
HOSTNAME=pwnbox
# Should the container run privileged?
PRIVILEGED=true
# Should the container be removed when stopped?
AUTO_REMOVE=true
# Enable this to run GUI applications outside the container
X11_FORWARDING=true
# Enable this to automatically forward all ports and have direct interace access (only linux)
HOST_NETWORKING=true
# What ports would you like forwarded? (syntax HOST:CONTAINER with multiple ones being comma seperated)
# Should keep 2222 for SSH port
FORWARDED_PORT=2222:2222,9000-9010:9000-9010
# Where to store the data thats from /mnt/external
EXTERNAL_VOLUME=$HOME/.pnbox/external
# Where to fetch public ssh keys from
SSH_VOLUME=$HOME/.ssh

You can always re-generate this file using pwnbox generate and copy it to other places to have multiple configurations.

How It Works

When bringing up a container, the CLI will:

  1. Check if Docker is accesible
  2. Check if the desired PwnBox image is downloaded
    1. If it is, check if there is a newer version of the PwnBox image
    2. If not, download the latest version available of the image
  3. Bring up the PwnBox container with the desired settings
    1. If X11 Forwarding is enabled, xhost is executed to whitelist remote connections from localhost
  4. Wait for SSH to be available, then SSH into the container

Contributions

PRs are more than welcome! Fix bugs, add features, improve speed or anything else. I will gladly merge them once I have reviewed them.

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

pwnbox-1.1.2.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

pwnbox-1.1.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file pwnbox-1.1.2.tar.gz.

File metadata

  • Download URL: pwnbox-1.1.2.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pwnbox-1.1.2.tar.gz
Algorithm Hash digest
SHA256 fc93aaa79ed6418ca4f2893ad86d532e56b91b84ca1450ccd1918f50ea08f14a
MD5 6b6b4ce3105b6e4c89e30d1e31fcae28
BLAKE2b-256 3ae53b5844b566bb1c90977924b49a91ffca0816f6b16f4805dc6a413ade18d9

See more details on using hashes here.

File details

Details for the file pwnbox-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: pwnbox-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for pwnbox-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5819f146eba3c7f46aba7a0b635040f9f87605e148fe31ae4bb8d3ea14b434d2
MD5 c927fb91daba5d56231f33c24d8d19bd
BLAKE2b-256 c5f8a825ebcda0d901c4753be2d581931c4bf5c9aeae2ff85cb7ffeac551d9d2

See more details on using hashes here.

Supported by

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