v1.5 (L/R count, OK=flush+CLOSED, signal=vibrate)

This commit is contained in:
Derek Jamison 2023-09-06 22:30:54 -05:00
parent 46f987a00e
commit 1b454277c8
6 changed files with 70 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -2,6 +2,17 @@
This file contains all changelogs for latest releases, from 1.3 onward.
## v1.5
### Added
When in "Receive Signals" you can now use LEFT/RIGHT arrows to decrease/increase the current count.
When in "Receive Signals" you can now use OK to force a CLOSED.
When in "Receive Signals" you can now use OK to flush the radio. So the next signal it detects can be a repeat of the previous signal, without needed custom firmware! (Press "OK" again to flush the radio again.)
When in "Receive Signals" the Flipper Zero now does a brief vibrate when it receives a signal.
## v1.4
### Fixed

View File

@ -1,6 +1,6 @@
# Rolling Flaws
Rolling Flaws (version 1.4) by [@CodeAllNight](https://twitter.com/codeallnight).
Rolling Flaws (version 1.5) by [@CodeAllNight](https://twitter.com/codeallnight).
[YouTube demo](https://youtu.be/gMnGuDC9EQo?si=4HLZpkC4XWhh97uQ) of using Rolling Flaws application. The video shows how to use the application to simulate a receiver that has a Replay attack flaw, Pairing FZ to a receiver, Cloning sequence attack, Future attack, Rollback attack & KGB attack. The Rolling Flaws application also supports things like "ENC00" attack & window-next attacks, which are described in scenarios below but was not in video. Rolljam is discussed in document, but discouraged to test since it is [illegal to jam signals](https://www.fcc.gov/general/jammer-enforcement) in the US. If you have additional ideas, please let me know!
@ -70,7 +70,7 @@ If you want to generate a custom SUB file for a specific key and count, you can
break;
```
If you want the Flipper Zero to be able to decode the same signal multiple times, in ``.\lib\subghz\protocols\protocol_items.c`` after the two occurances of ``instance->decoder.decode_count_bit = 0;`` add the line ``instance->generic.data = 0;``. This will cause the Flipper Zero to forget the previous data, so it will decode the same signal multiple times. Be sure to edit the file back when you are done.
If you press the "OK" button when reading, it will flush the radio and set the current status to CLOSED. This means you can attempt a replay attack without having to have custom firmware. If you don't want to have to press the OK button try attempt a replay, then you need to make the following change: If you want the Flipper Zero to be able to decode the same signal multiple times, in ``.\lib\subghz\protocols\protocol_items.c`` after the two occurances of ``instance->decoder.decode_count_bit = 0;`` add the line ``instance->generic.data = 0;``. This will cause the Flipper Zero to forget the previous data, so it will decode the same signal multiple times. Be sure to edit the file back when you are done.
To scan for more interesting sequences, make this breaking change to keeloq.c file that will keep incrementing the key until it finds a DoorHan code (but it leaves the FIX value the same). This is one technique to search for ENC00 sequences. Be sure to edit the file back when you are done.
```c

View File

@ -5,9 +5,9 @@ App(
entry_point="rolling_flaws_app",
requires=["gui", "subghz"],
stack_size=2 * 1024,
fap_version=(1, 4),
fap_version=(1, 5),
fap_icon="rolling_flaws.png",
fap_category="Sub-GHz",
fap_icon_assets="assets",
fap_description="Rolling code receiver (version 1.4), used to learn about rolling code flaws. Watch video at https://youtu.be/gMnGuDC9EQo",
fap_description="Rolling code receiver (version 1.5), used to learn about rolling code flaws. Watch video at https://youtu.be/gMnGuDC9EQo",
)

View File

@ -58,10 +58,15 @@ typedef enum {
typedef enum {
RollingFlawsEventIdReceivedSignal,
RollingFlawsEventIdCycleSignal,
} RollingFlawsEventId;
static bool decode_packet(FuriString* buffer, void* ctx) {
RollingFlaws* context = ctx;
furi_hal_vibro_on(true);
furi_delay_ms(50);
furi_hal_vibro_on(false);
if(furi_string_start_with_str(buffer, "KeeLoq 64bit")) {
if(!furi_string_start_with_str(
buffer, rolling_flaws_setting_protocol_base_name_get(context->model))) {
@ -160,6 +165,14 @@ bool rolling_flaws_view_dispatcher_custom_event_callback(void* context, uint32_t
return true;
}
if(event == RollingFlawsEventIdCycleSignal) {
RollingFlaws* app = (RollingFlaws*)context;
stop_listening(app->subghz);
uint32_t frequency = rolling_flaws_setting_frequency_get(app->model);
app->model->opened = false;
start_listening(app->subghz, frequency, decode_packet, app);
}
return false;
}
@ -267,9 +280,47 @@ void rolling_flaws_receive_signal_draw_callback(Canvas* canvas, void* model) {
furi_string_free(str);
}
bool rolling_flaws_view_input_callback(InputEvent* event, void* context) {
UNUSED(context);
bool rolling_flaws_view_input_ignore_callback(InputEvent* event, void* context) {
UNUSED(event);
UNUSED(context);
return false;
}
bool rolling_flaws_view_input_callback(InputEvent* event, void* context) {
RollingFlaws* app = (RollingFlaws*)context;
RollingFlawsModel* my_model = app->model;
FURI_LOG_I(TAG, "Input event received: %d", event->type);
if(event->type == InputTypeShort) {
FURI_LOG_I(TAG, "Input key: %d", event->key);
if(event->key == InputKeyLeft) {
if(my_model->count == 0) {
my_model->count = 0xFFFF;
} else {
my_model->count--;
}
__gui_redraw();
return true;
}
if(event->key == InputKeyRight) {
if(my_model->count == 0xFFFF) {
my_model->count = 0;
} else {
my_model->count++;
}
__gui_redraw();
return true;
}
if(event->key == InputKeyOk) {
my_model->opened = false;
view_dispatcher_send_custom_event(
app->view_dispatcher, RollingFlawsEventIdCycleSignal);
__gui_redraw();
return true;
}
}
return false;
}
@ -360,7 +411,7 @@ RollingFlaws* rolling_flaws_alloc() {
app->view_receive_sync = view_alloc();
view_set_context(app->view_receive_sync, app);
view_set_draw_callback(app->view_receive_sync, rolling_flaws_receive_sync_draw_callback);
view_set_input_callback(app->view_receive_sync, rolling_flaws_view_input_callback);
view_set_input_callback(app->view_receive_sync, rolling_flaws_view_input_ignore_callback);
view_set_previous_callback(
app->view_receive_sync, rolling_flaws_navigation_submenu_stop_sync_callback);
view_allocate_model(

View File

@ -1,7 +1,7 @@
#pragma once
#define ROLLING_FLAWS_ABOUT_TEXT \
"Rolling code receiver\n version 1.4\n" \
"Rolling code receiver\n version 1.5\n" \
"---\n" \
"Practice rolling code attacks without risking a desync!\n" \
"This app is for educational\n" \