flipperzero-firmware icon indicating copy to clipboard operation
flipperzero-firmware copied to clipboard

BadUSB: add SYSRQ keys

Open rck opened this issue 2 years ago • 7 comments

What's new

This allows sending of SysRq keys[1]. This then for example allows sending the well known 'reisub' commands to safely reboot a otherwise frozen Linux box. Or obviously any of the other magic keys.

The advantage compared to sending it to /proc/sysrq-trigger is that one does not need a shell and depending on how broken the system is, one might not even be able to get a new shell. The SysRq keys still work.

The cost is adding a new/"non-standard" keyword, IMO it is worth it.

Example: DEFAULTDELAY 200 DELAY 1000 SYSRQ r SYSRQ e SYSRQ i SYSRQ s SYSRQ u SYSRQ b

If one really wants to test it, I suggest h(elp) or w(ait).

[1] https://en.wikipedia.org/wiki/Magic_SysRq_key

Verification

  • rebuild firmware and test with the example on a linux box:
DELAY 1000
SYSRQ h

and then check for output in dmesg

Fixes #1489

Checklist (For Reviewer)

  • [ ] PR has description of feature/bug or link to Confluence/Jira task
  • [ ] Description contains actions to verify feature/bugfix
  • [ ] I've built this code, uploaded it to the device and verified feature/bugfix

rck avatar Jul 26 '22 19:07 rck

  • added a harmless verification example that prints the sysrq help to the kernel ringbuffer

rck avatar Jul 27 '22 06:07 rck

this is now lingering around over a week without any feedback. is there anything I can do that this gets reviewed/acked?

rck avatar Aug 04 '22 07:08 rck

@rck Hi, sorry, we are preparing release for the factory. This PR will be merged next week.

skotopes avatar Aug 04 '22 07:08 skotopes

Also person in charge of USB is currently on vacation, so it's taking longer time than usual.

skotopes avatar Aug 04 '22 07:08 skotopes

thanks for the update, highly appreciated. no worries, just the usual "start nagging the maintainers after a week of silence" :)

rck avatar Aug 04 '22 08:08 rck

@rck Hi, sorry, we are preparing release for the factory. This PR will be merged next week.

It is now over a month. Any updates?

rck avatar Sep 12 '22 07:09 rck

Hi. Sorry for delay. We’ll merge it after elf support PR.

skotopes avatar Sep 12 '22 07:09 skotopes