shell - vi over netcat session -
is possible use vi on netcat?
server:
mkfifo tun; sh tun | netcat -l 4444 > tun
client:
netcat server_ip 4444
will gave me remote shell, it's problem send special hot-keys, example can't push esc enter "normal mode" in vi.
or best choice sed ?
this command runs input nc script, , fail same reason why script won't edit file:
#!/bin/sh vi file 42g dd :wq
you can instead, ironically, use script
avoid running script, , instead terminal session interact with:
server$ mkfifo tun; script -q < tun | netcat -l 4444 > tun
(some netcats require -p
before port above)
additionally, should disable local echo , line buffering keys pass through connection rather when pressing enter:
client$ stty -icanon -echo; nc localhost 4444
you should able edit files in vi
.
this neat proof of concept only. non-root users want provide robust shell access on network should use sshd
.
Comments
Post a Comment