tftpTrivial File Transfer ProtocolSwitch running-config Transfers & PXE Boots (sw <-> srv tftp UDP 69)
What It Does on the Wire
Zero passwords, UDP 69, and still the fastest way network gear leaks "startup-config" — tftp scripts rrq -> data -> ack block transfers and error codes in seconds.
Trivial File Transfer Protocol (tftp, RFC 1350) transfers VoIP phone firmware, PXE network bootloaders, and legacy router/switch running-config files over UDP port 69 without authentication. Because attackers frequently abuse TFTP to pull cleartext switch configurations (copy running-config tftp:) or stage tools inside OT networks, TFTP monitoring is a staple IDS and NAC control.
FrameAssembly encodes all five RFC 1350 opcodes: Read Request (rrq, Opcode 1), Write Request (wrq, Opcode 2), numbered Data blocks (data, Opcode 3), Block Acknowledgments (ack, Opcode 4), and Error packets (error / err, Opcode 5).
Detect Unauthorized Router Config Exfiltration (running-config)
Simulate tftp wrq filename "core-rtr-confg" mode "octet" or rrq requests to verify Suricata, Zeek, and NDR alerts on UDP 69.
PXE Network Boot & VoIP Phone Provisioning Labs
Pair a dhcp lease with tftp rrq filename "SEP001B21.cnf.xml" + data block 1 + ack block 1 to validate voice VLAN provisioning.
File-Not-Found (errcode 1) Troubleshooting Captures
Generate tftp error errcode 1 errmsg "File not found" replies to test provisioning error handlers.
Minimal Quickstart (tftp_quickstart.frasm)
Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.
host voip_phone { ip 10.20.30.112 }host tftp_srv { ip 10.20.30.10 }compile { voip_phone -> tftp_srv tftp rrq filename "SIPDefault.cnf" mode "octet" wait 2ms voip_phone <- tftp_srv tftp data block 1 payload "[device]\nproxy=10.20.30.5\n" wait 1ms voip_phone -> tftp_srv tftp ack block 1}What the Compiler Calculates So You Don't Have To
- Defaults UDP destination port to
69and writes NUL-terminated (0x00)filenameand transfermode("octet"or"netascii") strings onrrq/wrq. - Encodes 2-byte big-endian Opcode + 2-byte
blocknumber ondata(3) andack(4) packets. - Formats Opcode
5(error/err) with 2-byteerrcodeand NUL-terminatederrmsg.
PXE Bootloader Download + Missing Config File Error
Requests pxelinux.0 in binary "octet" mode, transfers Block 1 with TFTP ack, and then requests a missing board config returning RFC 1350 Error Code 1.
host pxe_host { ip 172.16.50.101 }host boot_srv { ip 172.16.50.10 }compile { // 1. Successful Read Request (RRQ) + Block 1 transfer pxe_host -> boot_srv tftp rrq filename "pxelinux.0" mode "octet" wait 2ms pxe_host <- boot_srv tftp data block 1 hexpayload "7f454c46020101000000000000000000" wait 1ms pxe_host -> boot_srv tftp ack block 1 wait 4ms // 2. Missing profile returns TFTP Error (Opcode 5, Error Code 1 = File not found) pxe_host -> boot_srv tftp rrq filename "pxelinux.cfg/default" mode "octet" wait 2ms pxe_host <- boot_srv tftp error errcode 1 errmsg "File not found"}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show tftp_pxe_boot.frasm
# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly tftp_pxe_boot.frasm tftp_pxe_boot.pcap
frameassembly tftp_pxe_boot.frasm tftp_pxe_boot.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse tftp_pxe_boot.pcap tftp_pxe_boot_edited.frasmAll tftp Keywords & Header Options
Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after tftp:
src_host -> dst_host tftp [rrq | wrq | data | ack | error | err] [filename "<text>"] [mode "<text>"] [block <0..65535>] [errcode <0..65535>] [errmsg "<text>"]| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| rrq | wrq | data | ack | error | err | TFTP opcode keyword | rrq (Opcode 1) | Selects Opcode 1 Read Request (rrq), 2 Write Request (wrq), 3 Data (data), 4 Acknowledgment (ack), or 5 Error (error / err). |
| filename "<text>" | mode "<text>" | Quoted filename and mode ("octet" or "netascii") | filename "boot.bin", mode "octet" | Writes NUL-terminated filename and transfer mode strings in rrq and wrq packets. |
| block <0..65535> | 16-bit block number | 1 | Sets the 2-byte Block Number in data and ack packets (0 acknowledges a wrq). |
| errcode <0..65535> | errmsg "<text>" | RFC 1350 error code (1 File not found, 2 Access violation) + message | errcode 1, errmsg "File not found" | Populates the error code and NUL-terminated error string in error / err packets. |
Cross-Layer Wrappers Valid with tftp
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
10 options
Cross-Layer Wrappers Valid with tftp
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
| Option | Range / Format | Default | Effect on Packet |
|---|---|---|---|
| wait <number><ns|us|ms|s|m> | Time gap (ns, us, ms, s, m) | 10ms | Advances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back). |
| payload "<text>" | hexpayload "<hex>" | Quoted text or hex bytes (choose one) | Omitted | Appends or overrides raw payload bytes ("deadbeef" or "de:ad:be:ef") and updates packet lengths and checksums. |
| srcmac <mac> | dstmac <mac> | Colon, hyphen, or Cisco dot MAC | Host MAC / RFC multicast MAC | Overrides the 14-byte Ethernet II source or destination MAC address for this single packet. |
| vlan <0..4095> [pcp <0..7>] [dei <0|1>] | VLAN ID 0..4095, PCP 0..7, DEI 0..1 | Untagged | Wraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority. |
| qinq <0..4095> [innervlan <0..4095>] | Outer S-VLAN 0..4095, Inner C-VLAN 0..4095 | Untagged (innervlan 1 when qinq is set) | Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100). |
| mpls <0..1048575> [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>] | Label 0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255 | Unlabeled (at most 1 mpls tag per packet) | Inserts a 32-bit MPLS label header (0x8847) ahead of the Layer 3 header. |
| ttl <0..255> [dscp <0..63>] [ecn <0..3>] | TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3 | ttl 64, dscp 0, ecn 0 | Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings. |
| ipid <0..65535> [df] [mf] [fragoffset <0..8191>] | IPv4 ID, DF/MF flags, fragment offset 0..8191 | ipid 1, flags 0, fragoffset 0 | Sets IPv4 Identification, Do-Not-Fragment (df), More-Fragments (mf), and fragment offset (ignored over IPv6). |
| flowlabel <0..1048575> | 20-bit IPv6 Flow Label (0..1048575) | 0 | Sets the 20-bit IPv6 Flow Label for ECMP routing tests (ignored when running over IPv4 hosts). |
| srcport <0..65535> | dstport <0..65535> | Port number 0..65535 | srcport 49152 (remembered), UDP 69 | Overrides source or destination port and remembers the port pair automatically on <- replies. |
Gotchas & Quick Fixes
ack Inside a tftp Packet Emits TFTP Opcode 4 (Not TCP ACK)
voip_phone -> tftp_srv tftp ack block 1On a tftp line, ack builds the 4-byte UDP TFTP Block Acknowledgment (0x0004 + 2-byte block), whereas TCP flags are not allowed on UDP protocols.
Quote Filenames Containing Dots, Slashes, or Hyphens
voip_phone -> tftp_srv tftp rrq filename router-confg.cfgvoip_phone -> tftp_srv tftp rrq filename "router-confg.cfg"Always wrap file paths and names in double quotes ("router-confg.cfg").