Merge branch 'master' into master

Signed-off-by: Iceman <iceman@iuse.se>
This commit is contained in:
Iceman 2024-08-19 16:14:57 +02:00 committed by GitHub
commit e3842c8f7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 128 additions and 33 deletions

View file

@ -4,6 +4,8 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
## [unreleased][unreleased] ## [unreleased][unreleased]
- Fixed fm11rf08s script for non-4B UID (FM11RF08S-7B) (@Foxushka) - Fixed fm11rf08s script for non-4B UID (FM11RF08S-7B) (@Foxushka)
- Fixed missing require of ansicolors in `lf_hid_bulkclone_v2.lua` script (@whiteneon)
- Added `lf_t55xx_reset.lua` - a script to aid in quickly resetting t55xx chips (@whiteneon)
- Added more fingerprinting in `hf mf info` (@doegox) - Added more fingerprinting in `hf mf info` (@doegox)
- Added --issue and (--emu)lator support to `hf iclass encode` command (@micsen) - Added --issue and (--emu)lator support to `hf iclass encode` command (@micsen)
- Added custom CTF Wiegand format from Defcon32 with comments (@micsen) - Added custom CTF Wiegand format from Defcon32 with comments (@micsen)

View file

@ -1,9 +1,10 @@
local getopt = require('getopt') local getopt = require('getopt')
local ansicolors = require('ansicolors')
local cmds = require('commands') local cmds = require('commands')
copyright = '' copyright = ''
author = "TheChamop669" author = "TheChamop669"
version = 'v1.0.0' version = 'v1.0.1'
desc = [[ desc = [[
Perform bulk enrollment of 26 bit H10301 style RFID Tags Perform bulk enrollment of 26 bit H10301 style RFID Tags
For more info, check the comments in the code For more info, check the comments in the code

View file

@ -0,0 +1,89 @@
local getopt = require('getopt')
local ansicolors = require('ansicolors')
local utils = require('utils')
copyright = ''
author = 'whiteneon'
version = 'v1.0.0'
desc = [[
This script attempts to reset the password
- on a T55xx LF chip.
]]
example = [[
script run lf_t55xx_reset
]]
usage = [[
script run lf_t55xx_reset -h
]]
arguments = [[
-h : this help
]]
local DEBUG = true
---
-- A debug printout-function
local function dbg(args)
if not DEBUG then return end
if type(args) == 'table' then
local i = 1
while args[i] do
dbg(args[i])
i = i+1
end
else
print('###', args)
end
end
---
-- This is only meant to be used when errors occur
local function oops(err)
print('ERROR:', 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
---
-- The main entry point
function main(args)
local dash = string.rep('--', 20)
print( dash )
print( dash )
print()
-- Read the parameters
for o, a in getopt.getopt(args, 'h') do
if o == 'h' then return help() end
end
print('Attempting T55xx chip reset')
print(dash)
-- core.console('lf t55 write -b 0 -d 000880E0 --r0 -t')
-- core.console('lf t55 write -b 0 -d 000880E0 --r1 -t')
-- core.console('lf t55 write -b 0 -d 000880E0 --r2 -t')
-- core.console('lf t55 write -b 0 -d 000880E0 --r3 -t')
core.console('lf t55 write -b 0 -d 000880E0 --r0')
core.console('lf t55 write -b 0 -d 000880E0 --r1')
core.console('lf t55 write -b 0 -d 000880E0 --r2')
core.console('lf t55 write -b 0 -d 000880E0 --r3')
core.console('lf t55 wipe')
core.console('lf t55 detect')
print(dash)
print('all done!')
end
main(args)

View file

@ -62,22 +62,16 @@ args = parser.parse_args()
start_time = time.time() start_time = time.time()
p = pm3.pm3() p = pm3.pm3()
restore_color = False
p.console("prefs get color")
p.console("prefs set color --off")
for line in p.grabbed_output.split('\n'):
if "ansi" in line:
restore_color = True
p.console("hf 14a read") p.console("hf 14a read")
uid = None uid = None
for line in p.grabbed_output.split('\n'):
if "UID:" in line: if p.grabbed_output is not None:
uid = int(line[10:].replace(' ', '')[-8:], 16) for line in p.grabbed_output.split('\n'):
if "UID:" in line:
uid = int(line[10:].replace(' ', '')[-8:], 16)
if uid is None: if uid is None:
print("Card not found") print("Card not found")
if restore_color:
p.console("prefs set color --ansi")
_ = p.grabbed_output
exit() exit()
print("UID: " + color(f"{uid:08X}", fg="green")) print("UID: " + color(f"{uid:08X}", fg="green"))
@ -136,9 +130,6 @@ for sec in range(NUM_SECTORS):
nt_enc[sec][key_type] == "" or nt_enc[sec][key_type] == "" or
par_err[sec][key_type] == ""): par_err[sec][key_type] == ""):
print("Error, could not collect nonces, abort") print("Error, could not collect nonces, abort")
if restore_color:
p.console("prefs set color --ansi")
_ = p.grabbed_output
exit() exit()
print("Running staticnested_1nt & 2x1nt when doable...") print("Running staticnested_1nt & 2x1nt when doable...")
@ -330,9 +321,6 @@ for sec in range(NUM_SECTORS):
print_key(sec, key_type_target, found_keys[sec][key_type_target]) print_key(sec, key_type_target, found_keys[sec][key_type_target])
if abort: if abort:
break break
if restore_color:
p.console("prefs set color --ansi")
_ = p.grabbed_output
if abort: if abort:
print("Brute-forcing phase aborted via keyboard!") print("Brute-forcing phase aborted via keyboard!")

View file

@ -1164,11 +1164,26 @@ int getIndalaBits(uint8_t fc, uint16_t cn, uint8_t *bits) {
} }
// add parity // add parity
bits[34] = 1; // p1 64 - 30 = 34 // bits[34] = 1; // p1 64 - 30 = 34
bits[38] = 1; // p2 68 - 30 = 38 // bits[38] = 1; // p2 68 - 30 = 38
// 92 = 62 // 92 = 62
// 93 = 63 // 93 = 63
bits[34] = 0; // parity for odd bits
bits[38] = 0; // parity for even bits
uint8_t p1 = 1;
uint8_t p2 = 1;
for (int i=33; i < 64; i++) {
if (i%2)
p1 ^= bits[i];
else
p2 ^= bits[i];
}
bits[34] = p1; // parity for odd bits
bits[38] = p2; // parity for even bits
return PM3_SUCCESS; return PM3_SUCCESS;
} }

View file

@ -635,11 +635,7 @@ static const char ice[] =
"...................................................................\n @@@ @@@@@@@ @@@@@@@@ @@@@@@@@@@ @@@@@@ @@@ @@@\n" "...................................................................\n @@@ @@@@@@@ @@@@@@@@ @@@@@@@@@@ @@@@@@ @@@ @@@\n"
" @@! !@@ @@! @@! @@! @@! @@! @@@ @@!@!@@@\n !!@ !@! @!!!:! @!! !!@ @!@ @!@!@!@! @!@@!!@!\n" " @@! !@@ @@! @@! @@! @@! @@! @@@ @@!@!@@@\n !!@ !@! @!!!:! @!! !!@ @!@ @!@!@!@! @!@@!!@!\n"
" !!: :!! !!: !!: !!: !!: !!! !!: !!!\n : :: :: : : :: ::: : : : : : :: : \n" " !!: :!! !!: !!: !!: !!: !!! !!: !!!\n : :: :: : : :: ::: : : : : : :: : \n"
_RED_(" . .. .. . . .. ... . . . . . .. . ") _RED_(" . .. .. . . .. ... . . . . . .. . ");
"\n...................................................................\n"
"...................................................................\n"
"...................................................................\n"
;
// Write a file's segments to Flash // Write a file's segments to Flash
int flash_write(flash_file_t *ctx) { int flash_write(flash_file_t *ctx) {
@ -647,7 +643,11 @@ int flash_write(flash_file_t *ctx) {
PrintAndLogEx(SUCCESS, "Writing segments for file: %s", ctx->filename); PrintAndLogEx(SUCCESS, "Writing segments for file: %s", ctx->filename);
bool filter_ansi = !g_session.supports_colors; char ice2[sizeof(ice)] = {0};
char ice3[sizeof(ice)] = {0};
memcpy_filter_ansi(ice2, ice, sizeof(ice), !g_session.supports_colors);
memcpy_filter_emoji(ice3, ice2, sizeof(ice2), g_session.emoji_mode);
size_t ice3len = strlen(ice3);
for (int i = 0; i < ctx->num_segs; i++) { for (int i = 0; i < ctx->num_segs; i++) {
flash_seg_t *seg = &ctx->segments[i]; flash_seg_t *seg = &ctx->segments[i];
@ -676,14 +676,14 @@ int flash_write(flash_file_t *ctx) {
baddr += block_size; baddr += block_size;
length -= block_size; length -= block_size;
block++; block++;
if (len < strlen(ice)) { if (len < ice3len) {
if (filter_ansi && !isalpha(ice[len])) { fprintf(stdout, "%c", ice3[len++]);
len++;
} else {
fprintf(stdout, "%c", ice[len++]);
}
} else { } else {
if ((len - ice3len) % 67 == 0) {
fprintf(stdout, "\n");
}
fprintf(stdout, "."); fprintf(stdout, ".");
len++;
} }
fflush(stdout); fflush(stdout);
} }