mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
CHG: just made the autopwn script main loop a bit more verbal
This commit is contained in:
parent
60e26e50c5
commit
fed1227777
3 changed files with 10 additions and 11 deletions
|
@ -33,8 +33,6 @@ end
|
||||||
function oops(err)
|
function oops(err)
|
||||||
print("ERROR: ",err)
|
print("ERROR: ",err)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Usage help
|
-- Usage help
|
||||||
function help()
|
function help()
|
||||||
|
|
|
@ -34,8 +34,6 @@ end
|
||||||
function oops(err)
|
function oops(err)
|
||||||
print("ERROR: ",err)
|
print("ERROR: ",err)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Usage help
|
-- Usage help
|
||||||
function help()
|
function help()
|
||||||
|
|
|
@ -66,7 +66,7 @@ end
|
||||||
function mfcrack()
|
function mfcrack()
|
||||||
core.clearCommandBuffer()
|
core.clearCommandBuffer()
|
||||||
-- Build the mifare-command
|
-- Build the mifare-command
|
||||||
local cmd = Command:new{cmd = cmds.CMD_READER_MIFARE, arg1 = 1}
|
local cmd = Command:new{cmd = cmds.CMD_READER_MIFARE, arg1 = 1, arg2 = 0}
|
||||||
|
|
||||||
local retry = true
|
local retry = true
|
||||||
while retry do
|
while retry do
|
||||||
|
@ -78,12 +78,11 @@ function mfcrack()
|
||||||
if errormessage then return nil, errormessage end
|
if errormessage then return nil, errormessage end
|
||||||
-- Try again..set arg1 to 0 this time.
|
-- Try again..set arg1 to 0 this time.
|
||||||
|
|
||||||
cmd = Command:new{cmd = cmds.CMD_READER_MIFARE, arg1 = 0}
|
cmd = Command:new{cmd = cmds.CMD_READER_MIFARE, arg1 = 0, arg2 = 0}
|
||||||
end
|
end
|
||||||
return nil, "Aborted by user"
|
return nil, "Aborted by user"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function mfcrack_inner()
|
function mfcrack_inner()
|
||||||
while not core.ukbhit() do
|
while not core.ukbhit() do
|
||||||
local result = core.WaitForResponseTimeout(cmds.CMD_ACK,1000)
|
local result = core.WaitForResponseTimeout(cmds.CMD_ACK,1000)
|
||||||
|
@ -187,10 +186,9 @@ end
|
||||||
-- The main entry point
|
-- The main entry point
|
||||||
function main(args)
|
function main(args)
|
||||||
|
|
||||||
|
|
||||||
local verbose, exit,res,uid,err,_,sak
|
local verbose, exit,res,uid,err,_,sak
|
||||||
local seen_uids = {}
|
local seen_uids = {}
|
||||||
|
local print_message = true
|
||||||
-- Read the parameters
|
-- Read the parameters
|
||||||
for o, a in getopt.getopt(args, 'hd') do
|
for o, a in getopt.getopt(args, 'hd') do
|
||||||
if o == "h" then help() return end
|
if o == "h" then help() return end
|
||||||
|
@ -198,6 +196,10 @@ function main(args)
|
||||||
end
|
end
|
||||||
|
|
||||||
while not exit do
|
while not exit do
|
||||||
|
if print_message then
|
||||||
|
print("Waiting for card or press any key to stop")
|
||||||
|
print_message = false
|
||||||
|
end
|
||||||
res, err = wait_for_mifare()
|
res, err = wait_for_mifare()
|
||||||
if err then return oops(err) end
|
if err then return oops(err) end
|
||||||
-- Seen already?
|
-- Seen already?
|
||||||
|
@ -206,7 +208,7 @@ function main(args)
|
||||||
if not seen_uids[uid] then
|
if not seen_uids[uid] then
|
||||||
-- Store it
|
-- Store it
|
||||||
seen_uids[uid] = uid
|
seen_uids[uid] = uid
|
||||||
print("Card found, commencing crack", uid)
|
print("Card found, commencing crack on UID", uid)
|
||||||
-- Crack it
|
-- Crack it
|
||||||
local key, cnt
|
local key, cnt
|
||||||
res,err = mfcrack()
|
res,err = mfcrack()
|
||||||
|
@ -223,6 +225,7 @@ function main(args)
|
||||||
nested(key,sak)
|
nested(key,sak)
|
||||||
-- Dump info
|
-- Dump info
|
||||||
dump(uid)
|
dump(uid)
|
||||||
|
print_message = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue