Ports are available services that a server is offering.
Now, this may be you accessing your favorite social media site, or it
could even be a port that you've incorrectly configured, and now everyone
is using your server as a spare relay service.
Yikes! Let's examine ports more thoroughly.
As previously stated, ports are a service that is being offered by a device.
The easiest way to think of a port is imagining you're at a
supermarket. Now, this is the internet.
Now let's imagine each aisle is a website, and each item is a port.
Now, you may be thinking to yourself, that's a ton of ketchup, I mean ports,
and you're right, as there are over 65,000 ports.
Now, as a side note though,
a large majority of these ports you'll never encounter,
but some of the common ones you'll encounter every day.
A good example of the two most common ports you'll encounter
every day are the web ports of 80 and 443. Every now and then
when you come home from the supermarket,
you'll notice that the milk that you got was already expired,
and ports can behave in a similar fashion.
You may think that you've connected to a legitimate service,
but in reality it's malicious, so use caution, and be vigilant
because no one wants spoiled milk or malware.
Let's drop to a quick video and check on Jason,
the network engineer of Wired Brain Coffee, as he scans a
server to check its available ports.
He'll then test a couple of the reported ports to validate Nmap's information.
Jason will be scanning the IP address of 192.168.1.1. With the results returned,
we can see this device is offering three services. Using the supermarket
analogy, aisle one would have the IP address of 192.168.1.1, and it
would be offering three items in its aisle.
All three listed ports are common, port 22 for SSH, port
23 for Telnet, and port 443 for HTTPS.
So, essentially, this would be our milk, eggs, and cheese.
But let's validate Nmap's reporting of open ports 22 and
443 by connecting to each service.
First, we'll attempt an SSH connection to port 22.
Great,
that's working as expected. Now we'll navigate to the HTTPS
web interface to validate its operation.
Awesome.
The site is working as expected. It looks as though Nmap was correct in its reporting of open ports.