2

I am trying to ssh tunnel into this CTF box and this is the command I am using

ssh -L 2020:127.0.0.1:5901 user@196.168.88.47

and to connect to the 2020 socket I use

ssh -p 2020 root@127.0.0.1

when I do that, it gives me no prompt. Just blank lines no response nothing. BTW 5901 is an open port on the CTF machine.

I already have a shell on the machine, I tried

netstat -a | grep ESTABLISHED 
tcp4 0 0 localhost.5801 localhost.30508 ESTABLISHED

so the connection to the port has been established. Can someone tell me what I am doing wrong?

Sahil
  • 133
  • 1
  • 6

2 Answers2

0

You could be connecting to the wrong service, as port 5901/tcp is commonly used for VNC, not SSH.

You can use nmap to identify the correct service. After starting the tunnel:

nmap -sV -p 2020 localhost 

It will show you the service and version active on that port.

ThoriumBR
  • 5,302
  • 2
  • 24
  • 34
0

You need to verify that your own local firewall isn't blocking the connection to localhost:

iptables -t filter -L -n
Jonas Bjork
  • 386
  • 1
  • 4