Lesson 21 of 32 · ~22 min
SSH, FTP, SMTP, SMB and RDP
Admin and file/mail services — secure vs risky.

Network Protocols and Services
SSH, Mail, SMB, SNMP, NTP, and Secure vs Insecure Services
Course: Network Security
Level: Beginner
Module: Network Security and Monitoring
Estimated Duration: 90–110 minutes
1. Learning Objectives
By the end of this lesson, you will be able to:
- Explain what network protocols and services are.
- Understand the difference between a protocol, service, and port.
- Identify common network protocols and their default ports.
- Differentiate between SSH and Telnet.
- Understand FTP, SFTP, and FTPS.
- Explain SMTP, POP3, and IMAP.
- Understand SMB and NFS file-sharing services.
- Explain SNMP and NTP.
- Understand LDAP and Kerberos fundamentals.
- Identify insecure protocols and their security risks.
- Recognize exposed network services.
- Apply basic service hardening and monitoring practices.
2. What Are Network Protocols?
A network protocol is a defined set of rules that determines how devices communicate and exchange information over a network.
Protocols define things such as:
- Message formats.
- Communication procedures.
- Data exchange rules.
- Error handling.
- Authentication mechanisms.
- Session management.
Without protocols, different devices and applications would not have a common way to communicate.
Real-world example
Imagine an organization with:
- Employee computers.
- Email servers.
- File servers.
- Database servers.
- Network switches.
- Routers.
- Printers.
Each system uses different protocols to communicate.
Examples:
- SSH for secure remote administration.
- HTTPS for secure web communication.
- SMTP for sending email.
- IMAP for accessing email.
- SMB for Windows file sharing.
- SNMP for network monitoring.
- NTP for time synchronization.
- LDAP for directory services.
3. What Is a Network Service?
A network service is a software function that provides a capability to other systems over a network.
Examples:
- A web server provides web content.
- An SSH server provides secure remote administration.
- An SMTP server handles email transmission.
- An SMB server provides file sharing.
- An NTP server provides time synchronization.
A service typically listens for incoming communication on a network interface and uses one or more protocols and ports.
Protocol vs Service vs Port
These terms are related but different.
| Term | Meaning | Example |
|---|---|---|
| Protocol | Rules for communication | SSH |
| Service | Software providing a function | OpenSSH server |
| Port | Logical communication endpoint | TCP 22 |
Example:
An administrator connects to a Linux server using SSH.
- Protocol: SSH.
- Service: SSH server.
- Transport: TCP.
- Default port: 22.
Important: A port being open does not prove that a service is secure or vulnerable. It only indicates that something is accepting or handling traffic at that endpoint.
4. Common Network Protocols and Ports
The following table contains commonly encountered default ports.
| Protocol / Service | Default Port | Transport | Purpose |
|---|---|---|---|
| FTP – Control | 21 | TCP | File transfer |
| FTP – Data | 20 (active mode) | TCP | Traditional active FTP data |
| SSH | 22 | TCP | Secure remote administration |
| Telnet | 23 | TCP | Remote terminal access |
| SMTP | 25 | TCP | Mail server transfer |
| DNS | 53 | TCP/UDP | Name resolution |
| DHCP Server | 67 | UDP | IPv4 address assignment |
| DHCP Client | 68 | UDP | IPv4 address assignment |
| HTTP | 80 | TCP | Web communication |
| POP3 | 110 | TCP | Email retrieval |
| NTP | 123 | UDP | Time synchronization |
| IMAP | 143 | TCP | Email access |
| SNMP | 161 | UDP | Network monitoring and management |
| SNMP Trap | 162 | UDP | Monitoring notifications |
| LDAP | 389 | TCP/UDP | Directory services |
| HTTPS | 443 | TCP | Secure web communication |
| SMB | 445 | TCP | Windows file and printer sharing |
| SMTPS / Submission over implicit TLS | 465 | TCP | Secure email submission |
| SMTP Submission | 587 | TCP | Client email submission |
| LDAPS | 636 | TCP | LDAP over TLS |
| IMAPS | 993 | TCP | IMAP over TLS |
| POP3S | 995 | TCP | POP3 over TLS |
| NFS | 2049 | TCP/UDP | Network file sharing |
Port note: These are common defaults, not guaranteed configurations. Services can use non-standard ports, and modern implementations may support different transport options.
5. SSH – Secure Shell
SSH stands for Secure Shell.
SSH is a protocol used to securely access and administer remote systems over an IP network.
It is widely used by:
- Linux administrators.
- Developers.
- DevOps engineers.
- Network administrators.
- Security professionals.
SSH commonly uses TCP port 22.
5.1 How SSH Works
Suppose an administrator wants to manage a Linux server remotely.
Server IP:
192.168.10.20
The administrator executes:
ssh admin@192.168.10.20
A simplified process:
- The client connects to the SSH server.
- Both sides negotiate supported cryptographic algorithms.
- The server proves its identity using its host key.
- The client validates the server's host key.
- The user authenticates.
- An encrypted SSH session is established.
- The administrator can execute permitted commands.
5.2 SSH Authentication Methods
Common authentication methods include:
Password authentication
The user provides a username and password.
Public-key authentication
The client proves possession of a private key corresponding to an authorized public key.
Certificate-based authentication
SSH certificates can be used to manage identity and access in larger environments.
5.3 SSH Security Best Practices
- Use strong authentication.
- Prefer public-key authentication where appropriate.
- Protect private keys with suitable permissions and passphrases.
- Disable direct root login where practical.
- Restrict access to authorized users.
- Use modern cryptographic algorithms.
- Keep SSH server software updated.
- Monitor authentication logs.
- Restrict SSH access through firewalls or management networks.
Security note: Changing SSH from port 22 to another port may reduce background scanning noise, but it is not a substitute for authentication and access controls.
6. Telnet – An Insecure Remote Access Protocol
Telnet is an older protocol used for remote terminal communication.
Its traditional default port is TCP 23.
Why Is Telnet Insecure?
Traditional Telnet does not provide encryption.
Communication may expose:
- Usernames.
- Passwords.
- Commands.
- Session data.
If an attacker can capture traffic on the communication path, sensitive information may be exposed.
Telnet vs SSH
| Feature | Telnet | SSH |
|---|---|---|
| Default port | TCP 23 | TCP 22 |
| Encryption | No built-in encryption | Encrypted session |
| Server authentication | Limited traditional mechanisms | Host-key verification |
| Secure remote administration | Not recommended | Recommended |
| Modern use | Legacy or isolated environments | Widely used |
Security Recommendation
Do not use Telnet for remote administration across untrusted networks.
Use SSH or another secure management method.
7. FTP – File Transfer Protocol
FTP is a protocol used to transfer files between a client and a server.
Traditional FTP commonly uses:
- TCP 21 for control.
- TCP 20 for data in active mode.
FTP can use different data connections depending on active or passive mode.
7.1 How FTP Works
A simplified process:
- The client connects to the FTP server.
- The client authenticates.
- The client requests file operations.
- The server establishes or negotiates a separate data connection.
- Files are transferred.
7.2 Active vs Passive FTP
Active FTP
The server initiates the data connection back towards the client.
This can create problems when the client is behind NAT or a firewall.
Passive FTP
The client initiates both the control and data connections.
Passive mode is often easier to use through client-side NAT and firewalls, although the server must permit its configured passive port range.
7.3 FTP Security Risks
Traditional FTP does not encrypt usernames, passwords, or file contents.
This creates risks such as:
- Credential exposure.
- Data interception.
- Unauthorized file access.
- Modification of transferred files.
8. SFTP vs FTPS
SFTP and FTPS both provide secure file-transfer capabilities, but they are different protocols.
8.1 SFTP
SFTP stands for SSH File Transfer Protocol.
SFTP operates over the SSH protocol and commonly uses TCP port 22.
It supports secure file operations such as:
- Uploading files.
- Downloading files.
- Renaming files.
- Deleting files.
- Listing directories.
- Managing remote file permissions where supported.
8.2 FTPS
FTPS is FTP protected using TLS.
It commonly operates in two modes:
- Explicit FTPS: Starts with FTP and upgrades the connection using TLS.
- Implicit FTPS: Uses TLS from the beginning, commonly associated with TCP port 990.
FTPS may require additional data-channel port configuration.
Comparison
| Feature | FTP | SFTP | FTPS |
|---|---|---|---|
| Security | No built-in encryption | Encrypted through SSH | Protected using TLS |
| Common port | 21 | 22 | 21 explicit, 990 implicit |
| Underlying protocol | FTP | SSH-based protocol | FTP with TLS |
| Separate data channel | Yes | Uses SSH connection | Yes |
| Recommended for sensitive transfers | No | Yes | Yes, when correctly configured |
Remember: SFTP is not simply FTP with encryption. It is a separate protocol that operates over SSH.
9. Email Protocols
Email communication uses multiple protocols.
Three important protocols are:
- SMTP.
- POP3.
- IMAP.
9.1 SMTP – Simple Mail Transfer Protocol
SMTP is used to send email.
Common ports:
| Port | Purpose |
|---|---|
| 25 | Mail server-to-server transfer |
| 587 | Authenticated message submission |
| 465 | Message submission over implicit TLS |
How SMTP Works
Imagine an employee sends an email to a customer.
- The employee writes the email in a mail client.
- The mail client submits it to an outgoing mail server.
- The server processes the message.
- DNS MX records help identify the recipient's mail server.
- The sending server communicates with the receiving server using SMTP.
- The recipient retrieves the email using IMAP or POP3.
Important: SMTP is used for sending and transferring email. IMAP and POP3 are commonly used for retrieving or accessing received email.
9.2 POP3 – Post Office Protocol Version 3
POP3 is an email retrieval protocol.
Its traditional default port is TCP 110.
POP3S commonly uses TCP 995.
POP3 typically allows a client to download messages from a mail server.
Depending on client settings, messages may be removed from the server after downloading or retained for a configured period.
9.3 IMAP – Internet Message Access Protocol
IMAP is an email access and synchronization protocol.
Its traditional default port is TCP 143.
IMAPS commonly uses TCP 993.
IMAP allows users to manage messages while keeping mailbox state synchronized with the server.
Common features include:
- Multiple folders.
- Message status synchronization.
- Server-side mailbox management.
- Access from multiple devices.
POP3 vs IMAP
| Feature | POP3 | IMAP |
|---|---|---|
| Main purpose | Retrieve/download email | Access and synchronize email |
| Default port | TCP 110 | TCP 143 |
| TLS port | TCP 995 | TCP 993 |
| Multi-device synchronization | Limited by design | Strong support |
| Server-side folder management | Limited | Supported |
Email Security Best Practices
- Use TLS for mail submission and retrieval.
- Require authentication where appropriate.
- Disable insecure legacy authentication.
- Use MFA for user accounts.
- Configure SPF, DKIM, and DMARC.
- Monitor suspicious mail access.
- Restrict administrative access to mail servers.
- Keep mail server software updated.
Important: TLS protects communication between specific endpoints. It does not guarantee that email content is end-to-end encrypted across every mail system.
10. SMB – Server Message Block
SMB is a network protocol used for file and printer sharing and other network resource access.
It is widely used in Windows environments.
Modern SMB commonly uses TCP port 445.
10.1 How SMB Works
Imagine an organization has a shared file server.
Employees access a shared folder:
\\192.168.10.20\CompanyFiles
The SMB client communicates with the SMB server to perform authorized file operations.
Examples include:
- Opening documents.
- Reading files.
- Writing files.
- Creating directories.
- Accessing shared printers.
10.2 SMB Security Risks
Incorrectly configured SMB can create serious risks.
Common issues include:
- Anonymous or guest access.
- Weak credentials.
- Excessive share permissions.
- Unpatched SMB vulnerabilities.
- Exposure to untrusted networks.
- Legacy SMBv1 usage.
10.3 SMBv1 vs SMBv2 vs SMBv3
| Version | Security Consideration |
|---|---|
| SMBv1 | Legacy protocol with significant security weaknesses; disable where possible |
| SMBv2 | Improved protocol design and performance |
| SMBv3 | Adds stronger security features, including encryption support |
SMBv3 supports encryption when configured and supported by the endpoints.
SMB signing can help protect against certain message-tampering and relay scenarios, but it is not the same as encryption.
10.4 SMB Security Best Practices
- Disable SMBv1.
- Use supported SMB versions.
- Require strong authentication.
- Restrict TCP 445 to trusted network segments.
- Apply least-privilege share permissions.
- Use SMB signing where appropriate.
- Enable SMB encryption for sensitive data where supported.
- Patch systems regularly.
- Monitor unusual file-share access.
- Avoid exposing SMB directly to the public internet.
11. NFS – Network File System
NFS is a protocol used to share files and directories across networked systems.
It is commonly used in Linux and Unix environments.
NFS allows a client system to access remote directories as if they were part of its local filesystem.
Example
A Linux server exports a shared directory:
/shared/projects
An authorized client mounts the directory and accesses permitted files.
NFS Versions
- NFSv2: Legacy version.
- NFSv3: Commonly used older version.
- NFSv4: Provides improvements including integrated locking and stronger security capabilities.
NFSv4 commonly uses TCP port 2049.
Older NFS deployments may involve additional services and ports.
NFS Security Risks
- Overly broad export permissions.
- Unauthorized network access.
- Weak identity and authorization controls.
- Insecure legacy configurations.
- Exposure of sensitive shared files.
NFS Hardening
- Prefer supported NFS versions.
- Restrict exported directories to authorized clients.
- Apply least privilege.
- Use appropriate authentication and security mechanisms.
- Restrict network access using firewalls.
- Avoid exporting sensitive directories unnecessarily.
- Monitor mount and file-access activity.
12. SNMP – Simple Network Management Protocol
SNMP is used to monitor and manage network devices.
It is commonly used for:
- Routers.
- Switches.
- Firewalls.
- Printers.
- Servers.
- UPS systems.
- Network monitoring infrastructure.
Common ports:
| Port | Purpose |
|---|---|
| UDP 161 | SNMP queries and responses |
| UDP 162 | SNMP traps and notifications |
12.1 How SNMP Works
SNMP commonly uses three important components.
SNMP Manager
The monitoring system that collects information from devices.
SNMP Agent
Software running on the managed device that provides information.
MIB – Management Information Base
A structured collection of managed objects that can be queried or reported.
<AsyncImage query="SNMP manager agent managed router switch MIB monitoring architecture diagram" aspectRatio="16:9" width="100%"/>12.2 SNMP Versions
SNMPv1
The original version with limited security capabilities.
SNMPv2c
Adds improvements over SNMPv1 but commonly relies on community strings rather than strong user authentication and encryption.
SNMPv3
Provides stronger security capabilities, including authentication and privacy options.
12.3 What Is a Community String?
In SNMPv1 and SNMPv2c, a community string acts like a shared access value.
Common examples found in poorly configured environments include:
publicprivate
These are well-known defaults and should never be used as production secrets.
SNMP Security Risks
- Default community strings.
- Exposed SNMP services.
- Unauthorized device information disclosure.
- Unauthorized management operations.
- Weak network access controls.
- Unencrypted management traffic in older versions.
SNMP Hardening
- Prefer SNMPv3.
- Use strong authentication and privacy settings.
- Restrict SNMP access to approved monitoring systems.
- Change default credentials or community strings where legacy use remains.
- Disable write access unless required.
- Monitor management activity.
- Restrict UDP 161 and 162 at network boundaries.
13. NTP – Network Time Protocol
NTP stands for Network Time Protocol.
It synchronizes system clocks across networked devices.
NTP commonly uses UDP port 123.
Why Is Time Synchronization Important?
Accurate time is essential for:
- Security logs.
- Incident investigation.
- Authentication systems.
- Certificate validation.
- Distributed applications.
- Database consistency.
- Monitoring systems.
- Event correlation in SIEM platforms.
13.1 How NTP Works
A client contacts an NTP server.
The server provides timing information.
The client calculates timing differences and adjusts its local clock according to its synchronization algorithm.
Organizations commonly use a hierarchy of trusted time sources.
NTP Stratum
Stratum describes the distance from a reference clock in an NTP synchronization hierarchy.
Examples:
- Stratum 0: Reference clocks such as GPS or atomic clocks.
- Stratum 1: Servers directly synchronized to reference clocks.
- Stratum 2: Servers synchronized to Stratum 1 systems.
- Stratum 3: Servers synchronized to Stratum 2 systems.
A lower stratum number generally indicates a closer position to the reference clock, but it does not automatically mean better accuracy in every situation.
NTP Security Risks
- Unauthorized NTP configuration.
- Malicious or unreliable time sources.
- Incorrect time synchronization.
- Exposed monitoring and control functions.
- Amplification attacks involving misconfigured legacy NTP services.
NTP Hardening
- Use trusted time sources.
- Configure appropriate NTP authentication where supported.
- Restrict management and control functions.
- Disable unnecessary NTP services.
- Monitor unexpected time changes.
- Avoid exposing unnecessary NTP functionality to the internet.
- Maintain consistent time synchronization across security systems.
Security principle: Incorrect system time can make security investigations significantly harder.
14. LDAP – Lightweight Directory Access Protocol
LDAP is a protocol used to access and manage directory information.
Organizations commonly use directory services to manage:
- Users.
- Groups.
- Computers.
- Organizational units.
- Authentication-related information.
- Access-related attributes.
LDAP commonly uses TCP/UDP port 389, while LDAP over TLS commonly uses TCP port 636.
14.1 What Is a Directory Service?
A directory service stores organized information about users, devices, groups, and other organizational resources.
Imagine a company has 500 employees.
Instead of maintaining separate user databases for every system, the organization may use a central directory.
Applications can query the directory to identify users and retrieve relevant information.
14.2 How LDAP Works
A simplified process:
- A client connects to an LDAP server.
- The client establishes an appropriate secure connection.
- The client authenticates if required.
- The client submits a directory query.
- The server checks access permissions.
- The server returns permitted directory information.
LDAP Security Risks
- Anonymous directory access.
- Unencrypted authentication.
- Weak bind credentials.
- Excessive directory permissions.
- Sensitive information exposure.
- LDAP injection in applications that construct unsafe directory queries.
LDAP Hardening
- Use TLS-protected LDAP connections.
- Disable anonymous access unless explicitly required.
- Apply least-privilege directory permissions.
- Use strong authentication.
- Protect service-account credentials.
- Monitor directory queries and authentication events.
- Keep directory software updated.
15. Kerberos Fundamentals
Kerberos is a network authentication protocol designed to provide secure authentication using tickets.
It is widely used in Microsoft Active Directory environments.
Instead of repeatedly sending a user's password to every service, Kerberos uses tickets to support authentication.
15.1 Important Kerberos Components
Client
The user or device requesting access.
KDC – Key Distribution Center
The trusted system that issues and manages authentication tickets.
AS – Authentication Service
The component that initially authenticates a client and provides a Ticket Granting Ticket.
TGS – Ticket Granting Service
The component that issues service tickets.
Service Server
The server the client wants to access.
Kerberos commonly uses TCP/UDP port 88.
15.2 Simplified Kerberos Authentication Flow
<AsyncImage query="Kerberos authentication flow client authentication server ticket granting ticket TGT service ticket diagram" aspectRatio="16:9" width="100%"/>Step 1 – Initial authentication
The client requests authentication from the Authentication Service.
Step 2 – Ticket Granting Ticket
After successful authentication, the client receives a Ticket Granting Ticket (TGT).
Step 3 – Service ticket request
When the client wants to access a service, it presents the TGT to the Ticket Granting Service.
Step 4 – Service ticket
The TGS issues a ticket for the requested service.
Step 5 – Service authentication
The client presents the service ticket to the destination server.
Step 6 – Access
The server validates the ticket and grants access according to the applicable permissions.
15.3 Why Is Kerberos Important?
Kerberos supports:
- Centralized authentication.
- Mutual authentication in supported exchanges.
- Ticket-based access.
- Reduced need to repeatedly transmit passwords.
- Integration with enterprise identity environments.
Kerberos Security Risks
- Weak passwords.
- Compromised service accounts.
- Misconfigured service principal names.
- Ticket theft.
- Excessive account privileges.
- Incorrect system time.
- Poor Active Directory security.
Kerberos Hardening
- Use strong passwords and managed service accounts where appropriate.
- Apply least privilege.
- Protect domain controllers.
- Maintain accurate time synchronization.
- Monitor suspicious ticket activity.
- Disable obsolete authentication configurations where possible.
- Patch directory infrastructure.
16. Secure vs Insecure Network Protocols
Not every network protocol provides encryption or strong authentication by default.
Understanding the differences helps administrators choose safer alternatives.
| Insecure or Legacy Protocol | Recommended Alternative | Reason |
|---|---|---|
| Telnet | SSH | Encrypted remote administration |
| FTP | SFTP or FTPS | Protected file transfer |
| HTTP | HTTPS | TLS-protected web communication |
| POP3 | POP3S | Encrypted email retrieval |
| IMAP | IMAPS | Encrypted email access |
| LDAP without TLS | LDAPS or StartTLS | Protected directory communication |
| SNMPv1/v2c | SNMPv3 | Stronger authentication and privacy |
| SMBv1 | Supported SMBv2/SMBv3 | Improved security and protocol design |
| Unauthenticated or unprotected NTP management | Securely configured NTP | Reduces manipulation and management exposure |
Important: A protocol's name alone does not prove that a connection is secure. Configuration, certificate validation, authentication, encryption, and implementation quality matter.
For example:
- HTTPS without correct certificate validation can still expose users to impersonation.
- SSH with weak passwords can still be compromised.
- SNMPv3 without privacy settings may not encrypt management data.
- SMBv3 does not automatically mean every share is correctly secured.
17. What Is Service Exposure?
Service exposure occurs when a network service is reachable from a network or device that does not need access to it.
Example:
An organization runs a database server on its internal network.
If its database port is unnecessarily accessible from the public internet, attackers may attempt to:
- Discover the service.
- Identify its version.
- Guess credentials.
- Exploit vulnerabilities.
- Access sensitive information.
- Disrupt availability.
17.1 Common Exposed Services
| Port | Service | Security Concern |
|---|---|---|
| 21 | FTP | Unencrypted credentials and files |
| 22 | SSH | Brute-force attempts and weak authentication |
| 23 | Telnet | Unencrypted remote access |
| 25 | SMTP | Misconfiguration and mail abuse |
| 53 | DNS | Misconfigured DNS services |
| 80 | HTTP | Unencrypted web communication |
| 110 | POP3 | Unencrypted email access |
| 135 | RPC Endpoint Mapper | Unnecessary exposure and attack surface |
| 139 | NetBIOS Session Service | Legacy Windows network exposure |
| 143 | IMAP | Unencrypted email access |
| 161 | SNMP | Device information disclosure |
| 389 | LDAP | Directory information exposure |
| 443 | HTTPS | Web application vulnerabilities |
| 445 | SMB | File-sharing exposure |
| 3389 | RDP | Unauthorized remote-access attempts |
| 3306 | MySQL | Database exposure |
| 5432 | PostgreSQL | Database exposure |
| 6379 | Redis | Unauthorized access if poorly configured |
| 27017 | MongoDB | Database exposure |
A listed port is not automatically vulnerable. Risk depends on the service, its configuration, software version, access controls, and exposure.
18. Service Hardening
Service hardening means reducing the attack surface and strengthening the security configuration of network services.
18.1 Disable Unnecessary Services
If a server does not need FTP, Telnet, or another service, disable it.
Every unnecessary service creates additional maintenance and security requirements.
18.2 Restrict Network Access
Use firewall rules to permit only required source networks and destination services.
Example:
- SSH allowed only from the management network.
- SMB allowed only from authorized internal clients.
- Database connections allowed only from approved application servers.
- SNMP queries accepted only from monitoring systems.
18.3 Use Secure Protocols
Prefer:
- SSH instead of Telnet.
- SFTP or FTPS instead of FTP.
- HTTPS instead of HTTP.
- SNMPv3 instead of SNMPv1/v2c.
- Secure LDAP connections.
- Supported SMB versions with appropriate security settings.
18.4 Authentication and Authorization
- Remove default credentials.
- Use strong passwords.
- Enable MFA where supported.
- Use separate administrative accounts.
- Apply least privilege.
- Review service accounts regularly.
18.5 Patch Management
- Update operating systems.
- Update server software.
- Remove unsupported services.
- Review security advisories.
- Test updates before production rollout where required.
18.6 Logging and Monitoring
Monitor:
- Authentication failures.
- Unexpected service connections.
- Unusual outbound communication.
- Service restarts.
- Configuration changes.
- Unusual file access.
- Privilege escalation events.
19. Network Protocol Security in an Enterprise
Imagine CYNARKS operates an internal network containing:
- Linux application servers.
- Windows file servers.
- Email services.
- Network switches.
- Firewalls.
- Directory servers.
- Database servers.
A secure protocol design could look like this:
| System | Protocol | Access Policy |
|---|---|---|
| Linux servers | SSH | Management network only |
| File servers | SMB3 | Authorized employee VLANs |
| SMTP with TLS | Approved mail servers | |
| Email clients | IMAPS / secure submission | Authenticated users |
| Network devices | SNMPv3 | Monitoring server only |
| Time servers | NTP | Approved network devices |
| Directory services | LDAP over TLS / Kerberos | Authorized internal systems |
| Web applications | HTTPS | Approved client networks |
| Databases | Database-specific secure connections | Application servers and authorized administrators |
Example Firewall Policy
| Source | Destination | Service | Action |
|---|---|---|---|
| Management VLAN | Linux servers | SSH | Allow |
| Employee VLAN | File server | SMB | Allow |
| Guest VLAN | Internal servers | All internal services | Deny |
| Application VLAN | Database VLAN | Required DB port | Allow |
| Monitoring server | Network devices | SNMPv3 | Allow |
| Public internet | Database servers | Database ports | Deny |
Security principle: A service should be reachable only by systems that genuinely require it.
20. Practical Lab 1: Inspect Listening Network Services
Objective: Identify services listening on your own computer.
Windows
netstat -ano
To display listening TCP ports:
Get-NetTCPConnection -State Listen
To inspect listening UDP endpoints:
Get-NetUDPEndpoint
To identify the process associated with a PID:
Get-Process -Id <PID>
Replace <PID> with the process ID shown in the output.
Linux
ss -tulpen
Alternative:
sudo lsof -i -P -n
macOS
lsof -i -P -n
Understand the Output
| Field | Meaning |
|---|---|
| Local Address | Local IP address and port |
| Foreign Address | Remote endpoint |
| State | Connection state, where applicable |
| PID | Process identifier |
| Process | Program associated with the endpoint |
Tasks
- Identify listening TCP services.
- Identify listening UDP services.
- Record the associated process.
- Identify whether each service is required.
- Check whether it listens on localhost, a specific interface, or all interfaces.
- Document any unnecessary service that should be reviewed.
Expected outcome: Understand which services your computer makes available to other systems.
21. Practical Lab 2: Inspect Secure and Insecure Service Configuration
Objective: Review services on an authorized lab server.
Use a lab system you own or administer.
Review:
- SSH configuration.
- FTP or SFTP configuration.
- SMB version and share permissions.
- SNMP version.
- LDAP transport security.
- NTP configuration.
Tasks
- Identify the services currently enabled.
- Record their listening ports.
- Identify whether encryption is enabled.
- Identify authentication requirements.
- Identify permitted source networks.
- Recommend hardening changes.
Expected outcome: Understand how protocol security depends on configuration.
22. Practical Lab 3: Inspect Network Services Using Nmap
Objective: Identify services exposed by an authorized lab machine.
Nmap is a network discovery and service inspection tool.
Only scan systems you own or have explicit authorization to assess.
Scan your own machine:
nmap -sV 127.0.0.1
Scan a dedicated lab server:
nmap -sV 192.168.56.10
Replace the example IP address with the authorized lab server address.
Understand the Options
-sV: Attempts to identify service versions.127.0.0.1: Your local loopback address.192.168.56.10: Example lab host.
Tasks
- Identify open ports.
- Record detected services.
- Compare the results with the expected server configuration.
- Identify unnecessary exposed services.
- Recommend which services should be restricted or disabled.
Important: Service detection results are estimates and may not correctly identify every service or version.
23. Practical Lab 4: Protocol Security Analysis
Objective: Compare secure and insecure communication using a controlled lab.
Use your own test server and client.
Scenario A: HTTP vs HTTPS
Observe the difference between ordinary HTTP and HTTPS.
Discuss:
- Whether the communication is encrypted.
- How certificates help authenticate a server.
- Why certificate validation matters.
Scenario B: Telnet vs SSH
Compare:
- Authentication mechanisms.
- Encryption.
- Host identity verification.
- Suitable administrative use.
Scenario C: FTP vs SFTP
Compare:
- Transport security.
- Authentication.
- File transfer behavior.
- Firewall considerations.
Deliverable
Create a comparison report explaining why secure alternatives are preferred for sensitive communication.
Do not capture or inspect other people's credentials or traffic.
24. Practical Lab 5: Enterprise Service Hardening Assessment
Objective: Prepare a basic service security assessment for a fictional organization.
Environment
The organization has:
- One Linux server.
- One Windows file server.
- One database server.
- One router.
- One managed switch.
- One monitoring server.
Your Tasks
- Identify the required network services.
- Identify unnecessary services.
- Record listening ports.
- Map each service to its business purpose.
- Define which source networks require access.
- Identify insecure or legacy protocols.
- Recommend secure alternatives.
- Define firewall restrictions.
- Define logging requirements.
- Prepare a remediation report.
Expected Deliverable
| Finding | Risk | Recommendation |
|---|---|---|
| Telnet enabled | High | Replace with SSH |
| SMB accessible from guest network | High | Restrict SMB to approved networks |
| SNMPv2c using default community | High | Migrate to SNMPv3 |
| FTP transmits credentials without encryption | High | Replace with SFTP or FTPS |
| Database accessible from unnecessary networks | High | Restrict using firewall policies |
| NTP source not documented | Medium | Configure trusted time sources |
Risk ratings are illustrative and should be adjusted based on actual exposure and impact.
26. Lesson Summary
In this lesson, you learned:
- Network protocols define communication rules.
- Services provide functionality through network communication.
- Ports identify logical communication endpoints.
- SSH is preferred over Telnet for secure remote administration.
- SFTP and FTPS provide secure file-transfer options.
- SMTP sends email, while IMAP and POP3 provide email access.
- SMB and NFS support network file sharing.
- SNMP supports network monitoring and management.
- NTP synchronizes time across devices.
- LDAP supports directory services.
- Kerberos uses tickets for network authentication.
- Secure protocols still require correct configuration.
- Unnecessary service exposure increases the attack surface.
- Service hardening requires least privilege, patching, access restrictions, encryption, and monitoring.
27. Coming Next: Network Attacks and Threats
In the next lesson, you will study common network-based attacks and how defenders detect and prevent them.
Topics include:
- IP spoofing.
- ARP spoofing.
- DNS spoofing.
- MAC flooding.
- DHCP starvation.
- Rogue DHCP servers.
- DoS and DDoS.
- SYN flood.
- Man-in-the-Middle attacks.
- Session hijacking concepts.
- Network reconnaissance.
- Detection and defense strategies.
CYNARKS Academy – Learn to Understand. Practice to Defend.
Practice networking and security testing only on systems you own or have explicit authorization to test.
End of lesson
Quiz · Tasks · Labs
Pass the quiz (≥70%), check off tasks, then mark the lesson complete to earn Foundations badges.
Scenario check
Real situations — apply the lesson logic; avoid pure memorization.
Answer all, then submit1. What is a network protocol?
2. Which protocol is commonly used for secure remote administration?
3. Which protocol traditionally sends credentials without built-in encryption?
4. What is the default TCP port for SSH?
5. Which protocol is used to send email?
6. Which protocol is commonly used to synchronize email across multiple devices?
7. What is the difference between SFTP and FTPS?
8. Which protocol is commonly used for Windows file sharing?
9. Which SNMP version provides stronger authentication and privacy capabilities?
10. What is the default UDP port for NTP?
11. What is LDAP commonly used for?
12. Which protocol uses tickets for network authentication?
13. What is the primary security risk of exposing SMB to untrusted networks?
14. What is the primary purpose of service hardening?
15. Does an open port automatically mean a system is vulnerable?
Lesson tasks
Practice labs
Required labs test this lesson’s skills. Related labs are optional previews.
- RequiredDNS vs ARP & Secure ShellNetworking
- RequiredMail Server RecordNetworking
Finish the quiz and tasks to unlock Mark as completed.