A browser-based tool for generating webshells and reverse shells with file upload bypass techniques for penetration testing and CTF challenges.
Author: melmols
Any modern browser (Chrome, Firefox, Edge, Safari). No install, no server, no internet connection required.
- git clone https://github.com/melmols/MagicShells
- cd
MagicShells - open
magicshells.html
| Mode | Description |
|---|---|
| Webshell | Generate webshells with upload bypass variants and curl commands |
| Reverse Shell | Generate reverse shell one-liners for multiple languages |
| Stabilize | Shell upgrade steps and Evil-WinRM command generator |
Generates ready-to-upload webshell files with bypass variants for restricted upload endpoints.
| Shell | Extension |
|---|---|
| PHP (system) | .php |
| PHP (passthru) | .php |
| PHP (exec) | .php |
| PHP (shell_exec) | .php |
| PHP (full) | .php |
| Classic ASP | .asp |
| ASPX (C#) | .aspx |
| ColdFusion | .cfm |
| JSP | .jsp |
| Node.js | .js |
| Perl CGI | .pl |
| Variant | Technique |
|---|---|
.php |
Standard extension |
.php5 |
Alternate PHP extension |
.php7 |
Alternate PHP extension |
.phtml |
Alternative PHP handler |
.pHp |
Case swap bypass |
.php.jpg |
Double extension — PHP executes, appears as image |
.php.pdf |
Double extension — PHP executes, appears as PDF |
.jpg |
Extension swap — shell disguised as image (use with magic bytes) |
.pdf |
Extension swap — shell disguised as PDF (use with magic bytes) |
.shtml |
Server-side include handler |
Prepend file magic bytes to help bypass content-type checks:
- None - plain shell
- PDF - prepends
%PDF-1.4\n - GIF - prepends
GIF89a;\n - JPEG - JPEG magic bytes via curl command
- Shell File - copy or download the raw webshell
- Curl Command - ready-to-run curl upload command with correct MIME type
- All Variants - every bypass variant with individual copy/download per entry
- Trigger URL - build the GET request URL to fire the uploaded shell
After upload, paste the shell's public URL into the Trigger URL tab. MagicShells generates the full GET request with the command parameter pre-filled, ready to copy or open.
Generates reverse shell one-liners. Enter LHOST and LPORT, select your shells, and copy.
| Shell | Notes |
|---|---|
| Bash | /dev/tcp redirect |
| Bash (196) | File descriptor variant |
| Python 3 | socket + pty |
| Python 2 | socket + pty |
| Netcat (-e) | Traditional nc with -e |
| Netcat (mkfifo) | Named pipe variant, works without -e |
| Ncat | nmap's ncat with --sh-exec |
| PowerShell | Raw PowerShell TCP reverse shell |
| PowerShell (encoded) | Base64-encoded for WAF/AV bypass |
| PHP reverse | PHP socket reverse shell |
| Ruby | Ruby TCPSocket |
| Perl | Perl IO::Socket |
Toggle URL encode in the reverse shell output panel to percent-encode payloads for delivery via GET parameters or curl commands.
Step-by-step shell upgrade reference for both Linux and Windows targets.
| Step | Command |
|---|---|
| Spawn PTY | python3 -c 'import pty; pty.spawn("/bin/bash")' (or python/script fallbacks) |
| Background | Ctrl+Z |
| Raw terminal | stty raw -echo; fg |
| Set TERM | export TERM=xterm |
| Fix rows/cols | stty rows N cols N (auto-filled from your terminal size) |
| Step | Action |
|---|---|
| rlwrap | Wrap listener with rlwrap nc -lvnp PORT for arrow keys |
| PowerShell upgrade | Drop into PowerShell from cmd |
| Check privileges | whoami /all |
| AMSI bypass | In-memory bypass one-liner |
All step commands have individual copy buttons.
Builds the evil-winrm connection command from:
| Field | Notes |
|---|---|
| IP | Target host |
| Port | Default 5985 (HTTP) or 5986 (HTTPS) |
| Username | Domain or local user |
| Password | Plaintext password |
| NTLM Hash | Pass-the-hash — leave password blank |
| SSL | Switches port default to 5986, adds -S flag |
- No server required - open directly in any browser, works fully offline
- Shell tooltips - hover any shell card to see what it does and when to use it
- Per-variant controls - copy shell or curl command for each bypass variant individually
- Magic byte injection - prepend PDF, GIF, or JPEG bytes to bypass content-type filters
- Custom code - paste your own shell and use
{param}as the command placeholder - PowerShell base64 - encodes UTF-16LE in-browser for encoded payload generation
- Listener reminder - displays
nc -lvnp PORTwith a copy button - Trigger URL - generate the full GET request URL to fire an uploaded webshell
- URL encode toggle - percent-encode reverse shell payloads for URL delivery
- Stabilize tab - Linux and Windows shell upgrade steps with copy buttons
- Evil-WinRM generator - build password or pass-the-hash WinRM connection commands
- Open
magicshells.htmland stay on the Webshell tab - Select a shell type
- Set your filename, GET parameter name, and (optionally) upload target URL
- Select magic bytes if needed
- Click Generate
- Use the Shell File tab to download/copy the shell, Curl Command for the upload command, All Variants for all bypass combinations, or Trigger URL to build the execution request
- Switch to the Reverse Shell tab
- Enter your LHOST and LPORT
- Select which shell types to generate
- Click Generate Shells
- Start your listener with the displayed
nc -lvnpcommand, then copy and run the shell of your choice - Toggle URL encode if delivering the payload via a URL parameter
- Switch to the Stabilize tab
- Select Linux or Windows
- Follow the steps in order — copy each command with the button on the right
- For Evil-WinRM: fill in the target details and click Generate
Start your listener in a terminal:
nc -lvnp 4444Then generate and deliver the reverse shell payload using MagicShells.
For webshell upload with magic byte bypass:
# Example curl command generated by MagicShells
curl -s -X POST http://target/upload \
-F "file=@shell.php.jpg;type=image/jpeg"Once uploaded, use the Trigger URL tab to build and copy the execution request.
All processing is done client-side in JavaScript. No data is sent anywhere.
