]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
CHG: added the possibility to "remagic" the new found Mifare Ultralight tags, which...
authoriceman1001 <iceman@iuse.se>
Sun, 15 May 2016 17:27:04 +0000 (19:27 +0200)
committericeman1001 <iceman@iuse.se>
Sun, 15 May 2016 17:27:04 +0000 (19:27 +0200)
The script now deals with to different kind of tags.  Mifare Classic 1k gen1  and  Mifare Ultralight gen1 (7bytes uid)

-Classic will get    UID: 01 02 03 04
-Ultralight will get UID: 53 80 71 02 00 D9 80

client/scripts/remagic.lua

index d2b869c31487b45129965a15a6060a1a97d9e46d..41a2cb83d160da30f6b246eec5dc462812e29956 100644 (file)
@@ -2,14 +2,15 @@ local getopt = require('getopt')
 
 example = "script run remagic"
 author = "Iceman"
-
 desc =
 [[
 This is a script that tries to bring back a chinese magic card (1k generation1) 
 from the dead when it's block 0 has been written with bad values.
+or mifare Ultralight magic card which answers to chinese backdoor commands
 
 Arguments:
-       -h              this help
+       -h              this help
+       -u              remagic a Ultralight tag w 7 bytes UID.
 ]]
 --- 
 -- A debug printout-function
@@ -23,7 +24,6 @@ end
 function oops(err)
        print("ERROR: ",err)
 end
-
 --- 
 -- Usage help
 function help()
@@ -32,31 +32,60 @@ function help()
        print(example)
 end
 
+local function cmdUltralight()
+       return {
+    --[[
+    --]]
+       [0] = "hf 14a raw -p -a -b 7 40",
+       [1] = "hf 14a raw -p -a 43",
+       [2] = "hf 14a raw -c -a A2005380712A",
+       [3] = "hf 14a raw -p -a -b 7 40",
+       [4] = "hf 14a raw -p -a 43",    
+       [5] = "hf 14a raw -c -a A2010200D980",
+       [6] = "hf 14a raw -p -a -b 7 40",
+       [7] = "hf 14a raw -p -a 43",
+       [8] = "hf 14a raw -c -a A2025B480000",
+       [9] = "hf 14a raw -c -a 5000",
+       }
+end
+local function cmdClassic()
+       return {
+    --[[
+    --]]
+       [0] = "hf 14a raw -p -a -b 7 40",
+       [1] = "hf 14a raw -p -a 43",
+       [2] = "hf 14a raw -c -p -a A000",
+       [3] = "hf 14a raw -c -p -a 01020304049802000000000000001001",
+       [4] = "hf 14a raw -c -a 5000",
+       }
+end
 --- 
 -- The main entry point
 function main(args)
 
+       local i
+       local cmds = {}
+       local isUltralight = false
        
        -- Read the parameters
-       for o, a in getopt.getopt(args, 'h') do
-               if o == "h" then help() return end
+       for o, a in getopt.getopt(args, 'hu') do
+               if o == "h" then return help() end
+               if o == "u" then isUltralight = true end
        end
-       
-       local _cmds = {
-    --[[
-    --]]
-       [0] = "hf 14a raw -p -a -b 7 40",
-       [1] = "hf 14a raw -p -a 43",
-       [2] = "hf 14a raw -c -p -a A000",
-       [3] = "hf 14a raw -c -p -a 01 02 03 04 04 98 02 00 00 00 00 00 00 00 10 01",
-       }
+
        core.clearCommandBuffer()
        
-       local i
-       --for _,c in pairs(_cmds) do 
-       for i = 0, 3 do
-           print ( _cmds[i] )
-               core.console( _cmds[i] )
+       if isUltralight then
+               cmds = cmdUltralight()
+       else
+               cmds = cmdClassic()
+       end
+       
+       for i = 0, #cmds do
+               if cmds[i]  then 
+                       print ( cmds[i] )
+                       core.console( cmds[i] )
+               end
        end
 end
 
Impressum, Datenschutz