Page 1 of 1

Applications for port forwarding using UPnP

PostPosted: Sat Jan 05, 2013 20:44
by Calinou
Note that your router needs to have UPnP enabled.

UPnP-PortMapper

UPnP-PortMapper is a Java application which makes port forwarding easy. It works on Windows, OS X, Linux and *BSDs.

Note that your router must support UPnP and it must be enabled. On most routers, it is enabled by default.

Download link: here

Download it then run it with Java (right click > Open With > Java). On Linux, make sure it is executable -- if it is not, then type this after using the "cd" command to go to the folder where you placed the .jar file:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
chmod -v +x PortMapper-1.9.5.jar


upnpc

upnpc is a command-line tool for Linux and Windows. It can be found in distributions' repositories (at least for Debian/Ubuntu, probably other distributions too).

Download link for Windows: here

On Linux, just install it using your package manager.

Instructions:

Add port forwarding:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
upnpc -a <INTERNAL IP> 30000 30000 UDP

(you can see your internal IP with "ifconfig" on Linux, "ipconfig" on Windows)

List active port forwardings:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
upnpc -l


Remove a port forwarding:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
upnpc -d 30000 UDP

PostPosted: Sat Jan 05, 2013 21:54
by xyz
The same can be achieved by entering this command:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
upnpc -a 192.168.1.26 30000 30000 UDP

without java or any other bloated shit.

PostPosted: Sat Jan 05, 2013 23:03
by Calinou
xyz wrote:The same can be achieved by entering this command:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
upnpc -a 192.168.1.26 30000 30000 UDP

without java or any other bloated shit.


Works too, but that's Linux-only (edit: nope, nevermind). Added to the topic, though.

PostPosted: Sat Jan 05, 2013 23:12
by tux_peng
It is better to do port forwarding in your router, and not deal with uPnp; but this is nice...

PostPosted: Sat Feb 02, 2013 03:09
by InfinityProject
Using UPnP-PortMapper, I got this error:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Could not add port mapping: Detailed error code:402, Detailed error description :InvalidArgs

I followed the instructions exactly like you said.
I run windows 7.

PostPosted: Sat Feb 02, 2013 12:20
by Calinou
InfinityProject wrote:Using UPnP-PortMapper, I got this error:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Could not add port mapping: Detailed error code:402, Detailed error description :InvalidArgs

I followed the instructions exactly like you said.
I run windows 7.


"InvalidArgs"... maybe some argument in your port forwarding preset was empty or invalid (eg. a word instead of a number as port). Or your router doesn't have UPnP enabled.

PostPosted: Sat Feb 02, 2013 12:58
by RabbiBob
tux_peng wrote:It is better to do port forwarding in your router, and not deal with uPnp; but this is nice...


For the security conscious, see show 389 of Security Now. Within the first 3:30 I was aghast at the number of vulnerable routers out there.

http://www.grc.com/securitynow.htm <- mp3 download available
http://twit.tv/show/security-now/389

PostPosted: Sat Feb 02, 2013 17:57
by Calinou
RabbiBob wrote:http://www.grc.com/securitynow.htm <- mp3 download available


>security
>mp3

It's not possible for someone from the Internet to port forward unless you've got some malicious software on your machine. And as always... crackers have better things to do.

PostPosted: Sat Feb 02, 2013 21:26
by RabbiBob
Calinou wrote:
RabbiBob wrote:http://www.grc.com/securitynow.htm <- mp3 download available


>security
>mp3

It's not possible for someone from the Internet to port forward unless you've got some malicious software on your machine. And as always... crackers have better things to do.


Port forwarding isn't the issue, it's a vulnerability in the uPNP protocol that allows the device to be compromised. H.D. Moore has a paper out on it last Tuesday outlining the issue and how many devices were found to be open to the issue during a five month scan of the Internet:

https://community.rapid7.com/community/infosec/blog/2013/01/29/security-flaws-in-universal-plug-and-play-unplug-dont-play

We've known for a couple of years how much upnp swiss cheese's a router, but not to this extent until last week.