TFTP
The Trivial File Transfer Protocol moves files over UDP with no login and no encryption. It is used to network-boot computers (PXE) and to load firmware and configuration onto network devices and IP phones.
- OSI layer
- 7 Application
- Carried in
- UDP
- Ports
- 69/udp (request), random high ports (transfer)
- Wireshark filter
tftp- Encrypted
- no
Packet structure
Select a field to see what it does.
The other packets are even simpler: DATA = opcode 3, block number (2 bytes), data (0 to 512 bytes); ACK = opcode 4, block number; ERROR = opcode 5, error code (2 bytes), message, 0.
How it works
sequenceDiagram
participant C as Client :50123
participant S as Server :69
C->>S: RRQ "pxelinux.0" octet (to port 69)
Note over S: Server picks a new port, e.g. 41000
S->>C: DATA block 1, 512 bytes (from :41000)
C->>S: ACK 1
S->>C: DATA block 2, 512 bytes
C->>S: ACK 2
S->>C: DATA block 3, 200 bytes (less than 512 = last block)
C->>S: ACK 3
- Lock-step: each DATA block must be acknowledged before the next is sent (unless
windowsizeis negotiated), so TFTP is slow over long distances. - New port per transfer: only the first packet goes to port 69; the server answers from a random port, and the rest of the transfer uses that pair. Firewalls need a TFTP helper to allow it, and Wireshark follows it automatically.
- End of file: a DATA block shorter than the block size.
- No authentication, no directory listing, no encryption. The server only checks whether the file exists and whether writing is allowed.
Typical uses: PXE boot (DHCP options 66 and 67 name the TFTP server and boot file), firmware upgrades, IP phone provisioning, and router and switch configuration backups.
In Wireshark
| Filter | Shows |
|---|---|
tftp | All TFTP (including the transfer on high ports) |
tftp.opcode == 1 | Read requests (downloads) |
tftp.opcode == 2 | Write requests (uploads to the server) |
tftp.source_file | Requested file names (add as a column) |
tftp.opcode == 5 | Errors (file not found, access violation) |
tftp.source_file contains "confg" || tftp.destination_file contains "confg" | Cisco configuration files |
tftp.source_file contains ".." | Path traversal attempts |
File › Export Objects › TFTP saves the transferred files.
What normal looks like: PXE clients and phones downloading from a known provisioning server, network devices backing up configs to the management server. TFTP to or from the internet, write requests from workstations, many read requests for guessed file names (a TFTP brute force for configs), or .exe and script files over TFTP are suspicious.
Security notes
- No authentication: anyone who can reach the server can read any file it serves, and write if writing is enabled. Device configs on a TFTP server often contain password hashes, SNMP communities and VPN keys.
- Config theft via SNMP: with a read-write SNMP community, an attacker can tell a Cisco device to copy its running config to the attacker’s TFTP server.
- Malware staging: TFTP clients exist on Windows (optional feature), Linux and most network devices; attackers use them to pull tools or push stolen data, often in IoT exploits.
- PXE attacks: a rogue DHCP or TFTP server can hand out a malicious boot image; unattended install files on the server can contain credentials.
- Path traversal: buggy servers accept
../in file names and serve files outside their directory. - Amplification: small requests that trigger many DATA retransmissions to a spoofed source.
- Fix: restrict TFTP servers to management VLANs, make them read-only, prefer SCP, SFTP or HTTPS for configs and firmware.
Versions and related
- RFC 1350 (1992) is the base protocol; options came later (RFC 2347 to 2349, RFC 7440 for windowing).
- PXE uses DHCP plus TFTP; iPXE and UEFI HTTP boot can use HTTP(S) instead.
- FTP is unrelated apart from the name: it has logins and runs over TCP.
- Runs over UDP. Often triggered via SNMP on network devices.