Skip to content
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

[Feature Request] Forward to localhost #911

Open
gbl opened this issue Nov 13, 2023 · 0 comments
Open

[Feature Request] Forward to localhost #911

gbl opened this issue Nov 13, 2023 · 0 comments

Comments

@gbl
Copy link

gbl commented Nov 13, 2023

I have a server (let's assume its IP is 1.2.3.4) that has various things running, each of which are listening on 127.0.0.1:[port] where port is anything between 14000 and 15000. These things are intentionally listening on localhost as they should not be reachable on the internet.

tcp        0      0 127.0.0.1:14001         0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:14003         0.0.0.0:*               LISTEN  

I can run sshuttle :
sshuttle -r root@1.2.3.4 1.2.3.4/32
but can't reach these ports, as my connection to 1.2.3.4 gets caught by sshuttle as it should be, forwarded to the server, and tries to connect to the same 1.2.3.4 there, where the services don't listen.

Would it be possible to add a fake localhost if same ip option, which would make the server, if it detects a connection to its own IP address, connect to 127.0.0.1 instead of said ip address?
Which would mean, that

sshuttle -r root@1.2.3.4 1.2.3.4/32 --fake-localhost

forwards connections to 1.2.3.4 on my host to 127.0.0.1 on the 1.2.3.4 server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant