Skip to content

1. Understanding MagSpoof

Andrea ZGuz edited this page Sep 21, 2026 · 11 revisions

MagSpoof Overview

Pins MagSpoof V5

Pins MagSpoof 3

  • USB-C compatible: makes an easier and asymmetric connection.
  • 1 status LED: lets you know if the board is in bootloader mode or emulating a magstripe card.
  • 1 CHRG LED: status of charging.
  • SWD pins: for the programmer or debugging.
  • Battery pins
  • Coil pins
  • Switch for turning ON/OFF the board
  • Switch to select BATT/VBUS power supply: now you can choose which power supply to use.

Turning ON MagSpoof

Turning MagSpoof ON is quite simple; just use a single-cell Li-Ion/LiPo battery or plug the USB cable and shift the switch to BATT or VUSB according to the power source you are using, then shift the ON/OFF switch to ON.

MagSpoof and its different modules

MagSpoof features two modules to save and emulate magstripe tracks. Below, you can find the different technologies MagSpoof can work with!

CH552G

Is an enhanced E8051 core MCU compatible with MCS51 instruction set. 79% of its instructions are single-byte single-cycle instructions, and the average instruction speed is 8 ~ 15 times faster than that of the standard MCS51.

CH552 has a built-in analog-to-digital converter (ADC), touch key capacitance detection, 3 sets of timers, signal capture, PWM, 2 UARTs, SPI, USB device controller, a full-speed transceiver, and other function modules.

TC4424

A 3A, dual-output buffer/MOSFET driver has an increased latch-up current rating of 1.5A, making it even more robust for operation in harsh electrical environments.

As MOSFET drivers, the TC4424 can easily charge 1800 pF gate capacitance in under 35 nsec, providing low enough impedances in both the on and off states to ensure the MOSFET's intended state will not be affected, even by large transients.

The TC4424 inputs may be driven directly from either TTL or CMOS (2.4V to 18V). In addition, the 300 mV of built-in hysteresis provides noise immunity and allows the device to be driven from slowly rising or falling waveforms.

Important

Standard Point of Sale (POS) magnetic card readers feature physical hardware heads designed to read Track 1 and Track 2 data simultaneously during a single physical swipe. When using MagSpoof (hardware emulation devices), transmitting Track 1 and Track 2 sequentially rather than simultaneously causes the POS terminal to treat each transmission as a separate swipe event. Because the terminal flushes or overwrites its data buffer after each perceived swipe, it will only process the final track packet received. To ensure transaction success during sequential emulation, targeting Track 2 alone is preferred, as it contains the mandatory financial routing data (PAN, expiration, and service code) required to clear a charge, whereas Track 1 alphanumeric data (cardholder name) is often non-essential.

Magnetic Stripes

MagSpoof with these two ICs can emulate magnetic stripes.

Magnetic stripes (magstripes) are, in fact, magnetic. What is so cool about magstripes is that while the magnetic stripes inside are weak, they are still strong enough to attract small ferrous particles and wide enough that it is possible to fully extract all data from a magstripe or credit card with the naked eye.

In the GIF above, a credit card is dipped into a bag of iron oxide. The magnetic elements in the magstripe attract the iron oxide, and after pulling it out, it is possible to see each bit in the tracks. Financial cards with magnetic strips can have up to three tracks; however, credit cards only have two tracks (Tracks 1 and 2). Track 2 stores fewer bits than Track 1, so it has a lower linear density (bits per inch). This makes Track 2 much easier to see. Let's take a look:

As is visible on the above card picture, there are written bits above the strips. Two solid stripes represent a binary 1, and a stripe followed by a space represents a binary 0. First, let us flip the card 180 degrees (looking at it upside down), and read it as the least significant bit first. We ignore all the initial 0's until the very first 1.

Track 2 is 5 bits per character, the least significant bit first, and the 5th bit is an odd parity bit. By taking each 5 bits and reading the first 4 bits, it is possible to extract the credit card number (and other data, such as expiration date, discretionary data, CVV/CVC/CSC/CID/CAV depending on card type).

Making a comparison with the numbers in the front of the card, they are the same as these shown in the picture above.

Front of card:

Live demonstration and more details are available in the video:

MagSpoof

Based in the work of Samy Kamkar. Point of Contact: @SamyKamkar // code@samy.pl // http://samy.pl

Released: November 24, 2015

MagSpoof Versions

DIY version by Samy Kamkar

  • Atmel ATtiny85: This is the microcontroller to drive the entire system. It stores all of the magnetic stripe/credit card data. In a thinner, credit-card sized (0.8mm thick!) version, the version used was ATtiny10.

  • L293D H-Bridge: For driving the electromagnet. The L293D is a motor driver, but motors are actually driven by the electromagnet(s) and magnets inside them. Any standard driver should work here. Technically, the L293D doesn't work down to 3.7V (the voltage of the LiPo battery), but it works surprisingly well.

  • 24AWG Magnet Wire (coil): This acts as the coil to produce the electromagnetic field. This piece of wire produces an electromagnetic field that makes the card reader believe a card is being swiped. Incredible. By rapidly controlling the polarization of this field, the magstripe reader believes the flipped bits of a real card are being swiped through the reader.

  • 100mAh 3.7V LiPo battery (the power): A small 100mAh 3.7V LiPo battery powers the contraption.

  • 100µF Capacitor: Keep enough energy in this capacitor to provide the electromagnet with power when we need it. Otherwise, it will pull too much current and reset the microcontroller.

  • LED: To signal to us when we transmit information.

  • 100Ω Resistor: to not burn out the LED.

  • Momentary Switch: Initiate the electromagnet.

  • Mini-Protoboard: For soldering everything together.

Hardware V1

  • Atmel ATtiny85: This is the microcontroller to drive the entire system. It stores all of the magnetic stripe/credit card data. In a thinner, credit-card sized (0.8mm thick!) version, the version used was ATtiny10.

  • TC4424 H-Bridge: For driving the electromagnet. The TC4424 is a motor driver, but motors are actually driven by the electromagnet(s) and magnets inside them. Any standard driver should work here. Technically, the TC4424 doesn't work down to 3.7V (the voltage of the LiPo battery), but it works surprisingly well.

  • 24AWG Magnet Wire (coil): This acts as the coil to produce the electromagnetic field. This piece of wire produces an electromagnetic field that makes the card reader believe a card is being swiped. Incredible. By rapidly controlling the polarization of this field, the magstripe reader believes the flipped bits of a real card are being swiped through the reader.

  • 100mAh 3.7V LiPo battery (the power): A small 100mAh 3.7V LiPo battery powers the contraption.

  • 100µF Capacitor: Keep enough energy in this capacitor to provide the electromagnet with power when we need it. Otherwise, it will pull too much current and reset the microcontroller.

  • 100Ω Resistor: To not burn out the LED.

  • Momentary Switch: Initiate the electromagnet.

  • Mini-Protoboard: For soldering everything together.

Hardware V3

  • Atmel SAMD11: This is the microcontroller ARM Cortex M0+ of 32bits to drive the entire system. It stores all of the magnetic stripe/credit card data. In a thinner, credit-card sized (0.8mm thick!) version.

  • TC4424 H-Bridge: For driving the electromagnet. The TC4424 is a motor driver, but motors are actually driven by the electromagnet(s) and magnets inside them. Any standard driver should work here. Technically, the TC4424 doesn't work down to 3.7V (the voltage of the LiPo battery), but it works surprisingly well.

  • 24AWG Magnet Wire (coil): This acts as the coil to produce the electromagnetic field. This piece of wire produces an electromagnetic field that makes the card reader believe a card is being swiped. Incredible. By rapidly controlling the polarization of this field, the magstripe reader believes the flipped bits of a real card are being swiped through the reader.

  • 100mAh 3.7V LiPo battery (the power): A small 100mAh 3.7V LiPo battery powers the contraption.

  • 100µF Capacitor: Keep enough energy in this capacitor to provide the electromagnet with power when we need it. Otherwise, it will pull too much current and reset the microcontroller.

  • 100Ω Resistor: To not burn out the LED.

  • Momentary Switch: Initiate the electromagnet.

  • Mini-Protoboard: For soldering everything together.

  • Coil: SWC4242KB120-100 or WMRR138F-0

Clone this wiki locally