INSIGHTS
Cybersecurity

CompTIA SY0-701: Ports and Protocols

An alert reports that a workstation contacted an unfamiliar internet address over port 443.

In this article
  1. A port is a clue, not a verdict
  2. Put familiar services in their operational context
  3. Separate administration from everyday connectivity
  4. DNS, email, and web traffic need different evidence
  5. Build firewall policy around business flows
  6. Investigate what the connection actually means
  7. The standard for a defensible network decision

An alert reports that a workstation contacted an unfamiliar internet address over port 443. At almost the same time, a remote-access attempt reached a server on port 3389. Neither number proves that an attack occurred. The first connection could be an ordinary encrypted web session; the second could be authorized remote administration. The security decision depends on who initiated the connection, which service actually responded, whether the route was permitted, and what the surrounding evidence shows.

A well-known port offers a clue about the intended service, not proof of the application, its identity, or its safety. That distinction matters when configuring firewall rules, narrowing an incident investigation, or interpreting connection logs. It also prevents a common error: treating traffic as trusted simply because it uses a familiar port number.

A port is a clue, not a verdict

IP addresses identify hosts or interfaces, while transport-layer port numbers distinguish communication endpoints on those hosts. In a typical client-to-server connection, the client chooses a temporary source port and contacts a destination such as TCP 443 on a web server. Return traffic normally follows the state of that conversation. A log that records only source port: 54321 and destination port: 443 tells less than one that also includes source and destination addresses, direction, transport protocol, connection result, application identification, and process context.

The customary mapping between service and port is useful precisely because it establishes an expectation. HTTPS usually uses TCP 443; HTTP/3 commonly uses QUIC over UDP 443. An application can listen on a different port, while a malicious program can choose a common one to blend into permitted traffic. A firewall rule allowing TCP 443 does not certify that everything crossing it is HTTPS, nor does encryption certify that a server or user is trustworthy.

TCP and UDP also change what an investigator can observe. TCP establishes a connection and manages reliable, ordered delivery. UDP does not establish that transport-layer connection; applications using it handle their own reliability needs or tolerate loss. A flood of unanswered TCP connection attempts, an unusual rise in UDP responses, and ordinary retransmissions can have different explanations. Even when a pattern deserves investigation, it should be corroborated before it is labeled malicious.

This is where a security analyst moves beyond a memorized port chart. Identify the claimed service, then ask what the service is supposed to accomplish, who is allowed to reach it, and which evidence would confirm or contradict the claim. The same approach is essential when reviewing a permitted service after an intrusion: an attacker who knows the firewall allows web traffic may exploit that permission without changing the destination port.

Put familiar services in their operational context

The following are common defaults, not an exhaustive exam checklist or proof that a packet carries the named protocol. A modern service may use another port, multiple transports, or an application-layer tunnel. The control question in the final column matters as much as the number.

Service or purpose Common destination port and transport Security question
HTTP and HTTPS TCP 80 and TCP 443; HTTP/3 commonly UDP 443 Is the expected service and TLS identity present?
SSH and Telnet TCP 22 and TCP 23 Is remote management encrypted and restricted?
Remote Desktop Protocol TCP and sometimes UDP 3389 Is access mediated, authenticated, and logged?
Server Message Block TCP 445 Can only authorized devices reach the needed shares?
Traditional DNS UDP and TCP 53 Are approved resolvers used and responses observable?
DNS over TLS TCP 853 Does encrypted resolution follow enterprise policy?
SMTP relay and submission TCP 25; submission on TCP 587 or 465 Is the host relaying mail or submitting it as a user?
IMAP and POP with implicit TLS TCP 993 and TCP 995 Are mailbox credentials and content protected?
LDAP, LDAPS, and Kerberos TCP 389, TCP 636, and TCP/UDP 88 Is directory access appropriately secured and scoped?
Network Time Protocol Usually UDP 123 Are systems using trusted time sources?
SNMP polling and traps Usually UDP 161 and 162 Are management interfaces isolated and authenticated?

A destination port belongs to a conversation, not necessarily to the system’s permanent identity. For instance, a browser’s ephemeral source port may change every time it connects to the same HTTPS service. It would be a mistake to write a firewall policy that assumes every high-numbered source port represents an unknown internet-facing server. Stateful firewalls normally account for replies to established connections; rules allowing unsolicited inbound traffic deserve a different level of scrutiny.

Protocols also contain behaviors that a port number cannot describe. DNS over TCP is not merely a historical exception reserved for zone transfers: modern DNS implementations need TCP support for ordinary queries as well, including larger responses and transport flexibility. Conversely, encrypted DNS can be carried over other transports, so seeing little traditional port-53 traffic is not sufficient evidence that a device is not resolving names. The right interpretation depends on the resolver configuration, permitted egress paths, and endpoint telemetry.

Separate administration from everyday connectivity

A help-desk technician may need remote access to a workstation, but that need does not justify exposing its management service to the entire internet. SSH on TCP 22 protects session confidentiality and integrity when configured and validated correctly. Telnet on TCP 23 does not provide equivalent protection, so its use should be treated as a legacy exception rather than a normal administrative choice. Neither service should be universally reachable simply because an operator knows the right credentials.

RDP commonly uses TCP 3389 and can also use UDP. It can be secured with appropriate authentication and transport protections, but an internet-exposed RDP listener still creates a large attack surface. A defensible design routes administrators through a trusted gateway or access path, limits which managed devices can initiate sessions, enforces multifactor or other strong authentication where supported, and records both successful and failed attempts. Authentication logs distinguish denied network reachability from an attacker repeatedly guessing credentials; firewall logs alone often cannot.

File services demand the same distinction between necessary access and unnecessary reachability. SMB on TCP 445 may be essential inside an organization, yet exposing file shares broadly between workstations and servers can enable lateral movement after a compromise. Rather than blocking every share or permitting any internal host to reach every server, use service-specific rules, least privilege on shared resources, supported protocol versions, and monitored administrative access. The deeper design question is addressed by network segmentation: where should trust boundaries exist, and which business flows actually need to cross them?

A secure management path still needs controls after a connection is established. Stolen administrator credentials can make an SSH or RDP session look technically legitimate. Device health, limited privileges, session duration and monitoring matter alongside encryption. Identity and access management therefore belongs in the network policy decision: permitting a protocol is not the same as authorizing every person or operation that uses it.

DNS, email, and web traffic need different evidence

A workstation may contact an approved DNS resolver over UDP 53 for most ordinary lookups and use TCP 53 when required. A security team should not assume that DNS over TCP signals a zone transfer or an attack. The more useful questions are whether the resolver is approved, whether the queried domains are consistent with the endpoint’s role, and whether unusual responses or query volumes warrant correlation with proxy, endpoint, or threat-intelligence data. DNS filtering becomes less reliable when devices can silently switch to unapproved resolvers or encrypted DNS paths that bypass normal inspection.

For email, three similarly named activities have different operational boundaries. SMTP on TCP 25 is the traditional server-to-server relay path. A user’s mail application normally submits outbound messages to an authenticated submission service: TCP 587 commonly uses STARTTLS, while TCP 465 is the defined implicit-TLS submission service. Secure mailbox access may use IMAP over TCP 993 or POP over TCP 995. The presence of an email-related port does not establish that the message is authorized, authenticated, or protected end to end. Spoofing countermeasures such as SPF, DKIM, and DMARC address domain-based sender authentication and policy; they are not substitutes for transport security.

A mail relay policy illustrates why roles matter. The organization’s mail servers may need outbound TCP 25, while ordinary employee laptops generally should not initiate arbitrary external relay connections. Restricting that path limits some abuse without interrupting legitimate mail submission on approved services. Any exception should have an owner, a documented reason, and monitoring to detect changes in behavior.

HTTPS requires more precision than remembering port 443. TCP 443 commonly carries TLS-protected web traffic, while HTTP/3 commonly uses QUIC over UDP 443. Encryption protects data in transit only when the client negotiates suitable protection and validates the expected server identity. A valid certificate does not guarantee that a website is safe, and a familiar port does not prove that its traffic is benign. Public key infrastructure establishes how certificates, issuer chains and trusted keys support server identity checks without replacing application authorization or threat detection.

This distinction matters in investigations. An endpoint that establishes many encrypted connections to unfamiliar destinations may be running a legitimate updater, using a sanctioned cloud service, or communicating with an attacker. DNS history, device process ancestry, identity events, destination reputation, transfer volume, and approved application behavior narrow the possibilities. If encrypted inspection is considered, it must follow organizational policy, legal constraints, and the visibility limits of the deployed TLS and QUIC technologies.

Build firewall policy around business flows

Consider an application server that needs to query a database and resolve internal names. A rule allowing all traffic from the application subnet to the entire data-center subnet would be convenient but unnecessarily broad. Better policy specifies the known source identity or subnet, the approved database destination, the actual database service port, and a separate path to designated DNS resolvers. Each rule should have a business owner and a reason that remains understandable during the next audit.

The same principle applies to administrative access. Rather than permitting inbound TCP 3389 from anywhere, a policy can permit connections from managed jump hosts to a limited set of managed destinations, with user authorization enforced at the access layer. Firewall controls alone do not verify that the authenticated operator is entitled to perform a particular action on the target machine. A layered decision combines network reachability, identity, endpoint posture, session recording where appropriate, and a documented exception process.

A useful review of any service rule answers five questions in sequence. Who originates it? The source can be a subnet, workload, or managed identity depending on enforcement capability. Where does it go? The destination should be specific enough to avoid granting unrelated access. What communication is necessary? Include protocol and destination port, but do not mistake those for application verification. How is it authorized? Consider both network policy and service-level authentication. How will failure or misuse be detected? Define useful logs and alert conditions before the incident happens.

These decisions fit the broader logic of zero-trust access: proximity on a trusted-looking network is not enough to grant continued access. A firewall can enforce boundaries, but continuous confidence depends on identity, device and resource context, and a response when conditions change. The important lesson for this page is that port rules should reflect justified services, not inherited assumptions about where trustworthy machines live.

Reviewing a rule also requires testing its effect. A newly restricted port can break monitoring, DNS resolution, or legitimate recovery connections if the team has not mapped dependencies. Validate the intended application path, verify that unwanted traffic is denied, document any exceptions, and have a rollback approach for operational failures. An audit trail that connects a change request to actual traffic evidence is more useful than a spreadsheet containing ports with no explanation of why they remain open.

Investigate what the connection actually means

Case one: repeated RDP activity after hours. A firewall reports multiple inbound attempts to TCP 3389 on a sensitive server. Do not conclude that an attacker authenticated; the rule might have blocked every attempt. First establish whether the traffic reached the RDP service, then compare host authentication events, gateway records, source network, account identity, and maintenance schedules. An unapproved public exposure calls for immediate risk containment even if all authentication attempts failed. A successful session from a managed gateway during an approved change window demands a different assessment.

Case two: unusual DNS traffic from a workstation. The network sensor observes frequent queries with long, changing labels. That can be consistent with tunneling or automated service discovery, but it can also reflect ordinary application behavior. Check the resolver, query patterns, response codes, time correlation, endpoint process, and related outbound connections. Determine whether approved controls saw the same traffic; an unexplained shift to encrypted DNS should prompt a configuration and visibility review, not an automatic malware verdict.

Case three: a large outbound transfer over HTTPS. TCP 443—or UDP 443 for HTTP/3—does not reveal the destination’s purpose. A data synchronization service and unauthorized exfiltration may share the same transport. Validate the destination, workload owner, data sensitivity, user activity, and transfer schedule; correlate proxy or network-flow evidence with endpoint and application records. A security information and event management system is valuable when it joins these sources into a coherent timeline. The mechanics of event correlation deserve their own treatment; here the point is that port observations acquire meaning only when tied to an actual event sequence.

Across all three examples, preserve the distinction between observation, hypothesis, and confirmed outcome. Write the observation as narrowly as the data permits: “Repeated external connection attempts were denied on TCP 3389” is more defensible than “The server was breached through RDP.” Then identify what evidence would change the assessment. This habit improves both incident reports and day-to-day decisions about what to permit, restrict, or investigate.

The standard for a defensible network decision

Ports help you find the right conversation. Protocols tell you what that conversation is intended to do. Neither replaces proof of the service, the access entitlement, or the behavior seen in the environment. When a new service is requested, confirm its intended role, follow the actual connection path, secure its authentication and transport, restrict its exposure, and specify what operational evidence will demonstrate that the policy works.

For CompTIA Security+ SY0-701 preparation, the practical objective is not a longer list of numbers. It is the ability to distinguish a normal service dependency from an unnecessary exception, explain why one transport or protocol suits a requirement, and recognize when a familiar port is being misused. The strongest answer to “Should this port be open?” begins with the system’s purpose and ends with verifiable controls—not with the number alone.

Filed under Cybersecurity