Skip to content

Commit

Permalink
[BadUSB] Improve ChromeOS and GNOME demo scripts (#3948)
Browse files Browse the repository at this point in the history
* [BadUSB] Gnome Demo: Support most terminals and force sh shell when not using Bash as default
* [BadUSB] ChromeOS Demo: Minor improvements, such as exit overview, select omnibox and add a page title

Signed-off-by: Kowalski Dragon (kowalski7cc) <5065094+kowalski7cc@users.noreply.github.com>
Co-authored-by: Kowalski Dragon (kowalski7cc) <5065094+kowalski7cc@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
  • Loading branch information
3 people authored Oct 15, 2024
1 parent dc9548d commit c917135
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
9 changes: 7 additions & 2 deletions applications/main/bad_usb/resources/badusb/demo_chromeos.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
REM This is BadUSB demo script for ChromeOS by kowalski7cc
REM This is BadUSB demo script for Chrome and ChromeOS by kowalski7cc

REM Exit from Overview
ESC
REM Open a new tab
CTRL t
REM wait for some slower chromebooks
DELAY 1000
REM Make sure we have omnibox focus
CTRL l
DELAY 200
REM Open an empty editable page
DEFAULT_DELAY 50
STRING data:text/html, <html contenteditable autofocus><style>body{font-family:monospace;}
STRING data:text/html, <html contenteditable autofocus><title>Flipper Zero BadUSB Demo</title><style>body{font-family:monospace;}
ENTER
DELAY 500

Expand Down
18 changes: 13 additions & 5 deletions applications/main/bad_usb/resources/badusb/demo_gnome.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ REM Check the `lsusb` command to know your own devices IDs

REM This is BadUSB demo script for Linux/Gnome

REM Exit from Overview
ESC
DELAY 200
REM Open terminal window
DELAY 1000
ALT F2
DELAY 500
STRING gnome-terminal --maximize
DELAY 500
DELAY 1000
REM Let's guess user terminal, based on (almost) glib order with ptyxis now default in Fedora 41
STRING sh -c "xdg-terminal-exec||kgx||ptyxis||gnome-terminal||mate-terminal||xfce4-terminal||tilix||konsole||xterm"
DELAY 300
ENTER
REM It can take a bit to open the correct terminal
DELAY 1500

REM Make sure we are running in a POSIX-compliant shell
STRING env sh
ENTER
DELAY 750

REM Clear the screen in case some banner was displayed
STRING clear
Expand Down

0 comments on commit c917135

Please # to comment.