On Friday, January 1st, 2016, at 12:23:42h -0500, Paul M. Cook realized:
> So now I see that all requests don't just go to an IP address, but, they
> all go to an IP address plus a port.
Yes, yes, yes, this is exactly the case.
In our analogy with the operator and patch cords at the telephone exchange,
there is with TCP/IP networking in addition to the telephone number (the
IP address) a port number, so it is like somebody have one telephone number
but a black phone, a yellow phone, a red phone (for calls to the Kremlin)
and only one phone is the right one, so the patch cord has to connect
to the specific phone (internal port) as well.
So if the Kremlin red phone calls, one would not want it connected to the
yellow phone, but to your internal red phone so that when the conversation
starts, one does not make the mistake of asking is that Xi Jinping (because
the yellow phone rang) when it is in fact Vladimir Putin calling from his
red phone.
> If that port is well known (such as port 80, and if I have a "service"
> running on that port on my laptop) then the router might be able to connect
> the external request to the right internal laptop & port
Exactly so, but without ensuring that the web server you have running on
your laptop is fully secure with proper configuration directives to only
allow LAN hosts access to "sensitive" directories where needed, and that
you have eliminated any possible SQL or PHP injection inquiry faults, etc,
opening up your web server to the Internet is not a sensible thing to do.
> But, there is no "Transmission" (bittorrent) service defined in the
> /etc/services file
Because nobody has registered Transmission as using a particular port.
And if they did, then all the ISPs would have to do was block traffic
on that port and it would not work properly, so people would then choose
random alternative ports as they do now, so going to the trouble of
registering a particular port for transmission is pointless ...
> The router will be told to connect that external port
1.2.3.4:43101 to
> an internal port
192.168.1.10:43101, which is where Transmission will
> be set to listen for incoming connections.
Exactly. Exactly.
> But, one question in the back of my mind is what does the router do
> to a request without port forwarding to
1.2.3.4:43101.
Hopefully it does what it should do.
If your local host has already established a connection (which would
of course be TCP, because UDP is connectionless) with a remote host
on 43101, it would allow incoming traffic with that same remote host
on that port. If another IP address tried to connect, the router
(or rather the iptables or equivalent in the router) would just
drop all traffic from that remote host on that port and send it to
/dev/null or the bitbucket.
> how does ANY traffic get through the router if the router blocks all incoming
> requests to all ports?
As I have tried to explain above and in the other message, if your
local host1 has already initiated and established a connection with a
remote host on a particular port, it allows incoming traffic from
that same IP address and same port and forwards it to the local host1.
> Otherwise hackers would never get in. Right?
The way hackers can bypass the router security are generally via two routes.
The hacker gets one its botnet hosts to send you an e-mail with an attachment
which you think is just a document but is actually an executable and when
you open it, it runs the executable which installs a program which initiates
contact with the botnet and becaue it initiated contact, it allows incoming
traffic from the botnet on that port.
Alternatively you use Windoze and Internet Explorer and visit a web site
with malicious code (perhaps javascript or even java) which Internet Explorer
runs and installs sofware which does the same as above.
The other possible route, is that the hacker is able to connect to your
router administration interface because you have used a weak password
or even not even set one different from the factory default and have
turned on Internet access to the administration interface, or the router
manufacturer stupidly left in a backdoor in the firmware, perhaps to
allow ISPs to do meddle with your router.
The worst ISPs are ones such as Sky in the UKofGB&NI which officially
do not allow you to use anything but the router which they supply and
which has most administrative functions blocked to the user because
the administrator account is locked, and only access to a simple
non-privileged interface is provided.
<
https://nakedsecurity.sophos.com/2013/10/15/d-link-router-flaw-lets-anyone-login-using-joels-backdoor/>
<
http://arstechnica.com/security/2014/01/backdoor-in-wireless-dsl-routers-lets-attacker-reset-router-get-admin/>
<
http://www.theregister.co.uk/2014/01/06/hacker_backdoors_linksys_netgear_cisco_and_other_routers/>
See also how bad uPnP implementations by some networking device companies on some routers
can be misused by hackers at
<
http://www.computerworld.COM/article/2972756/cybercrime-hacking/attackers-are-using-insecure-routers-and-other-home-devices-for-ddos-attacks.html>
This is of course why you need to keep the firmware updated on your router.
Obviously once a hacker can login to the administrator account on the router,
then she/he can open up whatever ports she/he chooses and to connect to machines
on your LAN.
A secondary line of defence is to have software firewalls running on each
of your machines which will safeguard against this failure, but the problem
is for hosts running embedded systems (Smart TVs, Wifi Radios, satellite receivers,
internet connected coffee machines and refrigerators etc) for which the manufacturer
did not care about LAN security.
What could be worse than coming home to find that crackers have gotten access to
your refrigerator/freezer and turned the freezer off so that all your frozen food
has melted and started decomposing, when you open the freezer compartment door?