Objectives
- Recognize FTP ports and the differences between Active and Passive modes
- Gain hands-on familiarity with FTP clients (FileZilla)
- Recognize and analyze FTP traffic in Wireshark packet captures
- Identify flaws in server configuration using least privilege and access control principles
- Produce actionable security recommendations for a customer
Tools Used
- FileZilla FTP Client
- Wireshark
- FTP Lab Server
Lab Network
- Client: 192.168.2.168
- Server: 192.168.2.188
- Control port: 21
- Data port: varies
Discussion Prompt
Before we dive in — how many of you have used FTP before? Where have you seen it used in the wild? Think about web hosting, file transfers, legacy enterprise systems.
What is FTP?
FTP — File Transfer Protocol — is one of the oldest application-layer protocols still in widespread use. Defined in RFC 959, it was designed specifically for transferring files between hosts on a TCP/IP network. FTP is a cleartext protocol: all data, including credentials, travels unencrypted. This is its most significant security problem.
Port 21 — Control
Port 21 is the command channel. All FTP commands (USER, PASS, LIST, RETR, STOR) and server responses flow on this connection. The control connection persists for the entire FTP session.
Port 20 — Data (Active)
Port 20 is the data channel used in Active mode. Data transfers (directory listings, file downloads/uploads) use a separate TCP connection established through this port — but only in active mode.
Security Implication
Because FTP sends credentials and data in plaintext over port 21, an attacker with network access can trivially capture usernames, passwords, and file contents. Wireshark will show you exactly this in the lab. SFTP (port 22) and FTPS (port 990) exist as encrypted alternatives — this lab intentionally uses unencrypted FTP to demonstrate the risk.
Active Mode Problem
The server initiates the data connection back to the client. This is problematic when the client is behind a NAT router or stateful firewall — the firewall blocks unsolicited inbound connections. Active mode is largely obsolete in modern networks for exactly this reason.
In the lab: PORT (200x256)+122 — this is the client telling the server which port to connect to (octets 5 and 6 encode the port number).
Passive Mode — Current Standard
Passive mode is the default in modern FTP clients because the client initiates both the control and data connections. This plays nicely with NAT and client-side firewalls. The server must have a range of ports open for data connections — in this lab, that includes port 51322.
Wireshark filter for this lab:
tcp.port == 21 or tcp.port == 51322
Lab Setup — FileZilla
File > Site Manager > New Site. Set encryption to FTP — Insecure (not SFTP or FTPS). Enter the server IP and credentials below. Connect with each account one at a time.
| Account | Password | Role | Flag |
|---|---|---|---|
anonymous |
none required | No authenticated role | REVIEW |
Finance_Bob |
bob |
Analyst 1 — Finance | WEAK PWD |
Finance_Admin |
admin |
Finance Admin / IT Personnel | CRITICAL |
Maintenance_Jill |
Fall2025 |
No Finance association | REVIEW |
khoi |
(provided in lab) | Finance user — low level | OVERPERMISSIONED |
anonymous: Should have restricted or no access. If anonymous login is enabled with any file access, this is a misconfiguration — no authentication means anyone can connect.
Finance_Bob: Analyst-level access. Should see Finance-related files but with read-only scope limited to their function.
Finance_Admin: Broader Finance directory access including admin-level files, consistent with IT/admin role.
Maintenance_Jill: Has no finance association — if she can access Finance directories, that's a least privilege violation. Her scope should be limited to maintenance-relevant files only.
khoi: Low-level finance user who has been granted excessive read AND write permissions across directories that exceed what their role requires. This is the primary finding — they can read and write files beyond their job function.
The concern: excessive write access means khoi could exfiltrate data, modify financial records, or plant files on the server. Even if khoi is a trusted employee today, the principle of least privilege exists precisely because insider threats and compromised credentials are real attack vectors. If khoi's account is compromised, the blast radius is far larger than necessary.
Wireshark Filters for This Lab
tcp.port == 21 or tcp.port == 51322
// Filter by source (client machine)
ip.src == 192.168.2.168
// Filter by destination (FTP server)
ip.dst == 192.168.2.188
After the client sends the PASV command, the server responds with six comma-separated numbers: the IP address (4 octets) and the port (2 octets). The port is calculated as:
port = (octet5 * 256) + octet6Example:
227 Entering Passive Mode (192,168,2,188,200,202)Port = (200 × 256) + 202 = 51402
The client then initiates a new TCP connection to the server's IP on that negotiated port for the data transfer.
Principle of Least Privilege
Every account should have the minimum permissions required to perform its function — no more. Access beyond business need is a vulnerability: it expands blast radius if an account is compromised, increases insider threat risk, and creates compliance exposure.
| Account | Role | Problem? | Concern |
|---|---|---|---|
anonymous |
None | CRITICAL | Unauthenticated access. No business justification for anonymous FTP on a Finance server. |
Finance_Bob |
Analyst 1 | REVIEW | Password is literally "bob" — trivially guessable. Password policy failure. |
Finance_Admin |
IT Admin | CRITICAL | Password is "admin" — default/trivial credential. Admin account with no password security. |
Maintenance_Jill |
Maintenance — no Finance | CRITICAL | No association with Finance. Should not have FTP access to a Finance server at all. |
khoi |
Finance (low-level) | CRITICAL | Read AND write access that exceeds job function. Overpermissioned relative to role. |
khoi: Finance user with read/write access beyond their role. Risk: can exfiltrate or tamper with financial data. If account is compromised via credential theft, attacker inherits write access to Finance server.
Finance_Admin: Admin account with trivial password ("admin"). Risk: credential stuffing or brute force would immediately succeed. Admin-level access = full scope of damage on the server.
anonymous: Any access whatsoever is too much. No authenticated identity means no accountability and no audit trail. Disabling anonymous FTP is a baseline requirement for any production system.
Finding 1 — FTP Cleartext Transmission
CRITICALAll credentials and file contents transmitted over FTP are visible in plaintext on the network. Any attacker with network access can trivially capture usernames, passwords, and data.
Recommendation: Migrate to SFTP (SSH File Transfer Protocol, port 22) or FTPS (FTP over TLS). Disable plain FTP on the server. There is no mitigation that makes plaintext FTP acceptable for financial data.
Finding 2 — Anonymous FTP Enabled
CRITICALAnonymous login is enabled, allowing unauthenticated access to the FTP server. This bypasses all authentication controls and removes accountability from access events.
Recommendation: Disable anonymous FTP immediately. There is no legitimate use case for anonymous access to a Finance file server.
Finding 3 — Trivial / Default Credentials
CRITICALFinance_Bob uses password "bob". Finance_Admin uses password "admin". These are dictionary attack first-guess credentials. The admin account with a trivial password is the highest impact item in this category.
Recommendation: Enforce a password policy: minimum 12 characters, complexity requirements, no username-as-password. Rotate all current credentials. Consider MFA for administrative accounts.
Finding 4 — Role Misalignment (Maintenance_Jill)
HIGHMaintenance_Jill has FTP access to a Finance server with no documented business justification. This violates least privilege and creates unnecessary exposure.
Recommendation: Remove Maintenance_Jill's access. Conduct a full access review: every account on the FTP server should have a documented business owner and access justification.
Finding 5 — Excessive Permissions (khoi)
HIGHkhoi is a low-level Finance user with read and write access that exceeds their job function. Overpermissioning increases blast radius if the account is compromised.
Recommendation: Scope khoi's access to read-only on specific directories required for their role. Apply the same review to all analyst-level accounts.
FTP transmitting credentials and financial data in cleartext on a Finance server is a Critical finding by any standard framework (CVSS, OWASP, NIST). Data confidentiality is completely broken for any attacker with network access — which includes any malicious insider or anyone who has compromised a network device.
How to present to a non-technical customer:
"Imagine every file you send to this server, and every password you use to log in, is written on a postcard. Anyone on the network between your computer and the server can read that postcard. Right now, your employees are sending financial files using the postcard method. We need to switch to a sealed envelope — that's what SFTP does."
Pair the analogy with the business impact: regulatory exposure, potential breach notification requirements (PCI-DSS if payment data is involved, SOX for public company financial data), and reputational risk.
Lab Complete
You've covered FTP fundamentals, active vs passive modes, hands-on user access testing, network traffic analysis in Wireshark, and produced security findings with recommendations. These skills apply directly to security assessments, helpdesk troubleshooting, and network defense work.