Metasploit Get Shell Through NAT

This won't work with reverse payloads unless you can do portforwarding on the system which is NATing your traffic. Hence it's better to generate a payload which allows you to connect to it rather than a payload which connects back (but if your target is also using NAT, then this becomes obsolete as well). For instance:

shell/bind_tcp

This does give problems if there is a firewall between you and the target. Best thing to do is take away the NAT completely if possible. In your case this seems quite difficult...


You can user ngrok to create tunnel through NAT https://ngrok.com/download

1. unzip /path/to/ngrok.zip
2../ngrok authtoken <YOUR_AUTH_TOKEN>
 You get authtoken when you create account on ngrok
3../ngrok http 80

this will create tunnel from your machine to access machine outside nat. someting like this

    Web Interface                 http://127.0.0.1:4040                             
    Forwarding                    http://f44affd3.ngrok.io -> http://localhost:80   
    Forwarding                    https://f44affd3.ngrok.io -> http://localhost:80  

Now you can use this https://f44affd3.ngrok.io address for reverse shell. you can use tcp insted of http or you can even specify port also insted of 80 you can use other ports also