Commit Graph

2857 Commits

Author SHA1 Message Date
WillyJL f8688d7e94 Merge pull request #207 from Next-Flip/ofw-3822-nestednonces
OFW PR 3822 (MIFARE Classic Key Recovery Improvements)
2024-09-27 03:54:22 +01:00
Willy-JL 448be96e0f Merge branch 'nestednonces' into ofw-3822-nestednonces 2024-09-27 02:38:59 +01:00
RocketGod a8ea95ed2c Add support for NTAG I2C Plus 1k and 2k chips (#237)
* Add support for NTAG I2C Plus 1k and 2k chips so my Dangerous Things xSIID implant scans and displays NDEF properly.

* Update changelog

* Format

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
2024-09-27 03:35:35 +02:00
noproto ba672e775f Support CUID dictionary 2024-09-25 10:27:32 -04:00
Willy-JL ae3b2d40e4 Merge branch 'nestednonces' into ofw-3822-nestednonces 2024-09-24 05:56:21 +01:00
Willy-JL 49fa88a188 Merge remote-tracking branch 'mntm/dev' into ofw-3822-nestednonces 2024-09-24 05:55:34 +01:00
Willy-JL 62ce89e41e Merge remote-tracking branch 'ul/dev' into mntm-dev 2024-09-24 05:47:20 +01:00
noproto cd76926c74 Note minor inefficiency 2024-09-23 19:13:20 -04:00
noproto 6ae950673e No nested dictionary attack re-entry 2024-09-23 19:06:08 -04:00
noproto 6eccdc8f93 Zero nested_target_key and msb_count on exit 2024-09-20 11:53:04 -04:00
MX 0df33899eb Frequency analyzer fixes and improvements
disable ext module due to lack of required hardware on them and incorrect usage of freq analyzer, like trying to receive "signals" with it (from the space??), while it should be used only to get frequency of the remote placed around 1-10cm around flipper's left corner

Also fix possible GSM mobile towers signal interference by limiting upper freq to 920mhz max

Fix dupliacted freq lists and use user config for nearest freq selector too (finally)
2024-09-20 06:35:46 +03:00
noproto 96606dc36f Typo 2024-09-18 12:52:22 -04:00
noproto c1cdd491a6 Implement progress bar for upgraded attacks in NFC app 2024-09-18 12:51:48 -04:00
Willy-JL bb9a2eb8ea Merge branch 'nestednonces' into ofw-3822-nestednonces 2024-09-18 02:12:43 +01:00
Willy-JL b1886e5593 Merge remote-tracking branch 'mntm/dev' into ofw-3822-nestednonces 2024-09-18 02:12:13 +01:00
jay candel 65df2e4d1f NFC: SmartRider Parser (#203)
* adding smartrider_parser

* adding SmartRider parser

new parser for SmartRider cards, a public transport smart card system used in Western Australia.
extracts and interprets key information from the card, including:
-Current balance
-Card serial number
-Concession type
-Purchase cost
-Details of the last two trips (including tag on/off status, cost, route, transaction number, and journey number)

* optimising

- removed all logging to simplify output.
- used early returns for clearer error handling.
- optimized setups outside loops to improve memory use.
- simplified flows by removing unnecessary loops.
- placed variables closer to their use for better readability.
- cached data blocks to streamline data handling.
- added a helper function for parsing trips, reducing redundancy.
- corrected loop counter types to avoid compile-time errors.

* cleaning displayed data

- removed transaction (txn) and journey (jrn) numbers to declutter the trip details.
- shortened "previous trip" to "prev trip" to optimize screen space usage.

* added and refined displayed data

added auto load field "threshold amount / reload amount"
changed serial to display first two digits as SR0 for consistency with physical card.

* Format

* Improved Verification Process

- Added definitions for STANDARD_KEY_2 and STANDARD_KEY_3
- Enhanced smartrider_verify function to check for all three specific keys:
  - STANDARD_KEY_1 in Sector 0 as Key A
  - STANDARD_KEY_2 in Sector 6 as Key A
  - STANDARD_KEY_3 in Sector 6 as Key B
- Implemented read operations to verify actual key values stored on the card
- Added comparisons between read key data and expected key values
- Improved debug logging for each step of the verification process

* Integrated Verification into Parse Function

- Added key verification for sectors 0 and 6
- Implemented do-while loop structure for early exit on verification failure
- Moved block readability checks inside verification process
- Added parsed flag to indicate successful parsing
- Updated return value to reflect parsing success
- Maintained existing parsing logic and output format

* fixed false positives

recieved some cuid cards today so was able to test for myself can confirm works... finally
changes made: 
-updated key assignment in smartrider_read
-simplified key verification in smartrider_parse
-improved error handling and logging
-streamlined data parsing process
-corrected key checking logic
-added checks for required block readability
-improved flow control with strategic breaks
-adjusted block data access method

* small optimizations

- refactored `smartrider_verify` and `smartrider_read` by abstracting repeated key operations into `authenticate_and_read` function for improved code maintainability.
- optimized `smartrider_read` by introducing a loop for key setup, reducing redundancy and improving efficiency.
- streamlined error handling in `smartrider_read` by replacing do-while loop with conditional checks.
- changed standard key references to use `standard_keys` array indices

* formatting

* Delete duplicate smartrider.c

* updated smartrider.c

* found 'fbt format'

* transaction parsing updates

-removed last trip/prev trip wording and replaced with "Trip History" header
-added date in front of each transaction 
-only shows transaction cost if it's higher than 0
-changed tag on/tag off to +/- to save room
-added 8 more transactions to Trip History
-verified still working and formatted with fbt

* fixed reboot with partially unlocked card

-added bounds checking for all block accesses to prevent out-of-range memory access
-implemented improved error handling with an error_occurred flag
-introduced a maximum iteration count for date calculation to prevent infinite loops
-used snprintf with size limits for all string operations to avoid buffer overflows
-added validation for trip count to ensure it doesn't exceed the maximum allowed
-implemented checks to skip unread or out-of-range blocks during trip parsing
-added safeguards against corrupted or invalid timestamp data

* optimized SmartRider card parsing and verification

- replaced do-while loop with direct error checks in smartrider_parse
- optimized key verification using direct memcmp in smartrider_verify
- introduced inline functions for common operations (e.g., set_key, read_le16)
- replaced bubble sort with insertion sort for trip data
- simplified date calculation using a lookup table for days in month
- used uint_fast8_t for loop counters to allow compiler optimization
- added __attribute__((hot)) to key functions for aggressive optimization
- removed redundant variable declarations and function calls
- optimized memory usage with static const arrays for required blocks
- simplified error handling in smartrider_read and authenticate_and_read
- used __builtin_memcpy and __builtin_memcmp for potential compiler optimizations
- tested and formatted with fbt

* small fixes

-renamed "Trip History" to "Tag On/Off History"
-fixed date calculation to account for leap years
-misc changes

* Update changelog

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
2024-09-18 03:00:49 +02:00
m7i-org df273950cc Sub-GHz: Show satellites count with an icon (#215)
* feat(subghz): show satellites if enabled

Replaces the display of the number of satellites during SubGHz scanning. If GPS is enabled (an an external module connected) it will blink a GPS icon with the number of sats currently in range (even if zero).
Using a 10x10px "positioning" icon that replaces the SubGHz icon on the bottom right.

* Revert api version to ofw release

* f18 too

* Tweak icon a little

* Update changelog

* Format

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
2024-09-18 01:43:30 +02:00
Mihai 425a97fe95 NFC: Added 6 new Mifare Classic keys from Bulgaria Hotel (#216)
* Update mf_classic_dict.nfc

Added 6 new keys from Bulgaria Hotel
Keys are not duplicated!

* Add section delimiter

* No LF at EOF

* Update changelog

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
2024-09-18 00:24:21 +02:00
noproto 3ab752b7a0 Clean up various issues 2024-09-17 14:38:14 -04:00
MX 31df2c0655 upd changelog 2024-09-16 19:17:05 +03:00
Nathan N 4836a54847 Merge branch 'flipperdevices:dev' into nestednonces 2024-09-16 05:27:52 -04:00
Willy-JL b31dec8e71 Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-09-14 01:10:44 +02:00
MX 891a6c047a Merge remote-tracking branch 'OFW/dev' into dev 2024-09-13 22:26:58 +03:00
porta 0428e82b14 Fix USB-UART bridge exit screen stopping the bridge prematurely (#3892)
* fix: exit screen stopping bridge prematurely
* refactor: merge exit confirmation scene into main usb uart scene
2024-09-12 17:32:07 +01:00
MX 2aa4797b12 Merge remote-tracking branch 'OFW/portasynthinca3/usbuart-stay-fix' into dev 2024-09-11 01:44:29 +03:00
Willy-JL baf14be587 Merge branch 'nestednonces' into ofw-3822-nestednonces 2024-09-10 20:34:33 +02:00
Willy-JL 777ab46ddf Merge remote-tracking branch 'mntm/dev' into ofw-3822-nestednonces 2024-09-10 20:34:12 +02:00
Anna Antonenko c1a009aed0 fix: exit screen stopping bridge prematurely 2024-09-10 19:58:44 +03:00
noproto ab8bc3e21c Clear TODO line 2024-09-09 20:51:51 -04:00
noproto cba58ed437 Add new backdoor key, fix UI status update carrying over from previous read 2024-09-09 20:50:15 -04:00
Willy-JL 26959f73d8 Merge remote-tracking branch 'ul/dev' into mntm-dev --nobuild 2024-09-10 01:03:42 +02:00
Willy-JL e282d8050f Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-09-09 23:20:14 +02:00
gornekich 9558a5fa08 Merge branch 'dev' into nestednonces 2024-09-09 13:34:47 +01:00
MX 80ad381eef extra checks [ci skip] 2024-09-09 05:13:02 +03:00
MX 7711b2daae Merge remote-tracking branch 'OFW/dev' into dev 2024-09-09 04:11:35 +03:00
MX 5da447a2b0 more chance to generate working remote at gangqi 2024-09-09 04:11:00 +03:00
christhetech131 543f6058e5 Infrared: add TCL 75S451 to TV universal remote (#3880)
* Update tv.ir
* Infrared: mark TCL 75S451 block in universal remote, cleanup extra spaces

Co-authored-by: あく <alleteam@gmail.com>
2024-09-08 23:54:38 +01:00
Eric Betts 75f4782fab Rename 'Detect Reader' to 'Extract MF Keys' (#3874)
* Rename 'Detect Reader' to 'Collect Nonces'
* Updated name
* Updated name
* Format Sources

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-09-08 23:43:14 +01:00
MX 6911ba12ad Merge remote-tracking branch 'OFW/dev' into dev 2024-09-07 22:31:11 +03:00
Willy-JL 3eab261ec2 MNTM: Lock dolphin butthurt if happy mode 2024-09-07 19:20:23 +02:00
Willy-JL 2b5b6543d6 Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-09-07 19:14:22 +02:00
Willy-JL c5fa2c46f8 Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-09-07 18:37:13 +02:00
Silent 8672a1d94c Replace all calls to strncpy with strlcpy, use strdup more, expose strlcat (#3866)
strlcpy doesn't zero the buffer and ensures null termination,
just like snprintf

strlcat is already used by mjs and it's a safe alternative to strcat,
so it should be OK to expose to apps
2024-09-07 17:16:56 +01:00
Aleksandr Kutuzov 9ea7a4671a Merge remote-tracking branch 'origin/dev' into nestednonces 2024-09-07 13:47:07 +01:00
Thomas Nemer 9bdf41d8ff feat: add linux/gnome badusb demo resource files (#3846)
* feat: add linux/gnome badusb demo resource files
* doc: use latest appimage package and install icon and desktop file

Co-authored-by: Thomas N <atom@fortytwo.fr>
Co-authored-by: あく <alleteam@gmail.com>
2024-09-07 13:25:13 +01:00
Willy-JL 45fab3cf3d Merge remote-tracking branch 'ul/dev' into mntm-dev 2024-09-07 00:16:52 +02:00
Willy-JL cb0798cdc3 Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-09-06 23:09:48 +02:00
MX 3f8a92bc86 Merge remote-tracking branch 'OFW/dev' into dev 2024-09-06 19:13:51 +03:00
Astra ad27713f0d [FL-3766] Fix crash on Ultralight unlock (#3855)
* Fix crash on Ultralight unlock
* Infrared: safe macroses

Co-authored-by: あく <alleteam@gmail.com>
2024-09-06 12:44:32 +01:00
MX 4098ee927e Merge remote-tracking branch 'OFW/dev' into dev [ci skip] 2024-09-06 12:56:52 +03:00