Making a CTF challenge with an NFC tag / 2022-12-14

2022-12-14 Making a CTF challenge with an NFC tag
On 9 December this year was the annual SURFcert Capture The Flag (CTF) event. The end result is that team "I'm not a robot" from Radbout University Nijmegen won with the most points.

When I participate in a CTF, I like to keep notes and write about my experiences and what I learned solving the challenges. Being on the 'other' side creating the challenges is as much fun, but while creating the challenges you have to be really silent about it. For me personally it is extra challenging because one of the regular SURFcert CTF players works with me in the same team.

But sometimes designing a challenge and making it happen gives the same great feeling as actually solving it! This was the case with the challenge that ended up as Scan the radio on the SURFcert CTF. The name of the challenge was somewhat confusing by design: there was a challenge which was designed to make people use a 1990s style ghettoblaster radio, there was a challenge mentioning 'broadcast' which was actually about names of wifi networks and this challenge. All three were marked 'physical' with a description of the challenge.

For this challenge I wanted to create an NFC tag that could be read easily. I found out information can be put in NFC tags using the NDEF standard (NFC Data Exchange Format) which has options to embed URLs, options to start certain apps or simple strings. I wanted a simple string with a flag as our flag format was SCF2022- plus 32 characters uppercase. I found out the developer of proxmark is working on NDEF support but it is all quite new.

At this point I was worried I had to write my own code and use parts from a fresh library to get an NDEF message on a card. I did bring some MiFare classic cards home to test on. But searching for information I came across NDEF and Magic Mifare Cards with the very important remark:
My suggestion would be to get an Android phone with nxp reader chip (there are many) and use tagwriter from NXP to format and write ndef data to the Mifare classic chip.
I do have NFC TagWriter by NXP on a smartphone, I just haven't used it a lot.

And indeed it was really easy to create an NDEF dataset with a string, write this to a MiFare classic and read this with an Android phone with NFC support, even without opening the NXP TagInfo application.

So that was an easy challenge to make, a lot easier than I first thought. Or was it? The final test would be to read this on an Apple iphone too.

And there came the snag, the Apple iphone doesn't work with MiFare classic tags somehow. But the person who helped me test it had another tag with an NDEF message on it, and that worked fine. So the conclusion was that another type of tag would work better. Luckily one of the other people of the team creating the SURFcert CTF has a big collection of NFC tags and it turned out the tag given out by Tweakers reads fine on Android and iphone.

So that's how the 'scan the radio' challenge was to notice the clearly not from 1992 tweakers tag on the ghettoblaster radio, scan it with the standard NFC support in a smartphone or use NXP TagInfo and find the flag.

While creating this challenge I also tried writing information to the tags which were given out / sold about 15 years ago which looked like a circle with a hex serial number. I always assumed they were just a serial number to look up in a database. But they turned out to be actual NDEF tags with the hex serial number on the outside as an URL:

For the tag with 04B7CC193E2580 on the outside:
protocol 01 http://www uri field ttag.be/m/04B7CC193E2580

But ttag.be has changed owners since this was active and it's now redirecting to 609.es which is a real-estate agent in Spain. I guess everybody who scans a round tag with a serial number wonders how they end up with a real-estate agent.

Tags: , ,

IPv6 check

Running test...
, reachable as koos+website@idefix.net. PGP encrypted e-mail preferred. PGP key 5BA9 368B E6F3 34E4 local copy PGP key 5BA9 368B E6F3 34E4 via keyservers

RSS
Meningen zijn die van mezelf, wat ik schrijf is beschermd door auteursrecht. Sommige publicaties bevatten een expliciete vermelding dat ze ongevraagd gedeeld mogen worden.
My opinions are my own, what I write is protected by copyrights. Some publications contain an explicit license statement which allows sharing without asking permission.
Other webprojects: Camp Wireless, wireless Internet access at campsites, The Virtual Bookcase, book reviews
This page generated by $Id: newsitem.cgi,v 1.58 2022/12/12 15:34:31 koos Exp $ in 0.010406 seconds.