mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
colors
This commit is contained in:
parent
2010f8db03
commit
95bc1230d7
9 changed files with 118 additions and 68 deletions
|
@ -1,7 +1,7 @@
|
|||
local getopt = require('getopt')
|
||||
local bin = require('bin')
|
||||
local dumplib = require('html_dumplib')
|
||||
local ansicolors = require('ansicolors')
|
||||
local ansicolors = require('ansicolors')
|
||||
|
||||
copyright = ''
|
||||
author = 'Iceman'
|
||||
|
|
|
@ -12,9 +12,9 @@ local ansicolors = require('ansicolors')
|
|||
|
||||
copyright = ''
|
||||
author = '0xdrrb'
|
||||
version = 'v0.1.0'
|
||||
version = 'v0.1.1'
|
||||
desc = [[
|
||||
This is a script to dump and decrypt the data of a specific type of Mifare laundromat token.
|
||||
This is a script that tries to dump and decrypt the data of a specific type of Mifare laundromat token. OBS! Tag must be on the antenna.
|
||||
]]
|
||||
example = [[
|
||||
script run luxeodump
|
||||
|
@ -22,7 +22,9 @@ example = [[
|
|||
usage = [[
|
||||
script run luxeodump
|
||||
]]
|
||||
|
||||
arguments = [[
|
||||
-h This help
|
||||
]]
|
||||
local PM3_SUCCESS = 0
|
||||
|
||||
-- Some shortcuts
|
||||
|
@ -48,7 +50,22 @@ local function oops(err)
|
|||
core.clearCommandBuffer()
|
||||
return nil, err
|
||||
end
|
||||
|
||||
---
|
||||
-- Usage help
|
||||
local function help()
|
||||
print(copyright)
|
||||
print(author)
|
||||
print(version)
|
||||
print(desc)
|
||||
print(ansicolors.cyan..'Usage'..ansicolors.reset)
|
||||
print(usage)
|
||||
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
|
||||
print(arguments)
|
||||
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
|
||||
print(example)
|
||||
end
|
||||
---
|
||||
--
|
||||
local function setdevicedebug( status )
|
||||
local c = 'hw dbg '
|
||||
if status then
|
||||
|
@ -72,8 +89,8 @@ local function xteaCrypt(num_rounds, v, key)
|
|||
-- v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]);
|
||||
v1 = band(bxor(bxor(lsh(v0,4), rsh(v0,5)) + v0, sum + key[band(rsh(sum,11),3)]) + v1, 0xFFFFFFFF)
|
||||
end
|
||||
v[0]=v0
|
||||
v[1]=v1
|
||||
v[0] = v0
|
||||
v[1] = v1
|
||||
end
|
||||
|
||||
local function xteaDecrypt(num_rounds, v, key)
|
||||
|
@ -89,8 +106,8 @@ local function xteaDecrypt(num_rounds, v, key)
|
|||
-- v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]);
|
||||
v0 = band(v0 - bxor(bxor(lsh(v1,4), rsh(v1,5)) + v1, sum + key[band(sum,3)]), 0xFFFFFFFF)
|
||||
end
|
||||
v[0]=v0
|
||||
v[1]=v1
|
||||
v[0] = v0
|
||||
v[1] = v1
|
||||
end
|
||||
|
||||
local function createxteakey(mfuid)
|
||||
|
@ -150,7 +167,7 @@ local function readtag(mfkey,xteakey)
|
|||
|
||||
-- Read 4 sectors and build table
|
||||
for sect = 8, 11 do
|
||||
for blockn = sect*4, (sect*4)+2 do
|
||||
for blockn = sect * 4, (sect * 4) + 2 do
|
||||
local blockdata = readblock(blockn, mfkey)
|
||||
if not blockdata then return oops('[!] failed reading block') end
|
||||
table.insert(tagdata, blockdata)
|
||||
|
@ -160,17 +177,17 @@ local function readtag(mfkey,xteakey)
|
|||
-- Decrypt data and build clear table
|
||||
for key,value in ipairs(tagdata) do
|
||||
local clearblockdata
|
||||
v[0]=utils.SwapEndianness(value:sub(1,8),32)
|
||||
v[1]=utils.SwapEndianness(value:sub(9,16),32)
|
||||
v[0] = utils.SwapEndianness(value:sub(1, 8), 32)
|
||||
v[1] = utils.SwapEndianness(value:sub(9, 16), 32)
|
||||
xteaDecrypt(16, v, xteakey)
|
||||
vv[0]=utils.SwapEndianness(value:sub(17,24),32)
|
||||
vv[1]=utils.SwapEndianness(value:sub(25,32),32)
|
||||
vv[0] = utils.SwapEndianness(value:sub(17, 24), 32)
|
||||
vv[1] = utils.SwapEndianness(value:sub(25, 32), 32)
|
||||
xteaDecrypt(16, vv, xteakey)
|
||||
clearblockdata=string.format("%08X%08X%08X%08X",
|
||||
utils.SwapEndianness(string.format("%08X", v[0]),32),
|
||||
utils.SwapEndianness(string.format("%08X", v[1]),32),
|
||||
utils.SwapEndianness(string.format("%08X", vv[0]),32),
|
||||
utils.SwapEndianness(string.format("%08X", vv[1]),32))
|
||||
utils.SwapEndianness(string.format("%08X", v[0]), 32),
|
||||
utils.SwapEndianness(string.format("%08X", v[1]), 32),
|
||||
utils.SwapEndianness(string.format("%08X", vv[0]), 32),
|
||||
utils.SwapEndianness(string.format("%08X", vv[1]), 32))
|
||||
table.insert(cleardata, clearblockdata)
|
||||
end
|
||||
|
||||
|
@ -180,6 +197,12 @@ end
|
|||
|
||||
|
||||
local function main(args)
|
||||
|
||||
-- Arguments for the script
|
||||
for o, a in getopt.getopt(args, 'h') do
|
||||
if o == 'h' then return help() end
|
||||
end
|
||||
|
||||
local xteakey = {}
|
||||
-- local v = {}
|
||||
local edata = {}
|
||||
|
@ -207,7 +230,7 @@ local function main(args)
|
|||
print(acblue.."UID: "..tag.uid..acoff)
|
||||
print(acblue..string.format("XTEA key: %08X %08X %08X %08X", xteakey[0], xteakey[1], xteakey[2], xteakey[3])..acoff)
|
||||
|
||||
edata, cdata = readtag("415A54454B4D",xteakey)
|
||||
edata, cdata = readtag("415A54454B4D", xteakey)
|
||||
|
||||
if edata == nil or cdata == nil then
|
||||
print("ERROR Reading tag!")
|
||||
|
|
|
@ -13,10 +13,11 @@ local keylist = require('mfc_default_keys')
|
|||
local lib14a = require('read14a')
|
||||
local getopt = require('getopt')
|
||||
local utils = require('utils')
|
||||
local ansicolors = require('ansicolors')
|
||||
|
||||
copyright = ''
|
||||
author = "Holiman"
|
||||
version = 'v1.0.1'
|
||||
version = 'v1.0.2'
|
||||
desc = ("This script implements Mifare check keys.\
|
||||
It utilises a large list of default keys (currently %d keys).\
|
||||
If you want to add more, just put them inside /lualibs/mfc_default_keys.lua\n"):format(#keylist)
|
||||
|
@ -24,7 +25,9 @@ example = [[
|
|||
1. script run mfckeys
|
||||
]]
|
||||
usage = [[
|
||||
Arguments:
|
||||
script run mfckeys [-p]
|
||||
]]
|
||||
arguments = [[
|
||||
-h : this help
|
||||
-p : print keys
|
||||
]]
|
||||
|
@ -46,9 +49,12 @@ local function help()
|
|||
print(author)
|
||||
print(version)
|
||||
print(desc)
|
||||
print('Example usage')
|
||||
print(example)
|
||||
print(ansicolors.cyan..'Usage'..ansicolors.reset)
|
||||
print(usage)
|
||||
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
|
||||
print(arguments)
|
||||
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
|
||||
print(example)
|
||||
end
|
||||
--
|
||||
-- waits for answer from pm3 device
|
||||
|
@ -269,8 +275,6 @@ end
|
|||
-- The main entry point
|
||||
local function main(args)
|
||||
|
||||
local numSectors = 16
|
||||
|
||||
-- Arguments for the script
|
||||
for o, a in getopt.getopt(args, 'hp') do
|
||||
if o == 'h' then return help() end
|
||||
|
@ -280,6 +284,8 @@ local function main(args)
|
|||
tag, err = lib14a.read(false, true)
|
||||
if not tag then return oops(err) end
|
||||
|
||||
local numSectors = 16
|
||||
|
||||
-- detect sectors and print taginfo
|
||||
numsectors = taginfo(tag)
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ local cmds = require('commands')
|
|||
local getopt = require('getopt')
|
||||
local lib14a = require('read14a')
|
||||
local utils = require('utils')
|
||||
local ansicolors = require('ansicolors')
|
||||
|
||||
-- global
|
||||
local DEBUG = false -- the debug flag
|
||||
|
@ -11,10 +12,9 @@ local err_lock = 'use -k or change cfg0 block'
|
|||
|
||||
copyright = 'Copyright (c) 2017 IceSQL AB. All rights reserved.'
|
||||
author = 'Christian Herrmann'
|
||||
version = 'v1.1.2'
|
||||
version = 'v1.1.3'
|
||||
desc = 'This script enables easy programming of a MAGIC NTAG 21* card'
|
||||
example =
|
||||
[[
|
||||
example = [[
|
||||
-- wipe tag
|
||||
script run mfu_magic -w
|
||||
|
||||
|
@ -36,12 +36,10 @@ example =
|
|||
-- set signature
|
||||
script run mfu_magic -s 1122334455667788990011223344556677889900112233445566778899001122
|
||||
]]
|
||||
usage =
|
||||
[[
|
||||
Usage:
|
||||
usage = [[
|
||||
script run mfu_magic -h -k <passwd> -c -w -u <uid> -t <type> -p <passwd> -a <pack> -s <signature> -o <otp> -v <version>
|
||||
|
||||
Arguments:
|
||||
]]
|
||||
arguments = [[
|
||||
-h this help
|
||||
-c read magic configuration
|
||||
-u UID (14 hexsymbols), set UID on tag
|
||||
|
@ -94,9 +92,12 @@ local function help()
|
|||
print(author)
|
||||
print(version)
|
||||
print(desc)
|
||||
print('Example usage')
|
||||
print(example)
|
||||
print(ansicolors.cyan..'Usage'..ansicolors.reset)
|
||||
print(usage)
|
||||
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
|
||||
print(arguments)
|
||||
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
|
||||
print(example)
|
||||
end
|
||||
---
|
||||
-- set the global password variable
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
local getopt = require('getopt')
|
||||
local ansicolors = require('ansicolors')
|
||||
|
||||
copyright = ''
|
||||
author = "Neuromancer"
|
||||
version = 'v1.0.1'
|
||||
version = 'v1.0.2'
|
||||
desc = [[
|
||||
This script tries to decode Mifare Classic Access bytes
|
||||
]]
|
||||
|
@ -10,9 +11,9 @@ example = [[
|
|||
1. script run mifare_access -a 7F0F0869
|
||||
]]
|
||||
usage = [[
|
||||
script run mifare_access -h -a <access bytes>
|
||||
|
||||
Arguments:
|
||||
script run mifare_access [-h] [-a <access bytes>]
|
||||
]]
|
||||
arguments = [[
|
||||
-h : this help
|
||||
-a <access bytes> : 4 bytes ACCESS CONDITIONS
|
||||
]]
|
||||
|
@ -50,9 +51,12 @@ local function help()
|
|||
print(author)
|
||||
print(version)
|
||||
print(desc)
|
||||
print('Example usage')
|
||||
print(example)
|
||||
print(ansicolors.cyan..'Usage'..ansicolors.reset)
|
||||
print(usage)
|
||||
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
|
||||
print(arguments)
|
||||
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
|
||||
print(example)
|
||||
end
|
||||
|
||||
local access_condition_sector_trailer = {}
|
||||
|
|
|
@ -2,20 +2,23 @@ local getopt = require('getopt')
|
|||
local lib14a = require('read14a')
|
||||
local cmds = require('commands')
|
||||
local utils = require('utils')
|
||||
local ansicolors = require('ansicolors')
|
||||
|
||||
copyright = ''
|
||||
author = "Martin Holst Swende"
|
||||
version = 'v1.0.2'
|
||||
version = 'v1.0.3'
|
||||
desc = [[
|
||||
This is a script which automates cracking and dumping mifare classic cards. It sets itself into
|
||||
'listening'-mode, after which it cracks and dumps any mifare classic card that you
|
||||
place by the device.
|
||||
]]
|
||||
example = [[
|
||||
script run mifare_autopwn
|
||||
1. script run mifare_autopwn
|
||||
]]
|
||||
usage = [[
|
||||
Arguments:
|
||||
script run mifare_autopwn [-h] [-d] [-k <key>]
|
||||
]]
|
||||
arguments = [[
|
||||
-h this help
|
||||
-d debug logging on
|
||||
-k known key for Sector 0 , keytype A
|
||||
|
@ -61,9 +64,12 @@ local function help()
|
|||
print(author)
|
||||
print(version)
|
||||
print(desc)
|
||||
print('Example usage')
|
||||
print(example)
|
||||
print(ansicolors.cyan..'Usage'..ansicolors.reset)
|
||||
print(usage)
|
||||
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
|
||||
print(arguments)
|
||||
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
|
||||
print(example)
|
||||
end
|
||||
---
|
||||
-- Waits for a mifare card to be placed within the vicinity of the reader.
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
local cmds = require('commands')
|
||||
local lib14a = require('read14a')
|
||||
local getopt = require('getopt')
|
||||
local ansicolors = require('ansicolors')
|
||||
|
||||
copyright = ''
|
||||
author = 'Dominic Celiano'
|
||||
version = 'v1.0.1'
|
||||
desc =
|
||||
[[
|
||||
version = 'v1.0.2'
|
||||
desc = [[
|
||||
Purpose: Lua script to communicate with the Mifare Plus EV1, including personalization (setting the keys) and proximity check. Manually edit the file to add to the commands you can send the card.
|
||||
Please read the NXP manual before running this script to prevent making irreversible changes. Also note:
|
||||
- The Mifare Plus must start in SL0 for personalization. Card can then be moved to SL1 or SL3.
|
||||
|
@ -15,13 +15,12 @@ Please read the NXP manual before running this script to prevent making irrevers
|
|||
Small changes can be to made this script to communicate with the Mifare Plus S, X, or SE.
|
||||
]]
|
||||
example = [[
|
||||
-- default
|
||||
script run mifareplus
|
||||
1. script run mifareplus
|
||||
]]
|
||||
usage = [[
|
||||
script run mifareplus -h
|
||||
|
||||
Arguments:
|
||||
script run mifareplus [-h]
|
||||
]]
|
||||
arguments = [[
|
||||
-h : this help
|
||||
]]
|
||||
|
||||
|
@ -57,9 +56,12 @@ local function help()
|
|||
print(author)
|
||||
print(version)
|
||||
print(desc)
|
||||
print('Example usage')
|
||||
print(example)
|
||||
print(ansicolors.cyan..'Usage'..ansicolors.reset)
|
||||
print(usage)
|
||||
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
|
||||
print(arguments)
|
||||
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
|
||||
print(example)
|
||||
end
|
||||
---
|
||||
-- Used to send raw data to the firmware to subsequently forward the data to the card.
|
||||
|
|
|
@ -2,11 +2,12 @@ local getopt = require('getopt')
|
|||
local cmds = require('commands')
|
||||
local lib14a = require('read14a')
|
||||
local utils = require('utils')
|
||||
local ansicolors = require('ansicolors')
|
||||
--
|
||||
-- Refactored iceman, 2019
|
||||
copyright = ''
|
||||
author = 'Martin Holst Swende & Asper'
|
||||
version = 'v1.0.1'
|
||||
version = 'v1.0.2'
|
||||
desc = [[
|
||||
This script will automatically recognize and dump full content of a NFC NDEF Initialized tag; non-initialized tags will be ignored.
|
||||
|
||||
|
@ -23,9 +24,9 @@ example = [[
|
|||
1. script run ndef_dump
|
||||
]]
|
||||
usage = [[
|
||||
script run ndef_dump
|
||||
|
||||
Arguments:
|
||||
script run ndef_dump [-h] [-d] [-v]
|
||||
]]
|
||||
arguments = [[
|
||||
-h this help
|
||||
-d debug logging on
|
||||
-v verbose output (from ndef parsing)
|
||||
|
@ -63,9 +64,12 @@ local function help()
|
|||
print(author)
|
||||
print(version)
|
||||
print(desc)
|
||||
print('Example usage')
|
||||
print(example)
|
||||
print(ansicolors.cyan..'Usage'..ansicolors.reset)
|
||||
print(usage)
|
||||
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
|
||||
print(arguments)
|
||||
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
|
||||
print(example)
|
||||
end
|
||||
--
|
||||
-- Sends an instruction to do nothing, only disconnect
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
local getopt = require('getopt')
|
||||
local lib14a = require('read14a')
|
||||
local utils = require('utils')
|
||||
local ansicolors = require('ansicolors')
|
||||
|
||||
copyright = 'Copyright (c) 2017 IceSQL AB. All rights reserved.'
|
||||
author = "Christian Herrmann"
|
||||
version = 'v1.0.4'
|
||||
version = 'v1.0.5'
|
||||
desc = [[
|
||||
This script writes a empty template for 3D printing system onto a empty NTAG213 or MAGIC NTAG21*
|
||||
|
||||
|
@ -21,9 +22,9 @@ example =[[
|
|||
script run ntag_3d -u 11223344556677 -c 46 -m 50 -p 5448 -s 4555 -l 200 -1
|
||||
]]
|
||||
usage = [[
|
||||
script run ntag_3d -h -t -u <uid> -c <color> -m <material> -p <region> -s <region> -l <length>
|
||||
|
||||
Arguments:
|
||||
script run ntag_3d [-h] [-t] [-u <uid>] [-c <color>] [-m <material>] [-p <region>] [-s <region>] [-l <length>]
|
||||
]]
|
||||
arguments = [[
|
||||
-h : this help
|
||||
-t : selftest
|
||||
-u <UID> : UID
|
||||
|
@ -168,9 +169,12 @@ local function help()
|
|||
print(author)
|
||||
print(version)
|
||||
print(desc)
|
||||
print('Example usage')
|
||||
print(example)
|
||||
print(ansicolors.cyan..'Usage'..ansicolors.reset)
|
||||
print(usage)
|
||||
print(ansicolors.cyan..'Arguments'..ansicolors.reset)
|
||||
print(arguments)
|
||||
print(ansicolors.cyan..'Example usage'..ansicolors.reset)
|
||||
print(example)
|
||||
end
|
||||
--
|
||||
-- Exit message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue