Proxmark3 Easy RFID Tool - Ubuntu setup guide

From Bitbull Wiki
Revision as of 14:03, 5 July 2024 by Chris (talk | contribs)
Jump to navigation Jump to search

1 Complete Setup Guide for Installing Proxmark3 and RfidResearchGroup Proxmark3 on Ubuntu 22.04

1.1 Prerequisites

1. Update and Upgrade System:

   sudo apt update
   sudo apt upgrade -y
   

2. Install Required Dependencies:

   sudo apt-get install --no-install-recommends git ca-certificates build-essential pkg-config \
   libreadline-dev gcc-arm-none-eabi libnewlib-dev qtbase5-dev \
   libbz2-dev liblz4-dev libbluetooth-dev libpython3-dev libssl-dev libgd-dev
   

1.2 Cloning the Repositories

1. Clone the Proxmark3 Repository:

   mkdir -p ~/git
   cd ~/git
   git clone https://github.com/Proxmark/proxmark3.git Proxmark_proxmark3
   

2. Clone the RfidResearchGroup Repository:

   mkdir -p ~/git
   cd ~/git
   git clone https://github.com/RfidResearchGroup/proxmark3.git RfidResearchGroup_proxmark3
   

1.3 Building the Software

1. For Proxmark3:

   cd ~/git/Proxmark_proxmark3
   make clean
   make all
   

2. For RfidResearchGroup:

   cd ~/git/RfidResearchGroup_proxmark3
   make clean
   make all
   

1.4 Setting Up Permissions

1. Add User to Dialout Group:

   sudo usermod -aG dialout $USER
   

2. Setup Access Rights:

   cd ~/git/RfidResearchGroup_proxmark3
   make accessrights
   

3. Disable ModemManager (if applicable):

   sudo systemctl stop ModemManager
   sudo systemctl disable ModemManager
   

1.5 Flashing the Firmware (RfidResearchGroup Only)

1. Install the Proxmark3 client:

   sudo make install
   

2. Flash the BOOTROM & FULLIMAGE:

   pm3-flash-all
   
  If specifying the port manually:
   proxmark3 /dev/ttyACM0 --flash --unlock-bootloader --image bootrom.elf --image fullimage.elf
   

3. Button Trick (if flasher can't detect Proxmark3):

  Unplug Proxmark3, press and hold the button, plug it into USB, release the button. Two LEDs should stay on.

4. Forcing Flashing if Firmware Mismatch:

   pm3-flash-all --force
   

1.6 Running the Client

1. Connect the Proxmark3 device to your computer.

2. Run the Client:

  - For Proxmark3:
     cd ~/git/Proxmark_proxmark3/client
     ./proxmark3 /dev/ttyACM0
     
  - For RfidResearchGroup:
     cd ~/git/RfidResearchGroup_proxmark3/client
     ./pm3
     

1.7 Using Proxmark3 Tools

1.7.1 Basic Operations

1. **Scan for Tags:**

   hf search
   

2. **Read Tag Data:**

   hf mf dump
   

3. **Write Data to Tag:**

   hf mf wrbl -b 1 -d 112233445566
   

4. **Clone a Tag:**

   hf mf cload -f mydump.mfd
   

1.7.2 Emulating Tags

1. **Emulate a Tag:**

   hf 14a sim -u
   

2. **Replay Attacks:**

   hf 14a snoop
   hf 14a list
   

1.7.3 Analyzing Communication

1. **Sniff Communication:**

   hf 14a snoop
   

2. **Analyze Captured Data:**

   hf list 14a reader
   

1.7.4 Security Testing

1. **Brute Force Attacks:**

   hf mf hardnested
   

2. **Exploit Vulnerabilities:**

   hf mf mifare
   

1.8 Lua Scripts for Automation

1. **loop_hf_payment_scan.lua**

   function sleep(n)
       os.execute("sleep " .. tonumber(n))
   end

   while true do
       -- Run the hf search command
       local result = core.console('hf search')

       -- Check if the result is not nil
       if result then
           -- Check the result for known contactless payment card types
           if string.match(result, "Visa") or
              string.match(result, "Mastercard") or
              string.match(result, "American Express") or
              string.match(result, "Apple Pay") or
              string.match(result, "Google Pay") or
              string.match(result, "Samsung Pay") then
              print("Contactless payment card detected:")
              print(result)
           else
              print("No known contactless payment card detected")
           end
       else
           print("No result from hf search command")
       end

       -- Delay between each search (1 second)
       sleep(1)
   end
   

2. **loop_hf_search.lua**

   function sleep(n)
       os.execute("sleep " .. tonumber(n))
   end

   while true do
       -- Run the hf search command
       core.console('hf search')

       -- Delay between each search (1 second)
       sleep(1)
   end
   

1.9 References

- [Proxmark3 GitHub Repository](https://github.com/Proxmark/proxmark3) - [RfidResearchGroup GitHub Repository](https://github.com/RfidResearchGroup/proxmark3) - [RfidResearchGroup Compilation Instructions](https://github.com/RfidResearchGroup/proxmark3/blob/master/doc/md/Use_of_Proxmark/0_Compilation-Instructions.md)