Skip to main content

A CLI HTTP shell to connect to remote shells

Project description

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

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:

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

example.com > whoami
www-data

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.
  • --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

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

cd test
docker compose up

The injectable point is at /good path with the p query parameter. By contrast the /bad path is not injectable.

Then starting the shell

netshell -a http://localhost:8000/good -p q

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

netshell-1.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netshell-1.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file netshell-1.1.0.tar.gz.

File metadata

  • Download URL: netshell-1.1.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netshell-1.1.0.tar.gz
Algorithm Hash digest
SHA256 eb82d0db43f46d494fe49e372a44288bfa197623717f2878a3b761156cc4b2e5
MD5 0cfaceccd61d530a2637409c9944d459
BLAKE2b-256 4592726a7daac5e7899a20d2011331285cad8be32e400c01a4a51329ebc13611

See more details on using hashes here.

Provenance

The following attestation bundles were made for netshell-1.1.0.tar.gz:

Publisher: publish.yml on dubniczky/Netshell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netshell-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: netshell-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netshell-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39fe6c1f54630649785f62455112d5f05015ef5aa9e01dc7eb420e11f9e0e819
MD5 180b0607dbdc61ab17839a439a020766
BLAKE2b-256 75462c891328af51f03e86d52d7a22743dbdc0327b3fbfe5b9c233267f41e300

See more details on using hashes here.

Provenance

The following attestation bundles were made for netshell-1.1.0-py3-none-any.whl:

Publisher: publish.yml on dubniczky/Netshell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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