I had a need to get command line access. But was having trouble with the host and the free internet I has given. Here is a write up on how to setup a SSH Reverse Tunnel and starting it with a DTMF command. If anyone knows how to start a SSH with a pid. That would be great. Please let me know if we can add anything to the howto.
Or you can get really really fancy and use the /dev/tcp filesystem found in bash:
This will open a file descriptor and point it at the virtual file of /dev/tcp//. This results in connecting the file descriptor to the remote tcp port and destination specified and creates a read and write file descriptor:
exec 4<>/dev/tcp//
The file descriptor here is 4 and is read and write
Now to send an GET over in HTTP 1.0 format (you can send whatever you want):
echo -e “GET / HTTP/1.0\r\n\r\n” > &4
And you can read the results with:
cat <&4
Although your mileage may vary with this last one.
If you want to write something up. I’m sure other would appreciate it.
David
···
–
Thanks, David
“Laws that forbid the carrying of arms…disarm only those who are neither inclined nor determined to commit crimes. Such laws make things worse for the assaulted and better for the assailants; they serve rather to encourage than prevent homicides, for an unarmed man may be attacked with greater confidence than an armed one.”