Skip to main content

CLI for interacting with Mifare Classic 1K cards using an ACR122U NFC reader.

Project description

RFID Client

This is a command-line interface (CLI) application for interacting with Mifare Classic 1K cards using a NFC reader.

Installation

git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
pip install -r requirements.txt

Usage/Examples

# Read the UID of the card
python cli.py --read_uid

# Identify the card to the user
python cli.py --identify

# Read a block from the card using key type A and key value ffffffffffff
python cli.py --read_block 2 --key_type A --key_value ffffffffffff

# Write "Hello, World!" to block 3 using key type B and key value a1b2c3d4e5f6
python cli.py --write_block 3 --data "48656C6C6F2C20576F726C6421" --key_type B --key_value a1b2c3d4e5f6

# Read sector 1 from the card using key type A and key value ffffffffffff
python cli.py --read_sector 1 --key_type A --key_value ffffffffffff

# Read all 16 sectors from the card using key type B and key value a1b2c3d4e5f6
python cli.py --read_full --key_type B --key_value a1b2c3d4e5f6

# Find keys for a Mifare Classic card (requires mfoc binary)
python cli.py --find_mifare_keys

# Brute force keys for block 18 using the key list file keys.txt
python cli.py --brute_force_keys 18 --key_list mifare_access_keys_top100.lst

# Mute the buzzer on the reader
python cli.py --mute

# Provide the flag option
python cli.py --flag

# Enable the buzzer on the reader
python cli.py --beep

# Set the log level to DEBUG
python cli.py --log_level DEBUG

# Send an APDU command to the NFC device
python cli.py --apdu_command 00A4040007A000000003101000

# Set the data format to string
python cli.py --data_format string

API Reference

The main class in this project is RFIDClient which provides methods to interact with the NFC reader and the Mifare Classic 1K card.

Contributing

Installation

To install the RFID Client application, follow the steps below:

  1. Clone the repository using the following command:
git clone https://github.com/VinnieV/crid.git
  1. Navigate to the cloned repository:
cd crid
  1. If you have Python 3 installed, pip3 should be available. If not, you can install Python 3 and pip3 by following the instructions provided in the links below:

  2. Install the application using pip3. There are two ways to install pip packages: as a user or system-wide. Choose the appropriate method based on your requirements: System-wide:

pip3 install .
**User-wide**:
pip3 install . --user
  1. Add the Python Scripts directory to your PATH environment variable. This step is necessary to ensure that the crid binary is accessible from anywhere in the command prompt or terminal. The process for adding the Python path to the PATH variable differs between Windows and Linux:

    • Windows:
      • Open the Start menu and search for "Environment Variables".
      • Click on "Edit the system environment variables".
      • In the System Properties window, click on the "Environment Variables" button.
      • In the "System Variables" section, select the "Path" variable and click on "Edit".
      • Execute the following command to retrieve the path:
pip3 show crid
      - Then the path should look something similar like this:
c:\users\<username>\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\Scripts
     - Click "OK" to save the changes.

 - **Linux**:
     - Open a terminal window.
     - Obtain the path of tool:
pip3 show crid
     - Edit the `.bashrc` or `.bash_profile` file in your home directory using a text editor (e.g., `nano ~/.bashrc`).
     - Add the following line at the end of the file, replacing `/path/to/python` with the actual path to the Python installation directory:
export PATH="/path/to/python:$PATH"
     - Save the file and exit the text editor.
     - Run the following command to apply the changes:
source ~/.bashrc

Once you have completed these steps, you should be able to use the RFID Client application successfully.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crid-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

crid-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file crid-0.1.0.tar.gz.

File metadata

  • Download URL: crid-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for crid-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e3188ad7fba77acc6407b65578b9b764bc1bbe43b80c0f57f4151bed9af32e3c
MD5 00835bfeb8388a694990a9e15b8ef925
BLAKE2b-256 af406bd92bf877dbce1de5641f01322aeda4f127da17c637fc4859d14ab82f9e

See more details on using hashes here.

File details

Details for the file crid-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: crid-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for crid-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec2545d0381707e5d678248f9dbd91e6884ce352e6eb9588e7f588f8837f3e4a
MD5 7854a8f7aca6d6c39b7d15b0ebf7c37e
BLAKE2b-256 d9dd0d997df64cf27c58e3ba603c9555c3d53e9c4f42200ed9dc6f0482db9947

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page