-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Garbeled RSSH client fails to open/correctly listen open server forwards #120
Comments
Howdy, Glad to hear you're using v2.1.0 I thought you might like it! Just want to confirm some things:
I have had this working doing the following:
Am just testing to make sure that baking in the server address works Also I'd suggest updating to v2.1.1 as I've resolved a bug which can cause linux clients to exit when they fork. |
Most likely there is no problem in your software, I just do not understand how I do it :D When creating a build for Client2, you need to specify in -s IP address and port from Client1, right? I just don't understand it. link -s 10.0.2.35:4433 --goos windows --goarch amd64 Is this what it's supposed to look like? |
Sweet just confirmed embedding works (on linux at least but there is no functional different between win and linux). I'll set up a windows box to get closer to what you're doing. Here is how I do it: Setup first client
On target host:
Check connection on the catcher:
Check that the client has actually opened the port:
Generate new link with server callback set to newly opened client port (in this case both rssh clients happen to be on the same host so I use 127.0.0.1, localhost):
Try newly made client with different server address:
See new client connect
|
When you enter the command listen -c * -l (root.client1 10.0.0.2:41242): |
Whoa! Thats weird, that may actually be a bug in rssh. Just trying to get vagrant to co-operate with me and I'll be able to tell me. :0 typically means "Im open on any port" which isnt a valid response. |
started :4444 on 1 clients (total 1) :46500): But maybe it's my server, maybe rssh just can't forward the port from it. Although if the client is already hanging, it should. |
Client version SSH-v2.1.0, and I upgraded the server to 2.1.1 |
Nah, I think this is a bug somehow. |
Im running my server with the following:
How are you running yours? |
docker run -p443:2222 -e EXTERNAL_ADDRESS=MYIP:443 -e SEED_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" -v /data:/data reversessh/reverse_ssh |
I switched to docker |
Okay I've just tried running it in windows and havent got the same result that you got. So its not specifically a windows client bug. I'll try rerunning the server in docker |
So my client1 is linux and client2 is windows |
Hrm. Thats even stranger then. So you're listening on client1 which is linux, and its giving you Do you mind giving me what version/distro of linux it is? |
Linux 4.4.182-1.ph1 #1-photon is my vcenter server, I just couldn't find another one for tests at hand. |
Sweet, can confirm that on I.e in my use case client1 is arch, client2 is windows 10, they both can open ports. |
I get it, my cross is behind nat, then I just have a problem with opening the port on linux, thanks, so I did everything right. |
Yeah you've done everything right in terms of commands.
Can you tell it to open a port like This seems to me like its sending back an empty structure to the server Also Im assuming you can open a port normally with something like This could always be a case of selinux,apparmour or some other linux security mechanism that vmsphere has that I dont |
Actually. The most helpful thing you could do here is on your linux client just run it in foreground mode so I can get some logs:
|
I'm going to try everything now. |
Nope, on client1 the ss -tl command does not open the port 7777. Now I will try to open it myself, if it works. |
And no, everything opens, through the listen, tcp6 0 0 :::7333 :::* LISTEN |
But it's still 0 |
catcher$ |
Sorry I don't quite understand what you mean here. My vague understanding is: And the problem was because the firewall didn't allow it or something? Still sounds like a bug that rssh isn't returning the correct port. I wish I could reproduce it :/ |
I will still test it and report back later, so far everything is working, but I have not been able to run client2 yet. But most likely it's the firewall , that's why there is 0 |
Alright thanks. I still don't think the firewall should be making the listen fail in this way. |
Yes, something did not work for me, not even a session arrives. I'll start a little later with foreground |
Hm, imagine, and it's not the Photon OS, in my entire lab, on any machine it does that :D even on windows :58498): |
So it's definitely the firewall. Strange how it happens, but at the same rssh sessions to another external server come and everything works. |
What firewall are you using? Considering this is the rssh client just informing the kernel it would like to open a port I have no idea how a firewall would do anything to the display or result of it? Could you give me the output from one of the clients run in |
I will try to show the output today. And test in my other lab, where nothing stands. |
Yeah cheers. Im just so curious that this isnt just happening on the linux box but on windows as well! The only thing I could think of is that its a kernel module that prevents the |
Anyway tested on a completely different server, and ran it on his computer, still writes 0 port ))) |
That is super odd. Can you please give me the output of a client running in foreground when you start a listening port? Also is this with or without garble? |
It's all with garble |
I haven't tried it without |
Ah cool! I've been trying without garble. So perhaps try that as well? Thanks for the help |
I'm going to try it without it. |
: |
Well pain and suffering. As you should be able to use the full ssh spec for tcp forwarding |
Haven't had a chance to test it yet, but it should work, it's a very cool feature |
Well it uses the same structure that is getting mangled by garble by the looks so it may not work. Would make sense as to why you're only hitting this now. |
I don't understand then, what's the redirection? Can you show me commands or something else. " out of interest does local and remote forwarding work for you generally?" |
Okay. Sweet, this has now been fixed and is living on unstable. In the process of fixing this I also fixed another bug, so I'll do a release sooner rather than later (maybe tomorrow?) To answer your question:RSSH supports lots of features of openssh (like file transfer sftp and scp). It also supports local and remote forwarding. Remote forwarding is the inverse, you open a port on your machine and then use Both very are useful. How you use this in SSH (and rssh) is as follows:Local ForwardingSyntax ssh -L <local port>:<remote ip address>:<remote port> <public ssh server ip address> How you'd usually use it on any normal openssh server: # The following example effectively 'takes' port `80/tcp` on `your.remote.webserver.com` and 'attaches' it to port `80/tcp` on your local machine
# so you can connect to port 80/tcp on your local machine as if you were on your remote webserver
ssh -L 80:127.0.0.1:80 your.remote.webserver.com How you can use it in rssh: In RSSH you can use this by using the jumphost ( # Does the same as before, 'takes' port 80/tcp that is on the rssh clients machine, and effectively opens it on your local machine
# this time you just need to specify that you're jumping through the rssh server first
ssh -J your.rssh.server -L 80:127.0.0.1:80 <client_id> Remote ForwardingSyntax ssh -R <remote port>:<local ip address>:<local port> <remote ip address> How you'd usually use it on any normal openssh server: # Open the port 8888/tcp on the remote.server and have it attached/send data to the service running on localhost 8080/tcp
ssh -R 8888:127.0.0.1:8080 remote.server How you can use it in rssh: ssh -J your.rssh.server -R 8888:127.0.0.1:8080 remote.server RSSH specificThe RSSH server console command Hope this all makes sense! |
I just do it through -D. ssh -D 5000 -J proxy_server:4443 hostname |
Ah yes, but -R and -L allow you to forward ports if you needed to expose a service to the remote network |
I always have enough -D to send requests to the network. |
Perfect! You may also like the most recent addition of the vpn/tun device which lets you send udp and some icmp packets as well. tell me if the patch works for you by the way! |
Haven't had a chance to update yet. Yes vpn/tun is cool and useful, sometimes. |
Hi, I was interested in your update [v2.1.0] but I couldn't figure it out, I can't do it (
I got a client the normal way, then I open a port on this client listen -c MyClient1 --on :4433, it tells me that the port is open. Then how do I put another client MyClient2 on it on the local network? I tried to create a link with local address, link -s MyClient1:4433 but nothing works (I also tried proxy --proxy MyClient1:4433 but nothing works.
The text was updated successfully, but these errors were encountered: