Skip to content

A project showcasing NFC vulnerabilities via replay attacks. Learn how intercepted NFC data is captured, stored, and replayed to exploit security gaps. Includes tools and guides. Created by an ethical hacker and cybersecurity student to raise awareness and improve NFC security.

License

Notifications You must be signed in to change notification settings

AbdulCyber-sec/NFC_Hacking_Using_Replay_Attack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NFC_Hacking_Using_Replay_Attack

  • A project showcasing NFC vulnerabilities via replay attacks. Learn how intercepted NFC data is captured, stored, and replayed to exploit security gaps. Includes tools and guides. Created by an ethical hacker and cybersecurity student to raise awareness and improve NFC security.
  • A robust and innovative solution for NFC card verification and POS machine transactions. This project includes a secure database for managing card data and verifying authenticity to prevent replay attacks.

Badge: Version Badge: License Badge: Status

Ethical Use Disclaimer

This project is strictly for educational purposes and adheres to ethical hacking principles. It is not intended for unauthorized or malicious activities. The author is a student of ethical hacking and cybersecurity, committed to enhancing security awareness and developing secure systems.


Table of Contents


About the Project

This project demonstrates how to implement NFC card verification and prevent REPLAY ATTACK using a my Prototype. It integrates a Flask-based POS system for secure transactions and data management.

- What does your project do?

The project verifies NFC cards, detects clones, and facilitates secure money transactions using a POS machine interface.

- What problems does it solve?

It addresses issues of NFC card cloning and unauthorized transactions by ensuring data authenticity.

- Why did you build this project?

To explore innovative uses of NFC technology in secure financial systems and enhance cybersecurity skills.


Prototype

components

prototype

Features

1. NFC Reader (Arduino-based)

  • Reads NFC card data (UID, type, length, and expiration date).
  • Detects cloned cards using pre-configured known UIDs.
  • Sends NFC data to a Python Flask server over Wi-Fi.
  • Indicates success or failure with an onboard LED.

2. Python Flask Server

  • Receives and stores NFC data into an SQLite database.
  • Serves data as JSON for programmatic access.
  • Provides an intuitive web interface to view stored data in both tabular and card-style formats.

3. Web Interface

  • Table View: Displays all NFC transactions in a clean, sortable table.

  • Card View: Visualizes each NFC card's data in a stylish, animated format.

  • NFC card authentication using PN532 and ESP8266

  • Detection and prevention of cloned NFC cards

  • User-friendly POS machine interface with Flask server

  • SQLite database for secure card data management


Getting Started

Prerequisites

  • Python 3.x
  • Flask framework
  • Arduino IDE
  • PN532 NFC Reader and ESP8266 module

Installation

Hardware Wire Connections

wire connection

Prerequisites

  • Arduino IDE installed.
  • Python 3.x installed.
  • Flask and SQLite libraries.
  • Wi-Fi-enabled hardware (e.g., NodeMCU with ESP8266).

Arduino Setup

  1. Hardware Connection:

    • PN532 NFC module connected to ESP8266 or Arduino as per the pin configuration in the code.
    • LED connected to GPIO13.
  2. Code Upload:

    • Open the Arduino IDE.

    • Replace the placeholder values in the code:

      const char* ssid = "Enter_your_ssid";
      const char* password = "Enter_your_password";
      const char* serverUrl = "Enter_your_ip/save_nfc_data";
      const char* transactionUrl = "Enter_your_ip/save_transaction";
    • Upload the sketch to the ESP8266 or Arduino.

Usage

  1. Connect the PN532 NFC reader to ESP8266 via I2C protocol.
  2. Power on the Arduino-based NFC reader.
  3. Upload the Arduino code for NFC card data reading.
  4. The card data will be:
    • Logged on the Arduino's serial monitor.
    • Sent to the Flask server for storage
  5. Run the Flask server to handle transactions and display the interface.
  6. Use the POS machine webpage for transaction management.

Example to start the Flask server:

#First NFC Reading (open nfc Reader/)
python server.py
#The server will create the "nfc_data.db" file automatically.

#Second NFC Transcation (open nfc Demo transcation pos mechine)
python server.py

Project Structure

  • /ArduinoCode: Contains code for the PN532 NFC reader.
  • /FlaskServer: Flask app for transaction handling and UI.
  • /Database: SQLite database files for card data.
  • /Static: CSS, JavaScript, and images for the UI.
  • /Templates: HTML templates for the POS machine interface.

Contributing

Contributions are welcome! Please fork the repository and create a pull request for any feature additions or improvements.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Contact

For questions or collaborations, please reach out:

About

A project showcasing NFC vulnerabilities via replay attacks. Learn how intercepted NFC data is captured, stored, and replayed to exploit security gaps. Includes tools and guides. Created by an ethical hacker and cybersecurity student to raise awareness and improve NFC security.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published