/magspoof_flipper

Port of Samy Kamkar's MagSpoof project (http://samy.pl/magspoof/) to the Flipper Zero. Enables wireless emulation of magstripe data, primarily over GPIO, with additional experimental internal TX.

Primary LanguageCMIT LicenseMIT

MagSpoof for the Flipper Zero

MagSpoof-ing, as coined / invented by Samy Kamkar, is the use of an electromagnet to emulate the data on a traditional magstripe card — wirelessly!

This app ports the original MagSpoof project to the Flipper Zero, adding file management and emulation controls, along with some experimental features. Visit the Wiki for information on getting started.

Tip

After the first launch of the app, the /apps_data/magspoof/ folder will be created on your Flipper's SD card, and populated with sample .mag files. Place your own files here, using the sample files as a template.

Warning

Use responsibly, and at your own risk. MagSpoof is intended solely for authorized security audits and educational purposes. Ensure legal compliance and obtain necessary permissions before using this tool.

I neither condone nor am sympathetic to malicious uses of my code.

TX Module

The GPIO module is a simple electromagnet consisting of an H-bridge, a capacitor, and a coil. One can build the pictured circuit, or purchase a MagSpoof board from the community. There is no "official board", but the following are popular choices:

Important

The linked boards do not read magstripes, they solely emulate.

Tip

Positioning can be finicky, especially on readers with significant EMF shielding. Situating the corner of one's coil over the read-head tends to give the most consistent results; try a few different angles / depths / positions until you find the sweet spot for your module.

Wiring diagram

A7, A6, and A4 are the default pins used by the app, but can be changed in the app's settings for custom boards.

Skunkworks and Experimental Features

Additional efforts have been made towards internal TX over the RFID / NFC / RF / Piezo systems. While there has been some success with internal TX being picked up/detected by more compact mag readers such as Square, it typically cannot produce a strong enough field for any reader I've tested to decode/parse all the transmitted data properly; as such, all alternate internal TX options are hidden behind debug mode. Old testing, notes, ideas, and planning can be found in NOTES.md.

There exists a Read scene in the app courtesy of hummusec. This is untested, and exclusively for use with UART magstripe readers; hence, as with the experimental internal TX, it is locked behind debug mode and intended only for developers. There do not exist any purchase-able / manufactured boards that include a reader. Independently, I am working on creating a general USB host for the Flipper using a MAX3421E; if and when this is completed one will be able to use a generic USB magstripe reader with the app, however, there is still much to do before this is ready.

Caution

If using experimental internal TX — while in my testing I've seen no reason to believe this could damage the RFID (or other) hardware, this is inherently using those systems in ways they were neither designed nor intended for; I take no responsibility for fried/bricked Flippers.

Credits

This project interpolates work from Samy Kamkar's original MagSpoof project, Alexey D. (dunaevai135) & Alexandr Yaroshevich's Flipper hackathon project, and the Flipper team's LF RFID and SubGhz apps.

Many thanks to everyone who has helped in addition to those above, most notably:

  • arha for bitmapping work, skunkworks testing, and innumerable suggestions/ideas/feedback (now a collaborator!)
  • Zalán Kórósi (Z4urce) for an earlier app icon
  • Salvatore Sanfilippo (antirez) for bitmapping suggestions and general C wisdom
  • skotopes for RFID consultation
  • Tiernan (NVX) + dlz for NFC consultation
  • davethepirate for EE insight and acting as a sounding board
  • cool4uma for their work on custom text_input scenes
  • hummusec for testing of UART RX
  • xMasterX and WillyJL for keeping the app updated across API changes while I was away!
  • Everyone else I've had the pleasure of chatting with!