Module 3 · Networking for testers · Lesson 11 of 16

Addresses, subnets and ports

Read an address and a /24, know the private ranges, and learn the ports you will see in every scan.

In this lesson · about 20 minutes

  • Work out how many hosts a /24 holds
  • Spot a private address and a public one in a scope
  • Say what an open port 21, 22, 23, 80, 445 or 3306 means to a tester

Every attack in this course travels over a network. This module gives you the working knowledge to read scan results, follow a conversation between two machines, and see for yourself why unencrypted protocols are a finding.

Addresses and subnets

An IPv4 address like 192.168.56.101 is four numbers from 0 to 255. The /24 in 192.168.56.0/24 says the first 24 bits, the first three numbers, name the network and the last number names the host. That gives 256 addresses, of which 254 are usable: .0 names the network and .255 is broadcast.

PrefixAddressesTypical use
/321A single host in a scope document
/24256An office or lab network
/1665,536A large company site. Scanning all of it takes planning.

Three ranges are private and never routed on the internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. If a scope lists a public address, it is on the internet, so double-check it really belongs to the client.

Ports and protocols

An address gets you to a machine; a port (0 to 65,535) gets you to one program on it. TCP sets up a connection first and guarantees delivery (web, SSH, email). UDP just sends, which is faster but unreliable (DNS lookups, SNMP, video). Learn these by heart; you will see them in every scan:

PortServiceWhat to think when it is open
21/tcpFTPPlaintext logins. Anonymous access?
22/tcpSSHRemote shell. Weak passwords? Old version?
23/tcpTelnetPlaintext remote shell. Almost always a finding.
25/tcpSMTPMail. Can it be used to check which users exist?
53/udp+tcpDNSName lookups. Zone transfers allowed?
80, 443/tcpHTTP, HTTPSA web app to test.
139, 445/tcpSMBWindows file sharing. Open shares, old versions.
3306/tcpMySQLA database reachable from the network is rarely intended.
3389/tcpRDPWindows remote desktop. Exposed to the internet?

Flashcards

Ports to know by heart

0 of 7 known

Say the answer out loud, flip the card, then be honest: cards you miss come back at the end.

7 left in the deck

Check your understanding0 of 3 correct

Question 1

1.How many usable host addresses are in a /24 network?

Question 2

2.Which of these addresses is private, so never routed on the internet?

Question 3

3.Port 23 is open on a client server. What is your first thought?

Quiz score: 0 of 3

Tip: answer every quiz question correctly first.

For authorized, lab-based learning only. Tana Roasters and every person, address and password in this course are fictional. Every terminal is simulated. "Kali Linux" is a trademark of OffSec; this course is not affiliated with or endorsed by OffSec.