Your most lightweight option will be binding your shell to a port using something like Netcat. Something to remember is that OpenSSH does more. It helps authenticate and secure the connection. Netcat does none of this.
Anyway, on your remote Linux machine run,
netcat -lp 9999 -e /bin/sh
and on your Windows machine run something like,
netcat example.com 9999
Where example.com
is the domain or IP of the Linux machine.
This basically exposes /bin/sh
on port 9999
. Your second command connects to it.
Disconnecting from the Windows machine should close the previous connection. If you want it stay alive, run something like,
while TRUE; do netcat -lp 9999 -e /bin/sh; done
Which will keep restart this after it closes.
- This has NO authentication. ANYONE can connect to this.
- ALL data is sent as cleartext including any password you send.
Be careful.
Are you trying to connect to a remote host? If so, is this remote machine using Linux or Windows? – rovr138 – 2017-12-26T09:41:37.163
@rovr138 yes I am trying to connect to a remote host.It is Linux but for this, i need to run ssh server.on Linux side tiny memory and processor so it starts hanging.so I do not want start ssh server on Linux. – GC coding – 2017-12-26T09:47:11.597
Hints: "bind shell", "reverse shell", "
telnet
". Make sure you understand security issues. – Kamil Maciorowski – 2017-12-26T09:57:37.160Multi-posted at https://unix.stackexchange.com/questions/413088/ .
– JdeBP – 2017-12-26T16:22:20.987