nfc-emulate-uid(1)
β¨ nfc-emulate-uid β the libnfc example that lets you be ANY tag you wanna be π
okay bestie, so this is nfc-emulate-uid(1), one of the examples that ships with libnfc, and it is lowkey iconic and highkey terrifying. Let's get into it. π
πΈ NAME πΈ
nfc-emulate-uid β an NFC target emulation command line tool based on libnfc
π¦ SYNOPSIS π¦
nfc-emulate-uid [OPTIONS] [UID]
β¨ DESCRIPTION β¨
So nfc-emulate-uid is a tag emulation tool, and the whole point is that you get to pick any tag UID you want. Tag emulation is literally one of the main added features in NFC, periodt. But β and this is the tea β to stop people from abusing existing systems, the manufacturers of the NFC controller intentionally did NOT support emulating a fully customized UID. They only let you do "random" UIDs, which always start with 0x08. π
And nfc-emulate-uid is here to demonstrate that you can still do it anyway by transmitting raw frames, and the UID you want can optionally be specified. Which makes this thing a serious threat for security systems that rely only on the uniqueness of the UID. not me exposing your whole threat model π
Unfortunately, this example can't directly start in fully customisable target mode. Just after launching it, you'll have to go through the hardcoded initial anti-collision with the 0x08-prefixed UID. To achieve that, you can e.g. send a RATS (Request for Answer To Select) command by using a second NFC device (placed in target's field) and launching nfc-list or nfc-anticol. After this first step, you now have a NFC device (configured as target) that really emulates a custom UID. You could view it using the second NFC device with nfc-list. slay. β¨
Timing control is very important for a successful anti-collision sequence, bestie. Listen up:
- The emulator must be very fast to react: using the ACR122 device gives many timing issues, "PN53x only" USB devices also give some timing issues, but an embedded microprocessor would probably improve greatly the situation. π
- The reader should not be too strict on timing (the standard is very strict). The OmniKey CardMan 5321 is known to be very large on timings and is a good choice if you want to experiment with this emulator with a tolerant reader. Nokia NFC 6212 and Pegoda readers are much too strict and won't be fooled. π
π OPTIONS π
UIDβ 8 hex digits format that represents desired UID (default isDEADBEEF). yes the default is literallyDEADBEEF, the devs knew exactly what they were doing π
π₯ IMPORTANT π₯
ACR122 devices (like touchatag, etc.) can be used by this example (with timing issues), but if something goes wrong, you will have to unplug/replug your device. This is not a libnfc's bug β this problem is due to ACR122's internal MCU in front of the NFC chip (PN532). so don't come for libnfc, come for the MCU π
π§ BUGS π§
Please report any bugs on the libnfc issue tracker at:
https://github.com/nfc-tools/libnfc/issues
π LICENCE π
libnfc is licensed under the GNU Lesser General Public License (LGPL), version 3.
libnfc-utils and libnfc-examples are covered by the the BSD 2-Clause license.
(and yes, the original says "the the", I'm not fixing it, it's part of the lore π«Ά)
π AUTHORS π
Roel Verdult <roel@libnfc.org>
This manual page was written by Romuald Conty <romuald@libnfc.org>. It is licensed under the terms of the GNU GPL (version 2 or later).
k byeeee β this lil page came out of the libnfc era on June 26, 2009, and honestly? it ate. go forth and emulate responsibly bestie πβ¨π
π¦ where this page comes from
- alpine 3.24: libnfc-doc 1.8.0-r2 Β· LGPL-3.0-or-later
- arch rolling: libnfc 1.8.0-4 Β· LGPL-3.0-or-later
- debian bookworm: libnfc-examples 1.8.0-2 Β· LGPL-3.0-only
- debian trixie: libnfc-examples 1.8.0-3.1+b1 Β· LGPL-3.0-only
- fedora 43: libnfc-examples 1.8.0-12.fc43 Β· LGPL-3.0-or-later
- fedora 44: libnfc-examples 1.8.0-13.fc44 Β· LGPL-3.0-or-later
- nixos 26.05: libnfc 1.8.0
- nixpkgs unstable: libnfc 1.8.0
- ubuntu jammy: libnfc-examples 1.8.0-2 Β· LGPL-3.0-only
- ubuntu noble: libnfc-examples 1.8.0-3.1build1 Β· LGPL-3.0-only
- ubuntu questing: libnfc-examples 1.8.0-3.1build1
- ubuntu resolute: libnfc-examples 1.8.0-3.1build2 Β· LGPL-3.0-only
- ubuntu stonking: libnfc-examples 1.8.0-3.1build2 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms