-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C-U0007 firmware 012.010.00032 dongles does not accept encrypted keyframes #1
Comments
Do they reject everything or just the keyboard keys? What about mouse keyframes? |
Only the keyboard frames which are encrypted. Mouse frames, which are unencrypted, works flawlessly. If you have an ESP8266 and NRF24L01+, I can guide you through. Given that it all works for an earlier dongle firmware, I'm confident my AES encryption code is correct. |
I was thinking to mount the NRF24L01 to Atmega328 CH340, which can be directly connected to PC via USB cable. Would you think that will work or it has to be ESP8266? |
Are you planning to do something with the USB? The atmega should work, I'm just not sure of its computation power. Arduino IDE supports both atmega and ESP8266, but my code is based on VSCode, PlatformIO. |
@bilogic My idea is just to have plug & play device to work on. How do you connect ESP8266 to the computer? HDM, USB or you connect it to something else? Sorry for for the dump questions, software engineering is my stronger side. |
@skito the ESP8266 has development modules that connect via USB such as the Wemos D1 mini. Which timezone are you in? I'm on the move, can't provide useful links at the moment. |
@bilogic I'm in EET. Whenever you had time I'll appreciate some Amazon or eBay links to get start with the necessary hardware. Otherwise the Software guidelines are pretty straight forward. Seems that you've done great job so far. |
Do you mean Eastern GMT-4/5? |
GMT +2 |
This is what I'm using, feel free to find cheaper alternatives :) China is going into Chinese New Year, so expect 1-2 weeks of additional shipping. |
You might also want to check out this thread first Basically, have 2 x Logitech C-U0007 dongles flashed to the following firmware:
This led me to try and reverse engineer the dongle firmware 012.001.00032, but I could not get far due to a lack of skill. See my updates here https://www.reddit.com/r/LiveOverflow/comments/g8ajed/reverse_engineering_of_logitech_unifying_firmware/ The dongle firmware is basically an Intel 8051 binary, I was hoping to figure out what has changed in 32 since 19. |
Encryption method perhaps? You mentioned AES, maybe they changed from 128 to 256 or vice versa...will check as far as I get the hardware. I'm familiar with VS.Code, but new to PlatformIO. However I guess is nothing different from other frameworks. |
Hmm, I'm working based on inference logic here:
Anyway, I shall not comment further on my opinions, I welcome your fresh perspective on this to hopefully get this resolved. :) The AES is also quite unlike the typical AES implemented in more serious encryption. I can't remember the details off hand now, but do ask if you have trouble reading my code. |
On these how to properly connect both PCB - should I connect only 5v (VCC power supply rail) and Ground? |
Yes, use the 5v for VCC, I have updated the WEMOS D1 mini D3 <-> power board CS |
Perfect! Thanks! |
@skito just curious, do you plan to disassemble the dongle firmware? |
@bilogic I think to give a try to the latest one - ...00032. Will connect with mouse movements first, to be sure that everything is connected properly and then will check up the keys encryption to try improve it. Do you know how to downgrade to ...00019 if I need it? |
@skito no idea how to downgrade it. I have 2 dongles myself, one 00019 and the other 00032. |
Well the goal here is to have it working with the latest so...I'll got the parts upcoming week. |
I wonder what is the "magic key sequence" here https://www.youtube.com/watch?v=EksyCO0DzYs |
@bilogic Are there any additional steps for connecting the D1 Mini ESP8266? PlatformIO can recognize the device. |
Nevermind, I needed to install additional CH34x driver. Now everything runs correctly and I'm able to send mouse movements to the receiver. So far so good. I'll let you know if any progress. |
Great, are you able to send encrypted keystrokes for dongle version 012.001.0019? |
My version is 024.001.00023 and yes - I'm able to send the encrypted keystrokes without any modification of your code. |
I think 024.001.00023 is meant for another hardware dongle, not C-U0007. |
Interesting, I take that when you select the Unifying Receiver, |
Strange indeed. You can try get one as well. |
@mgottschlag can confirm your repo is able to send A-Z keystrokes that are accepted by |
Sorry, I wanted to do that yesterday, but did not find the time. I will have access to the prototype again on wednesday, I'll try to test again then. I do not see why the test would fail, though - during the last test, the dongle accepted multiple key strokes, and I do not know why the dongle should reject other packet content. |
@bilogic ist this what you meant? https://github.com/BerndGottschlag/goboard/blob/firmware/firmware/main/src/unifying.c#L492 That code indeed works with RQR12.03_B0025 and RQR12.10_B0032. |
I can't seem to find the definitions for Hmm, ok, I will dig at my code harder to find out what is the issue. Thanks! |
@mgottschlag would you be able to show me the counter in byte form? i.e. suppose the counter is 0x12345678, next value would be 0x12345679, is this how you encode it?
I always have trouble with endian-ness. Appreciate your inputs. Thank you! |
KEY_A-KEY_RETURN are the HID key codes (src/keycodes.h), so yes, it cycles through a-z0-9 Currently, the initial counter is always 0xdeadc0de. Here are some example key packets - the counter is encrypted as big endian:
|
@mgottschlag thanks! @skito did you manage to make any progress? |
@bilogic No, not yet. Didn't had much time to work on it. |
@bilogic So far I can tell that mouse payloads don't work neither with firmware 012.009.00030. Only pairing works so far. |
@skito Does mouse actions work with |
@bilogic I don't have When the value is With value of |
So the actual solution here is to keep the mouse down button alive by sending payload every 10 milliseconds. Otherwise the newer firmware of Logitech receiver count it as button release (mouse up). I know that your focus is the keyboard, but this is just FYI. Someone else may have that struggle as well. |
@skito feel free to submit PRs if it will make the code better. Thank you. |
@mgottschlag can help check if your implementation works with |
Not sure if this helps you guys in any way, but have you seen these files? |
@rmbirle yes I have, thank you. |
@bilogic any updates? |
@Tiebe not really |
Hi @bilogic any updates? i'm very interested in this project |
Actually, the code works, they just added some logic to reject frames with 6 keys that pop out of nowhere. What do you want out of this project? Logitech introduced a new standard called |
Dude it’s so cool!! I’ve got a bunch of logi unifying dongles (u-c0007) I’m wanting to create a custom keyboard for my Xbox. I’ve been looking at using a SparkFun Pro nRF52840 Mini - Bluetooth Development Board https://www.sparkfun.com/products/15025. I’ve read rf has the lowest latency & reliability, although as it’s getting on as an old tech it’s hard to fine much code examples to connect node to node. I’d be stoked to get it working in harmony with a unifying receiver or something like this nRF52840 USB Key with TinyUF2 Bootloader https://www.adafruit.com/product/5199. Can’t beat the form factor of the unifying receiver tho. |
@bilogic |
@decrazyo thanks, where can I find out more about this 20ms that you speak of? Thank you! |
It's not well documented. This behavior can be observed by capturing the traffic between a device and a receiver. |
Ok, thanks I know what you are referring to now. Actually, the encryption code is good, it is more about what Logitech did to mitigate the vunerability, I recall Marc saying somewhere he wasn't completely satisfied. Were you able to send through a full buffer (one with 6 keystrokes) packet reliably? Since then, Logitech has released Bolt, have you play around with it? And 84 mechanical keyboards are dirt cheap these days, except I can't find one with a volume knob/media buttons on the left hand side. But of course, one with strong encryption will certainly bring more assurance. How far are you into your project? I more or less stopped when I realized that QMK will probably never run on ESP32. |
I tested sending 6 keystrokes at once and ran into the same problem that you did. The receiver rejected the packet. I haven't tested Bolt at all. I've read that it's built on top of Bluetooth LE and that kind of made me lose interest in it. I've only implemented pairing, encrypted keystrokes, and keep alive so far. I'm still hopeful that i can get my code added to TMK, QMK, ZMK, etc... some day. |
Yea, so Logitech just did some behavior mitigation, basically jacking is still possible. Personally, I'm neutral about radio transmission type as long as they don't pose usability issues. Bluetooth has the benefit of not requiring any special dongles but earlier versions of keyboards had persistent disconnections lasting several seconds, basically unacceptable. I'm not sure if BLE still poses the same problems, but what is your concern with it? Well, I'm happy about your project, especially if it makes it through to QMK. At least one of us got there. :) |
I think Logitech may have mitigated jacking by verifying that the AES counter is always greater than it was in the previous packet although i haven't tested that. I'm not too worried about Unifying's weak encryption keys either. My problems with Bluetooth just boil down to connection issues that I've experienced. I don't know too much about Bluetooth LE to be honest. I don't know if Bolt uses HID over GATT or not. |
Based on discussion and analysis here RoganDawes/LOGITacker#55, I suspect the latest firmware (
012.010.00032
) has some way to verify the counter from a real device and reject keyframes that do not count properlyMore info shared here https://www.reddit.com/r/LiveOverflow/comments/g8ajed/reverse_engineering_of_logitech_unifying_firmware
Feel free to ask questions or post if you managed to solve this.
The text was updated successfully, but these errors were encountered: