If all went well, the web server should have thrown back a shell to your netcat listener. Run the script simply by browsing to the newly uploaded file in your web browser: Enjoy your new shell You’ll need to place it in a directory where PERL scripts can be run from (e.g. Using whatever vulnerability you’ve discovered in the website, upload. Use the same port here as you specified in the script (1234 in this example): $ nc -v -n -l -p 1234 Upload and Run the script Start a TCP listener on a host and port that will be accessible by the web server. my $ip = '127.0.0.1' my $port = 1234 Get Ready to catch the reverse shell Edit the following lines of : # Where to send the reverse shell.
NETCAT REVERSE SHELL PERL CODE
To prevent some else from abusing your backdoor – a nightmare scenario while pentesting – you need to modify the source code to indicate where you want the reverse shell thrown back to. SHA1sum: b2dfefd3d10f5fedd674a8651e5bdcb3b3289335 Walk Through Modify the source It differs from web form-based shell which allow you to send a single command, then return you the output.
This will be a proper interactive shell in which you can run interective programs like telnet, ssh and su. Bound to this TCP connection will be a shell.
The script will open an outbound TCP connection from the webserver to a host and port of your choice. Upload this script to somewhere in the web root then run it by accessing the appropriate URL in your browser. This tool is designed for those situations during a pentest where you have upload access to a webserver that’s running PERL.