Using a mobile phone to clone a MIFARE card

Overview

  1. Why?
  2. MIFARE Classic?
  3. MIFARE Ultralight?
  4. Reading and capturing contents of the card
  5. About this manufacturer block (Sector 0 – Block 0)
  6. The UID thing that messes with my head
  7. Writing a 4Byte dump on a different card

Why?

The MIFARE NFC card is used in many environments. I got a trash card, a card that I have to use to open the underground trash bin, that I want to clone. As the replacement costs for a lost / broken card is 10 a clone would be a good investment.

20160706_202512

By holding the card in front of the reader, I can open the trashcan, ohw happy days.

In my search for information, I found the following pages interesting:

  • https://www.blackhat.com/docs/sp-14/materials/arsenal/sp-14-Almeida-Hacking-MIFARE-Classic-Cards-Slides.pdf
  • http://www.proxmark.org/forum/viewtopic.php?id=1535
  • http://www.shopnfc.it/en/content/7-nfc-device-compatibility
  • http://publications.icaria.de/mct/releases/2.0/
  • http://www.scnf.org.uk/smartstore/4-7_B_ID_Questions_Answeres_V8.pdf
  • http://cache.nxp.com/documents/data_sheet/MF1S70YYX_V1.pdf?pspll=1
  • https://learn.adafruit.com/adafruit-pn532-rfid-nfc/mifare
  • http://www.nxp.com/documents/data_sheet/MF0ICU1.pdf (Ultralight / 7Byte UID)
  • https://www.kismetwireless.net/code-old/svn/hardware/kisbee-02/firmware/drivers/rf/pn532/helpers/
  • http://stackoverflow.com/questions/21700718/serials-on-nfc-tags-truly-unique-cloneable
  • http://stackoverflow.com/questions/28409934/editing-functionality-of-host-card-emulation-in-android
  • https://store.ryscc.com/products/new-proxmark3-kit

 

MIFARE Classic?

Some informational dumps:

  • 16 bits CRC per block
  • Anticollision loop
  • 1kB or 4kB of EEPROM
  • CRYPTO1 strem cipher (mjah, close to zero security)
  • Manufacturer / data / value blocks

2016-07-06 21_15_26

2016-07-06 21_17_31

MIFARE Ultralight?

MiFare Ultralight cards typically contain 512 bits (64 bytes) of memory, including 4 bytes (32-bits) of OTP (One Time Programmable) memory where the individual bits can be written but not erased.

MiFare Ultralight cards have a 7-byte UID that uniquely identifies the card.

2016-07-06 22_10_57 2016-07-06 22_11_23

 

Reading and capturing contents of the card

After some investigation I noticed that my Samsung mobile phone has a NFC reader.
I used the https://github.com/ikarus23/MifareClassicTool on my Samsung S6, the the result was a bit disappointing:

Screenshot_2016-07-06-20-27-14

On a Samsung S6

After some googling, I found that the hardware chip, used to read NFC tags, was just not on my S6.
But it showed that it was on an old S3, that I had laying around, it just worked like a charm on my Samsung Galaxy S3 with Android 6:

Screenshot_2016-07-06-20-35-18

On a Samsung S3

In order to read the contents of the card, the MIFARE card can be red easily.

Screenshot_2016-07-06-20-47-40

Use the supplied key sets and start mapping and read tag

Screenshot_2016-07-06-20-47-51

Pom pie dom…

Screenshot_2016-07-06-20-48-06

Detailed information about every sector on the card (if any data would be present except the UID)

So the only interesting information is in Sector: 0, also called the manufacturer block.
I also noticed that the UID was 7Byte, making it a MIFARE Ultralight card grrrrrrr…

About this manufacturer block (Sector 0 – Block 0)

This part of the card is the only interesting part, as no other data is written to any sector/block as far as I can see.
In order to understand the difference between a 4Byte and 7Byte UID (i.e. MIFARE Classic vs MIFARE Utralight), I have added some pictures:

2016-07-06 21_25_54

A more detailed picture explains some more information is included after the serial number on block 0:

2016-07-06 20_44_14

A more detailed picture of the 7byte UID:

2016-07-06 21_59_10

The UID thing that messes with my head

As you could see on my tag info, the UID on my trash card is 7 byte, so it works a bit different than the 4 byte one.

2016-07-06 21_05_26

The different types of UID are explained as follows:

ISO/IEC 14443 Type A defines a Unique IDentifer to be used for card selection and activation. The standard defines single, double and triple size UIDs which correspondingly consist of 4, 7 and 10 Byte.
What is the difference between a 4 Byte UID and a 4 Byte ID?
A 4 byte UID is an identifier which has been assigned by the card manufacturer using a controlled database. This database ensures that a
single identifier is not used twice. In contradiction, a 4 byte ID is an identifier which may be assigned to more then one contactless chip over the production time of a product so that more then one card with the same identified may be deployed into one particular contactless system.

 

Writing a 4Byte dump on a different card

As it is just cool to write a cards dump back, I have found a 4Byte UID MIFARE Classic 1kB card.

Screenshot_2016-07-06-20-11-10

Card information

Screenshot_2016-07-06-20-11-54

Content of Sector: 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ebay has a solution for everyting. UID writable MIFARE Classic cards. These cards make it possible to write Sector 0 – block 0 (i.e. the manufacturer block).

20160706_173614

Screenshot_2016-07-06-20-12-18

Write tag and enable writing to manufacturer block

Screenshot_2016-07-06-20-12-27

Select what to write from the dump

Screenshot_2016-07-06-20-12-36

Click start mapping and write dump

Compare the two tags, only the SAK is different, I hope that will still work in a real live situation

Screenshot_2016-07-06-22-53-51

Cloned card

Screenshot_2016-07-06-20-11-10

Original card

 

38 thoughts on “Using a mobile phone to clone a MIFARE card

    • Een mobiele telefoon zou dat moeten kunnen (draadloos betalen met je NFC chip tegen een pinapparaat aan).
      Maar niet in de app gevonden die ik zelf gebruik.

      Een proxmark3 aanschaffen zou echt top zijn: https://store.ryscc.com

  • Dit is misschien een domme vraag, maar is het mogelijk om een Dump van een kaart met een 7 byte UID te schrijven op kaart met een 4 Byte UID?

  • Hi, so interesting.
    i have a question: i’d like to emulate de dump with the mobile.
    do you think is possible?
    i have been looking for an app in google play but I didnt find anything yet.

    i would like to emulate my card access.

    thanks a lot

  • Is het je ooit gelukt de afval pas te copyeren, ik kan tot nu toe geen herschrijfbare 7 bytes UID card vinden.

  • het lukt me wel met een jailbreak iphone 6.

    op mijn s7 edge ook.
    je moet pad laden dan die bytes fixen. staan op Google.
    pas is je adres daarom staan die vast. op pas.
    via fix kan je deze laden

    • hoi Harry
      graag meer info a.u.b ……..byte fixen ??
      link naar site , link naar software,
      waar kun je pas kopen ??
      remon

  • Sorry maar het is nooit gelukt de afval pas te copyeren, ik heb zak van 10 UID (sleutelhanger) en jouwe structie de UID is 7byte en sector 0 writeble
    de probleem is niet schrijf op sector 0 maar A/B key , ik heb CRC error (key not match ) dus ik mess stapje waar de key decoded !!??
    graag help ik heb nog meer UID besteld van china en ik hope meer info van je . Ray

  • I don’t get all the stuff you’re staying about Figure 6 and Figure 7, it’s not well explained.

    I used the app to try to copy a fob, and it seems to have corrupted each copy so now it’s unreadable.

  • Waarom moeilijk doen als het makkelijk kan ?
    Ik heb de kaart met mijn mobieltje (Sony) gekopieerd en simuleer nu voortaan de kaart ! (20 seconde app downloaden en 1 sec. kopie, gelijk werken)
    Bij mij thuis hebben we dus allemaal ons eigen mobieltje en toch altijd “dezelfde” kaart bij ons :))
    (Nooit meer je kaart kwijt of niet bij je !)
    Mijn advies: nooit je kaart uitlenen (of je mobiel laten hacken) anders kunnen ze op jou naam lekker afval dumpen ! !

  • Pingback: !2ke
  • [URL=http://porno-besik.net/][IMG]http://s4.pic4you.ru/y2018/02-13/12461/6183409-thumb.jpeg[/IMG][/URL]

    Здоровый босс дрючит в
    сраку
    шикарную секретаршу азитку на своем столе. Отправив всех по домам,
    он пригласил телку в личный кабинет, натянул презик и
    очень больно выебал ее в очень узкую
    попочку на собственном столе…
    Смотрите [url=https://42.herber.pl/714265]азиатки секретарши порно[/url]
    и наслаждайтесь отличным анальным трахом с азиатской секретаршей…

  • Living in France is one thing desired by many individuals. If you want to live in France then you have to get French property. You can read the advertisement section of the newspapers which has the section of houses for sale in France. After making a suitable choice, you should research about the properties for sale in France. French property is now a days very much wanted also.

    If you want to live in France and spend your life there you should select a proper house. French property is not cheap and you need to make a major investment. You must also know about the properties for sale in France at various locations. The houses for sale in France come in different prices depending on the location

  • Pingback: 검증사이트
  • I tried with one of those UID writable cards, and Mifare Classic Tools gave me an error.
    Maybe changing a phone would work? I’ve heard that Android actually doesn’t support the command of writing a UID.

  • Hi Tim, great write up!
    Maybe you want to update the post because your assumptions about Mifare Classic vs. Mifare Ultralight are wrong. Even the tag with the 7 byte UID is a Mifare Classic tag. There are Mifare Classic tags with 4 or 7 byte UIDs! Check out section 1.3 of the datasheet http://www.nxp.com/documents/data_sheet/MF1S50YYX.pdf Also, MCT app can only read Mifare Classic tags and not Mifare Ultralight.

  • Pingback: java
  • Do you love teen hardcore sex? Or when young girls suck cocks until guys cum? Or you like crazy dorm actions with drunk students drink beer and fuck at parties? All of these and much more you will see on this site 18-teen-porn.com. All kinds of teen porn with beautiful girls. Big tits, small tits, shaved and hairy pussies penetrated by cocks, skilled mouths suck dicks and sure with lots of sperm! Have fun with our teen HD videos!
    With a huge variety of quality teen porn, this top notch tube is sure to grant the best adult experiences online. Once you step inside, you get to see a lot of niches and plenty of available HD videos, all carefully selected and with daily updates to keep you aroused. Enjoy an impressive number of amateur teen porn, cam girls gone wild and a whole lot of other categories in one single and very impressive collection of teen videos. Each comes with HD image and the tube’s fantastic streaming speed, something which will surely improve your adult experiences. Only rate teen porn and quality action, girls on fire in the mood to spin large inches of cock into each of their tiny love holes. Barely legal hotties working cock like true pornstars and a huge number of amateurs trying to make it into the big league. Either way you like your porn, this awesome teen tube will provide young flesh and spicy action at any hour. Only exclusive teen porn which is not available on other movie sites or tubes. Quality content with premium action and girls to die for. Enjoy such fantastic content on a tube that’s set to become number one, a tube which will make your delight with a very large variety of niches. Never mind browsing for teen sex on other tubes, this one right here offers a huge variety of movies and what you need for unbelievable experiences.

    http://www.datingnzcougar.info/

  • Do you love teen hardcore sex? Or when young girls suck cocks until guys cum? Or you like crazy dorm actions with drunk students drink beer and fuck at parties? All of these and much more you will see on this site 18-teen-porn.com. All kinds of teen porn with beautiful girls. Big tits, small tits, shaved and hairy pussies penetrated by cocks, skilled mouths suck dicks and sure with lots of sperm! Have fun with our teen HD videos!
    With a huge variety of quality teen porn, this top notch tube is sure to grant the best adult experiences online. Once you step inside, you get to see a lot of niches and plenty of available HD videos, all carefully selected and with daily updates to keep you aroused. Enjoy an impressive number of amateur teen porn, cam girls gone wild and a whole lot of other categories in one single and very impressive collection of teen videos. Each comes with HD image and the tube’s fantastic streaming speed, something which will surely improve your adult experiences. Only rate teen porn and quality action, girls on fire in the mood to spin large inches of cock into each of their tiny love holes. Barely legal hotties working cock like true pornstars and a huge number of amateurs trying to make it into the big league. Either way you like your porn, this awesome teen tube will provide young flesh and spicy action at any hour. Only exclusive teen porn which is not available on other movie sites or tubes. Quality content with premium action and girls to die for. Enjoy such fantastic content on a tube that’s set to become number one, a tube which will make your delight with a very large variety of niches. Never mind browsing for teen sex on other tubes, this one right here offers a huge variety of movies and what you need for unbelievable experiences.

    http://www.datingnzcougar.info/

Leave a Reply

Your email address will not be published. Required fields are marked *