There are quite a few reverse shell examples available to you on the Internet.  You can also find a large collection under /usr/share/webshells on the Kali Linux distro.  That said, the other day, I need a small perl script to insert into an application which I could trigger.  A one liner wouldn’t work and the more elaborate examples also wouldn’t work.  I came up with the following from something I found in a search, hopefully you can put this to good use. 

    I attempted to install a software package on a server and the installation failed due to an existing application using the desired port.  Since it was a non-standard port, I didn't know what was using the port but I needed to find it and either kill it or move it.

    Let's say for example, we're looking for the process living on port 3389 (the remote desktop / terminal services port).  First, we run:

    netstat -ano | findstr :3389

    The return should present you with several lines.  One of them should look like this:

    TCP    LISTENING    [processid]

    We like to use the best operating for the job and we use a mixture of Windows, Mac and Linux.  Our typical Linux installation is a virtualized system and it does not include a desktop; we do all of the administration from the command line.

    The other day, we were asked to propose a solution which installs on Linux but the installation must be performed from a Linux desktop.  No problem, we installed the desktop package with the following command:

    © 2020