I remember when I would get this error -- seemed like the kiss of death as far as trying to maneuver once I got a shell.  I'd flounder around, trying to figure out how to accomplish the task at hand but this issue would severely limit my ability.

    Somewhere along the way, I discovered the cause -- you don't have a TTY.   What do you do?

    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]

    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. 

    © 2020 sevenlayers.com