Topic: Writing to Tikitags/Touchatags

Are tikitags/touchtags MIFARE ultralight tags??

I was able to use the commands in the mifare ultralight functional spec to read from the eeprom.  but i can't write to it.

Are the tikitags write-protected?

Thanks.

Re: Writing to Tikitags/Touchatags

vwu3 wrote:

Are tikitags/touchtags MIFARE ultralight tags??

Yes, according to http://www.touchatag.com/technical-overview

Romuald Conty

Re: Writing to Tikitags/Touchatags

I've been putting together a Mifare Ultralight tool (mfultool) to accompany the Mifare Classic tool (mftool). So far, it can read the tags and write out a dump file, but I can't yet write them back. Hopefully I should have something going both directions very soon and then I'll be submitting a patch for the library. Ideally, there should just be one tool to do dumps from any tags (perhaps even detecting the kind of tag!), but that may be a bit off.

Additionally, I put together a little python script that makes it easier to understand the dump file. From it, I discovered that the Touchatags are mostly locked, except for the last page (page 15). So, at best, you could store 2 bytes (I think) worth of custom data on them.

The dump script is here:
http://staticfree.info/~steve/decode_mful_dump.py

The rest is on its way :-)

Re: Writing to Tikitags/Touchatags

Hi,

xxv wrote:

I've been putting together a Mifare Ultralight tool (mfultool) to accompany the Mifare Classic tool (mftool).

Interresting !

xxv wrote:

So far, it can read the tags and write out a dump file, but I can't yet write them back. Hopefully I should have something going both directions very soon and then I'll be submitting a patch for the library.

Sure, contributions are welcome !

xxv wrote:

Ideally, there should just be one tool to do dumps from any tags (perhaps even detecting the kind of tag!),

That should be more clean, btw at this moment we don't have such tool to read/write Mifare Ultralight, so you can keep indenpendant tool for the moment.

xxv wrote:

Additionally, I put together a little python script that makes it easier to understand the dump file.

Ok, sounds good but can't test it: I don't have the dump tool ;-)

xxv wrote:

From it, I discovered that the Touchatags are mostly locked, except for the last page (page 15). So, at best, you could store 2 bytes (I think) worth of custom data on them.

Which document are you talking about ?

Thanks

Romuald Conty

Re: Writing to Tikitags/Touchatags

rconty wrote:

That should be more clean, btw at this moment we don't have such tool to read/write Mifare Ultralight, so you can keep indenpendant tool for the moment.

Right. It's a project I wanted to get working on :-)

rconty wrote:

Ok, sounds good but can't test it: I don't have the dump tool ;-)

Almost have it! I got write working last night, so it's just a matter of cleanup.

xxv wrote:

From it, I discovered that the Touchatags are mostly locked, except for the last page (page 15). So, at best, you could store 2 bytes (I think) worth of custom data on them.

rconty wrote:

Which document are you talking about ?

Sorry, not page in a document - page in memory. There are 16 addressable pages of 4 bytes each on the Mifare Ultralight, 12 of which are user data. Each of these user pages can be locked to be read-only. The Touchatags have a URL programmed into them in the first 11 pages and with their lock bits set with the last page unlocked and writable. I was able to test writing to all user data pages using an old Vaparetto pass from Venice which has all of its pages unlocked ;-)

Re: Writing to Tikitags/Touchatags

xxv wrote:

Sorry, not page in a document - page in memory.

My mistake, sorry.

xxv wrote:

There are 16 addressable pages of 4 bytes each on the Mifare Ultralight, 12 of which are user data. Each of these user pages can be locked to be read-only. The Touchatags have a URL programmed into them in the first 11 pages and with their lock bits set with the last page unlocked and writable.

This explaination could be useful for many Touchatag users ! Maybe we will put this on documentation wiki page.

Romuald Conty

Re: Writing to Tikitags/Touchatags

Alright, here it is! This patch should be applied against the latest SVN checkout (r46)

http://staticfree.info/~steve/libnfc_r46_mfultool.patch

This will create a new tool - mfultool - which can read/write dumps to Mifare Ultralight tags. At the moment, it's rigged to only write to the data region and skips the OTP and lock bits. I need to read up on the safety of writing to those before enabling that (I only have one tag which has a writable data area at the moment).

To repeat from before, the dump file that the mfultool generates can be parsed to human-readable terms with this python script:
http://staticfree.info/~steve/decode_mful_dump.py

Obviously all is licensed under the GPL, so it should happily join libnfc if y'all desire.

Enjoy!

Re: Writing to Tikitags/Touchatags

Hey,

xxv wrote:

Alright, here it is! This patch should be applied against the latest SVN checkout (r46)

Ok, I'll have a look.

xxv wrote:

Obviously all is licensed under the GPL, so it should happily join libnfc if y'all desire.

WARNING: Since 2009-06-25, we switch to LGPL license (http://www.libnfc.org/community/topic/3 … l-license/) . Please confirm (or not) that you allow us to integrate your work into libnfc under LGPL.

Thanks a lot.

Romuald Conty

Re: Writing to Tikitags/Touchatags

rconty wrote:

WARNING: Since 2009-06-25, we switch to LGPL license (http://www.libnfc.org/community/topic/3 … l-license/) . Please confirm (or not) that you allow us to integrate your work into libnfc under LGPL.
Romuald Conty

GPL or LGPL are both fine by me. Though if you want to release something under the LGPL, you should probably update your files to match. All the files that I modified had GPL boilerplate on them and the main LICENSE file also is a copy of the GPL.

Re: Writing to Tikitags/Touchatags

Dear XXV,

Thank you for contributing new software that uses libnfc.
We released the new version 1.2.0, the API slightly changed, for the sake of consistency.
I hope you don't mind to adapt your software to it.

I was planning to make a 3rd party projects page that uses libnfc.
Are you interested in putting a link to your project there?

Cheers,

  Roel

11

Re: Writing to Tikitags/Touchatags

roel wrote:

Thank you for contributing new software that uses libnfc.
We released the new version 1.2.0, the API slightly changed, for the sake of consistency.
I hope you don't mind to adapt your software to it.

I don't mind, but why wasn't this new version in SVN? I figured writing it against SVN HEAD would have the most recent version of the code so I wouldn't have to adapt anything.

roel wrote:

I was planning to make a 3rd party projects page that uses libnfc.
Are you interested in putting a link to your project there?

Sure. Though I wasn't really planning on keeping anything outside of libnfc. My project is very small and is really only a demo of using a specific type of tag with libnfc. If you'd like me to keep the project outside libnfc, I can do that too.

Re: Writing to Tikitags/Touchatags

No problem at all, contributing to libnfc would be perfect. Currently there is no read/write (example) tool for ultralight tags. It would be nice if some1 could come up with that. Parsing the UID, lockbits and OTPC from the memory dump would help users understand the functionality way easier wink

13

Re: Writing to Tikitags/Touchatags

Alright, I've made a patch against r61 this time. Don't go renaming any more functions on me, please ;-)

http://staticfree.info/~steve/libnfc_r61_mfultool.patch

I'm not entirely sure how one may wish to include the python script. Maybe just as an extra?

Re: Writing to Tikitags/Touchatags

xxv wrote:

Alright, I've made a patch against r61 this time. Don't go renaming any more functions on me, please ;-)
http://staticfree.info/~steve/libnfc_r61_mfultool.patch

Thank you ! Sorry for API changes.
Your patch have been applied in trunk at revision 68.

xxv wrote:

I'm not entirely sure how one may wish to include the python script. Maybe just as an extra?

I think the best is to recode this in C to be integrated in nfc tools but you do have to : i'll look at your script and try to recode it next week.

Thanks a lot for contribution.

Romuald Conty

15

Re: Writing to Tikitags/Touchatags

rconty wrote:

Thank you ! Sorry for API changes.
Your patch have been applied in trunk at revision 68.

Awesome, thanks!

rconty wrote:

I think the best is to recode this in C to be integrated in nfc tools but you do have to : i'll look at your script and try to recode it next week.

Yeah, you're right about that. Actually, if you don't mind, I should just try and do it myself so that I can learn the library a bit better and brush up some more on my C ;-)

Re: Writing to Tikitags/Touchatags

xxv wrote:

I've been putting together a Mifare Ultralight tool (mfultool) to accompany the Mifare Classic tool (mftool). So far, it can read the tags and write out a dump file, but I can't yet write them back. Hopefully I should have something going both directions very soon and then I'll be submitting a patch for the library. Ideally, there should just be one tool to do dumps from any tags (perhaps even detecting the kind of tag!), but that may be a bit off.

Additionally, I put together a little python script that makes it easier to understand the dump file. From it, I discovered that the Touchatags are mostly locked, except for the last page (page 15). So, at best, you could store 2 bytes (I think) worth of custom data on them.

The dump script is here:
http://staticfree.info/~steve/decode_mful_dump.py

The rest is on its way :-)

hi,
Why arent it working?

guepardo rfid $ ./decode_mful_dump.py
Traceback (most recent call last):
  File "./decode_mful_dump.py", line 83, in <module>
    t.from_dumpfile(sys.argv[1])
IndexError: list index out of range
guepardo rfid $
developing the future!

Re: Writing to Tikitags/Touchatags

Hi!

  If you want to read a Mifare (Ultralight or not) easily - you still gotta know the keys - , you can just use my online tool at : https://www.lafargue.name/smart-tools/atr/

  It works with most contactless PC/SC readers and lets you read mifare cards very easily. Mostly tested with Firefox, there are a few issues now and then on IE...

Ed

Last edited by edo512 (2009-11-24 08:51:51)

Re: Writing to Tikitags/Touchatags

edo512 wrote:

Hi!

  If you want to read a Mifare (Ultralight or not) easily - you still gotta know the keys - , you can just use my online tool at : https://www.lafargue.name/smart-tools/atr/

  It works with most contactless PC/SC readers and lets you read mifare cards very easily. Mostly tested with Firefox, there are a few issues now and then on IE...

Ed


i works with Iceweasel(firefox in debian) and its not running ATR parser
Iwould like to probe it!

developing the future!

Re: Writing to Tikitags/Touchatags

*dudux wrote:

i works with Iceweasel(firefox in debian) and its not running ATR parser
Iwould like to probe it!

-> Try first with FF and let me know if you like it. The tool already works on IE, FF, Windows, Linux, Mac, but why not Iceweasel, I'll try to see whether I can add support..

Re: Writing to Tikitags/Touchatags

edo512 wrote:
*dudux wrote:

i works with Iceweasel(firefox in debian) and its not running ATR parser
Iwould like to probe it!

-> Try first with FF and let me know if you like it. The tool already works on IE, FF, Windows, Linux, Mac, but why not Iceweasel, I'll try to see whether I can add support..

Now i am trying with FF
Thanks edo512

developing the future!

Re: Writing to Tikitags/Touchatags

Hey guys,

First thank you for releasing this great library and creating these tools. I wanted a way last night to be able to write MiFare UltraLight cards but lock them as well to prevent re-writing.

I created a patch for this feature to the nfc-mfultralight program. It is here: http://nemik.net/code/libnfc_mfultralig … lock.patch

If you guys like it and approve, maybe it can be added upstream?

Either way, thank you again.

Re: Writing to Tikitags/Touchatags

Hello nemik,

nemik wrote:

First thank you for releasing this great library and creating these tools.

Thank you for using it smile

nemik wrote:

I wanted a way last night to be able to write MiFare UltraLight cards but lock them as well to prevent re-writing.
I created a patch for this feature to the nfc-mfultralight program. It is here: http://nemik.net/code/libnfc_mfultralig … lock.patch

At the first sight, your patch doesn't work as expected if user want to write locks but not otp (as there are two separated questions).

nemik wrote:

If you guys like it and approve, maybe it can be added upstream?

Starting with your patch, I made some changes and commit them in r842. Could you try it and see if works as expected?

nemik wrote:

Either way, thank you again.

Thanks to you for your contribution!

Romuald Conty

Re: Writing to Tikitags/Touchatags

Yes, you're right Romuald, it won't lock without setting the OTP bytes. Though for me this was advantageous because I was noticing the card not being read by the NFC phones unless I wrote to the OTP section. I'll have to explore the spec more to find out why this is.

Thank you for fixing my patch to allow for this though.