Forum Thread: Port forwarding problem

Port forwarding problem

I'm having an incredibly tedious problem with port forwarding, and I have no idea how to solve it. Let's define my public IP as X and my kali's local one as Y. In my router's settings I've configured port forwarding for Y on port 4545, and up to this point everything works like a charm. After having made this configuration I try to check if my port is correctly forwarded on "Can you see me" and it does not recognize it at all, only and only if I execute nc -l -p 4545 on my kali machine the site says the port is actually forwarded, but after that nc shuts down and it's then again all closed. Apparently if i don't provide any data to that port it doesn't open at all thus is considered completely deactivated. I have no idea how to open it permanently without having the need to to subtle tasks such as activating it fakely with a netcat listener. I've tried enabling DMZ on Y, but it still does not work at all. I've tried to disable my router's firewall, and nothing. If you guys have any suggestions I'd really like to hear them because this is driving me nuts. Have a good day.

9 Responses

Hey buddy i also need help port forwarding to start a meterprete session in kali linux actually i dont have router no wifi.. M using tethering hotspot do u know or have any idea what should i do now....

Dude, i had the same problem. It is ok, when you exploit via the metasploit framework or whatever tool you are yousing, the tool will start listening on the port u portfowarded. So just use your external ip and it will work

I'll give it a last try and check if it works as intended, thank you

In order to open a socket, you should run a service

  • Handler failed to bind to myPublicIp:4545:- -

Started reverse TCP handler on
* Starting the payload handler...

This is the problem. And whenever I try to open the payload on the external machine for the reverse shell, nothing happens, the handler doesn't recognize any receiving data.

Note:"myPublicIp" is replaced by the actual Ip

Also when the handler has started and
nmap myPublicIp -p 4545 ->

Starting Nmap 6.49BETA4 ( ) at 2016-05-20 18:03 CEST
Nmap scan report for XX (YY)
Host is up (0.0041s latency).
4545/tcp closed worldscores

If u getting this erorr i suggest u to change the LHOST of the handler to ur mashines local ip, since u have forwarded ur public ip to ur local ip u shoud do that.

Unfortunately this doesn't work for me, I even tried to capture packets with Wireshark to check if there was an interaction between machines on this forwarding, and not even a single packed had been transmitted.

You need a service to be listening on the port. When the router forwards data back to your computer to the specified port (4545) the computer just drops it because it does not know what to do with it.

Share Your Thoughts

  • Hot
  • Active