networking, updated

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)
Specs
RFC 1350, RFC 2347, RFC 2348, RFC 2349
Wireshark filter
tftp
Encrypted
no

Packet structure

TFTP read / write request4 bytes + variable

Select a field to see what it does.

RFC 1350. Sent by the client to UDP 69. Strings are ASCII and end with a 0 byte. DATA, ACK and ERROR packets use the same 2-byte opcode, then a 2-byte block number or error code.

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

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

FilterShows
tftpAll TFTP (including the transfer on high ports)
tftp.opcode == 1Read requests (downloads)
tftp.opcode == 2Write requests (uploads to the server)
tftp.source_fileRequested file names (add as a column)
tftp.opcode == 5Errors (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

References

§ home
~/knubertus/home/
1,1 Top