home *** CD-ROM | disk | FTP | other *** search
/ DEFCON 12 / DEFCON_12_CD-ROM_2004.iso / Grunwald / rfdump-pda.pl < prev   
Perl Script  |  2004-07-07  |  2KB  |  56 lines

  1. #!/usr/bin/perl -w
  2. # This Script used the ACG Card-Reader to DUMP the RFID Chip Content 
  3. # Copyright by L. Grunwald DN-Systems GmbH 2004
  4. use POSIX;
  5.  
  6. if (@ARGV < 1) {
  7. print "rfdump the content of an RFID Ship useing serveral Card-Reader \n";
  8. print "Copyright 2004 by L. Grunwald DN-Systems GmbH\n";
  9. print "usage: rfdump.pl tty \n";
  10. print "e.g. rfdump.pl /dev/ttyS2\n";
  11.    exit 1;
  12.    }
  13. my $reader = $ARGV[0];
  14. open RFH,"+<".$reader or die "can┤t open $reader";
  15. print RFH "x";
  16. $tagtype="";
  17. $tagid="";
  18. while (<RFH>) {
  19. print RFH "s";
  20. chomp;
  21. if ((length $_)> 10) { $tagid=$_;
  22.         &identtag;
  23.         } 
  24. $tagid="";
  25. }
  26. sub identtag{
  27. print "$tagid ";
  28. $tagtype=(substr($tagid,0,1 ));
  29. if ($tagtype eq 'V') {print "ISO 15693 ";
  30.             $mfid=(substr($tagid,3,2));
  31.             print "MFID: ".$mfid." ";
  32.             if ($mfid == 0x02) {print "ST Microelectronics ";}
  33.             elsif ($mfid == 0x04) {print "Phillips Semiconductors ";}
  34.             elsif ($mfid == 0x05) {print "Infinion Technologies AG ";}
  35.             elsif ($mfid == 0x07) {print "Texas Instruments ";}
  36.             elsif ($mfid == 0x16 ) {print "EM Microelectronic-Marin SA ";}
  37.             else {print "unknown ";}
  38.             print "Serial: ".(substr($tagid,,5))."\n";}
  39. if ($tagtype eq 'T') {print "Tagit ";
  40.             print "MFID: Texas Instruments ";
  41.             print "Serial: ".$tagid."\n";}
  42. if ($tagtype eq 'I') {print "ICode ";
  43.             print "MFID: Phillips Semiconductors ";
  44.             print "Serial: ".$tagid."\n";
  45.             print RFH "m".$tagid; }    
  46. if ($tagtype eq 'M') {print "Mifare Ultralight or ISO 14443 Type A ";
  47.             print "MFID: ".$mfid." ";
  48.             print "Serial: ".$tagid."\n";}
  49. if ($tagtype eq 'S') {print "SR176 ";
  50.             print "MFID: STM";
  51.             print "Serial: ".$tagid."\n";}
  52. if ($tagtype eq 'Z') {print "ISO 14443 Type B ";
  53.             print "MFID: ".$mfid." ";
  54.             print "Serial: ".$tagid."\n";}            
  55. }
  56.