I haven't tried in a different machine, but I am trying to establish an ssh tunnel to an external server. This how I am doing it:
ssh -L 9898:firewalled.service.com:443 user@some-server
I have 2 problems on this:
- while accessing to localhost:9898, I get:
400 Bad request: The plain HTTP request was sent to HTTPS port.
and I get
Cannot Get /
If trying https://localhost:9898
- If I close the ssh connection, and I run nmap to localhost, I get many ports opened.
Ports that I have tried and now appear in nmap:
$nmap -T4 localhost
| PORT | STATE | SERVICE |
| 6666/tcp | open | irc |
| 7777/tcp | open | cbt |
| 8080/tcp | open | http-proxy |
| 9876/tcp | open | sd |
| 9898/tcp | open | monkeycom |
| 9999/tcp | open | abyss |
This are all attempts of ssh tunnels, all connections are already closed, but this are still showing in nmap.
I know these ports are open and listening to something, I can even talk to them:
nc -z localhost 9999
Connection to localhost port 9999 [tcp/distinct] succeeded!
What is the reason behind this?
I am using Macos Mojave for all of this.