Running a program from Flipper

Can I run a .exe file on a Windows PC from flipper?

For example, I have created a python executable and I would like to run it when BadUSB is ran.

As far as i know only if the file is already on the PC because flipper will not act as a storage device while on Bad USB mode, just emulates keyboard so you can’t move files from/to the flipper while in that mode.

Theoretically you can upload that executable online, have your BadUSB download that file with shell ( wget) and then run it.

This question tickled me and make me remember an old method I used lots of years ago. Basically the problem is that to upload a binary file and then run it only with the keyboard. Is this possible? The short question is Yes. And the main steps are:

  1. encode in hex format your file
  2. upload with the keyboard into the target machine
  3. make the target decode it
  4. run the decoded file on the target

To encode and decode the file I used the certutil command that is available by default on windows (I checked only 7 and 10)

This is the script I wrote, it will create and run a tiny.exe file on the target.
The exe will only display a messageBox but keep in mind not to trust anyone on internet, so BEFORE running the script check the content.

badusb_runexe.txt (2.6 KB)

If you need a better explanation check on my Github at this link: flipperzero_scripts/ at master · cberetta/flipperzero_scripts · GitHub

1 Like

Very cool, it would be like running and hex editor by keyboard commands and fill it in with the hex data of the executable file but on that case you wuld require the hex editor software to be already on the PC. You can’t do the other way so the limitation would be not to be able to save data to the flipper.

If the target has python installed you can always just pipe the body of a script into the python command.

But I like the idea of banging out the hex into an executable, that’s a good one.

1 Like