Getting Started with MagSpoof using Arduino IDE

March 27, 2017

This guide covers the process of uploading code to the MagSpoof with Arduino IDE.

You will need the following items for this guide:

1. Install Arduino IDE

2. Open Arduino IDE as root. Open a terminal application and navigate to the Arduino IDE folder. Run the following commands inside the Arduino folder.

sudo ./arduino
  • Enter your root password.
  • Arduino IDE should now open.

3. Clone Samy's code with:

git clone https://github.com/samyk/magspoof.git

4. Copy the contents of magspoof.c into a new sketch. Save the new sketch. 

5. Inside Arduino IDE click file –> preferences. In the settings tab at the very bottom you will see an option called "Additional Boards Manager URLs". Enter the following URL.

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
  • Click OK

Arduino IDE Preferences

6. Click Tools –> Board –> Board Manager. Navigate to the bottom and click on the new entry called "attiny by David A. Mellis", select 1.0.1 and click install. Then close Board Manager.

Board - Arduino IDE

Board Manager - Arduino IDE

7. Configure the board settings.

  • Click Tools –> Board and select ATtiny.

Arduino IDE - Board Select MagSpoof

  • Click Tools –> Processor select ATtiny85.

Arduino IDE - Process Select MagSpoof

  • Click Tools –> Clock select 8 MHz (internal).

Arduino IDE - Clock Select MagSpoof

8. Click Tools -> Programmer and select your programmer from the list shown. In this example we are using the Sparkfun AVR Pocket Programmer, and set the programmer to USBtinyISP.

Arduino IDE - Programmer

9. Place the battery inside your MagSpoof and turn it on.

10. Verify the software by clicking the check mark in the top left hand corner.

Arduino IDE - Verify

11. Upload the code by clicking on the arrow. If it completes successfully your MagSpoof is now programmed. 

Arduino IDE - Upload

12. Change the track information highlighted below as follows.

Arduino IDE - Code Change MagSpoof

  • Track 1
"%B4444444444444444^ABE/LINCOLN^291110100000931?\0", // Track 1
  • Track2
";4444444444444444=29111010000093100000?\0" // Track 2

Your code should now look something like this.

Arduino IDE - Track change MagSpoof

Upload the new code to the MagSpoof.

13. Open up a new text document and connect your MagStripe Reader. MagStripe readers pretend to be USB keyboards and will enter text in the document after completing a successful read. Try it by swiping a real credit card.

With your MagSpoof touching the reader, press the button. You should see output similar to the string shown below. Play around with the angle if you are getting different results. 

%4444444444444444=29111010000093100000?+4444444444444444=29111010000093100000?

14. There is a variable in the code called CLOCK_US that controls the speed at which the card data is transmitted. At the current CLOCK_US you only get the second track, if you change the CLOCK_US to 120 you should get the first track. This is due to the variable bit densities of track data. 

%B4444444444444444^ABE/LINCOLN^291110100000931?#B4444444444444444^ABE/LINCOLN^291110100000931?

15. Change the following code and add your credit card information below. We recommended swiping your card with the MagStripe Reader and copying and pasting the output.

Arduino IDE - Your Credit Card MagSpoof

If you have any questions related to this blog please email us at support@ryscc.com.






Also in Blog

Getting Started with MagSpoof R3 firmware on macOS
Getting Started with MagSpoof R3 firmware on macOS

April 25, 2017

Follow this step by step guide to get started using the MagSpoof R3 firmware on macOS.

View full article →

MagSpoof R3 on GitHub
MagSpoof R3 on GitHub

April 25, 2017

Hardware and software sources for the MagSpoof R3 are now available at https://github.com/RyscCorp/magspoof_r3.

 

 

View full article →

MagSpoof V2 - Now Available for Pre-Order
MagSpoof V2 - Now Available for Pre-Order

February 13, 2017

We are pleased to announce that the MagSpoof V2 is now available for pre-order. Orders yours today.

View full article →