NFCity – Tool to inspect and modify NFC card memory

Introduction

NFCity is a simple, open-source, web-based tool for inspecting and modifying memory blocks of NFC/RFID cards. Designed for educational and development purposes, it allows users to explore card memory structure and experiment with reading and writing operations through a clear, user-friendly interface.

The project leverages an ESP32 device with an MFRC522 reader, connected to a web application via MQTT, enabling asynchronous, real-time interaction with NFC cards. NFCity makes understanding NFC technology approachable while keeping the setup lightweight and practical.

Motivation

Working with NFC cards can be complex due to technical datasheets and intricate memory structures. Existing libraries often abstract away these details, which is helpful for general development but limits learning and experimentation.

After upgrading a C library for reading and writing RFID card memory, I thought, why not create an app that makes the debugging process easier and helps others learn more about NFC? The goal was to simplify the experience for both myself and those curious about NFC technology.

If you’ve ever tried manually setting access conditions and permissions on an NFC card, you know it’s a tedious process. NFCity simplifies it – just a few clicks to set permissions for each block. NFCity was created to provide developers and enthusiasts a hands-on experience with NFC memory layout, sector keys, and access conditions, offering both insight and control in a safe, guided environment.

Demo

Here is a short demonstration video:

Architecture

NFCity consists of three main components:

  1. Device: ESP32 microcontroller with MFRC522 reader.
  2. Web Application: Single Page Application (SPA) built with Vue.js.
  3. Messaging Bus: MQTT broker for asynchronous communication.

Communication flow is as follows:

Communication diagram that shows basic messaging flow between Device (ESP32) and Web Application.

This setup ensures that the web application can securely and efficiently interact with the NFC device without requiring direct physical connections.

Web Application

The SPA interface communicates with the ESP32 through the MQTT bus using WebSockets. Key features include:

  • Inspecting card memory blocks
  • Modifying data safely, including sector keys and access bits
  • Retro-hacker visual design with synthwave color palette and monospace font
  • Local storage of configuration for seamless reconnections

The interface simplifies complex memory operations, making experimentation accessible even for beginners.

Live version of NFCity Web Application can be found at https://abobija.github.io/nfcity

Device Setup

Firmware is built with ESP-IDF and uses the MQTT library for communication. After configuring WiFi credentials and MQTT broker information via idf.py menuconfig, the firmware can be built, flashed, and monitored using:

idf.py build flash monitor

A unique root topic is generated per device and used in the web application to ensure messages are delivered correctly.

Usage

  1. Start the web application (locally or via the hosted version).
  2. Copy the root topic from the ESP32 terminal and paste it into the web app configuration form.
  3. Connect to the MQTT broker.
  4. Place an NFC card on the reader to inspect memory blocks and perform read/write operations.
Screenshot with arrow explaining how to pair NFCity web app with Firmware with generated random MQTT topic.

The web app saves settings locally, so the connection persists across sessions.

Support

NFCity works with cards supported by the underlying MFRC522 firmware library. This includes commonly available MIFARE Classic cards.

License

Licensed under Apache License 2.0. See LICENSE for details.

Leave a Reply

Your email address will not be published. Required fields are marked *