LCD GUI for P4wnP1 ALOA

Overview

GUI for P4wnP1

  • Colorful UI interface for P4wnP1 ALOA
  • Don't pwn just as a USB client. Use also the USB host capabilities!
  • UPS Lite support
  • Scalability (I tried my best to make it easier to add new menus)

Main menu

I wanted to use also USB host capabilites of the P4wnP1.

So I implemented few scripts like Keystrokes->Duckyscript, Logitech dump with more scripts TODO; to make it more swissarmyknife like.

Device

โœ… Features

  • System info
  • Deploy HID attacks, templates
  • Gamepad
  • Dump logitech dongle (via munifying)
  • Automatically backdoor logitech dongle (if logitacker present)
  • Show images
  • Plug-in rubberducky/keyboard and get duckyscript!
  • Change UI colors

Typing speed Gamepad

โš™ Setup

Hardware

Layout

๐Ÿ“ Requirements:

๐Ÿ—ก For logitech attacks

๐Ÿ”จ Hardware tips

If you are planning to use the USB adapter you cannot solder it straight to the RPI.

You will need to place it under the UPS lite, because you will not be able to plug it in a laptop.

If you want smaller device you can shorten the pins on the raspberry pi. But I do not recommend it.

Instead solder new set of pins from bottom, with LCD placed on them.

Header fitment

๐Ÿงพ Software

Download latest P4wnP1 aloa image on sdcard.

cd /root/
git clone https://github.com/gloglas/rpi_gui
sudo ./rpi_gui/setup.sh

If errors are not present just reboot your pi and you are set!

๐Ÿ’พ Config gui_conf.json

It can be saved/loaded from options menu.

{
    "COLORS": {
        "BACKGROUND": "#000000",
        "BORDER": "#0e0e6b",
        "GAMEPAD": "#141494",
        "GAMEPAD_FILL": "#EEEEEE",
        "SELECTED_TEXT": "#EEEEEE",
        "SELECTED_TEXT_BACKGROUND": "#141494",
        "TEXT": "#9c9ccc"
    },
    "PATHS": {
        "ANALYZED_HID": "/root/rpi_gui/ducky/",
        "ANALYZED_HID_LOGS": "/root/rpi_gui/log/",
        "BASH_SCRIPTS": "/usr/local/P4wnP1/scripts/",
        "HID": "/usr/local/P4wnP1/HIDScripts/",
        "IMAGEBROWSER_START": "/root/",
        "MUNIFYING": "/root/munifying/"
    },
    "PINS": {
        "KEY1_PIN": 21,
        "KEY2_PIN": 20,
        "KEY3_PIN": 16,
        "KEY_DOWN_PIN": 19,
        "KEY_LEFT_PIN": 5,
        "KEY_PRESS_PIN": 13,
        "KEY_RIGHT_PIN": 26,
        "KEY_UP_PIN": 6
    }
}

๐Ÿ’ป Making your own menu and functions

The menu class has its own structure. I'll try to explain it to you the best I can.

Menu

Key "a" is a definition for menu.

If you are in "ab" menu and go one menu back, it will go to the "a" menu.

Items and structure

The items in menu in menu are in array.

First value is text displayed to the user.

The second value is:

  • Menu which will be displayed next (specified by [a-z]) - "ab"
  • Function with own stuff - ShowInfo
  • Function with parameter - [Templates, "WIFI"] or [SetColor, 2]
menu = {
    "a": (
        ["System info", ShowInfo],
        ["HID", "ab"],
        ["Logitech attacks", "ac"],
        ["USB tools", "ad"],
        ["Template selector", "aa"],
        ["Other features","ag"],
        ["Options", "ae"],
        ["System", "af"]
    ),
    "aa": (
        ["Full settings", [Templates, "FULL_SETTINGS"]],
        ["WiFi", [Templates, "WIFI"]],
    ..snip..
    "aea": (
        ["Background", [SetColor, 0]],
        ["Text", [SetColor, 2]],
    ..snip..
}

So If you want to add your own you just follow the example.

Function called from menu

Requires:

  • It is recommended to set location (basically just user is not in menu) with - m.which = m.which + "1"
  • Draw empty background - color.DrawMenuBackground()
  • Wait a few milliseconds so the user doesn't accidentally presses some button - time.sleep(0.4)
  • After leaving the function, set the location accordingly with - m.which = m.which[:-1]
def ShowInfo():
    m.which = m.which + "1"
    color.DrawMenuBackground()
    time.sleep(0.4)
    
    # Your stuff here

    m.which = m.which[:-1]

๐Ÿ‘ Helper functions

Dialogs

Yes or No dialog

YNDialog

def YNDialog(a="Are you sure?", y="Yes", n="No",b=""):

Arguments: First line; text for YES; text for NO; Second line; Returns: True/False

Dialog

def Dialog(a, wait=True):

Basic Message box

Arguments: Text; Waits for user to click ok;

Scroll trought text (like in menu)

def GetMenuString(inlist,duplicates=False):

Arguments: List of strings with labels to show; bool, if your lists contains duplicates (to show the list properly); Returns: Selected string from array.

Show text without selection ("slide")

def GetMenuPic(a):

Arguments: List of lists with labels to show; Returns: Index of selected slide (-1 for none).

Wait for button press

def getButton():

Returns: Name of the pressed button (defined in json config).

RGB color picker

Color picker

def GetColor(final_color="#000000"):

Arguments: Color you start with; Returns: #RRGGBBselected color in hex

๐Ÿ“‹ TODO

  • More features for Logitech stuff
  • Dump USB storage
  • Construct HID payloads
  • Terminal

๐Ÿ“š Credits and sources

You might also like...
A small pomodoro GUI for Windows/Linux created in Python with PyQt5.
A small pomodoro GUI for Windows/Linux created in Python with PyQt5.

Pomodoro A small pomodoro GUI for Windows/Linux created with PyQt5. Features The "Timer" tab allows you to set your desired work and rest times aswell

Learn to build a Python Desktop GUI app using pywebview, Python, JavaScript, HTML, & CSS.
Learn to build a Python Desktop GUI app using pywebview, Python, JavaScript, HTML, & CSS.

Python Desktop App Learn how to make a desktop GUI application using Python, JavaScript, HTML, & CSS all thanks to pywebview. pywebview is essentially

A Minimalistic Backup GUI for your Windows, Mac or Linux
A Minimalistic Backup GUI for your Windows, Mac or Linux

BlobBackup is a minimalistic backup utility for your Windows, Mac or Linux computer. With an excellent engine, extensive storage support, and an easy

ZFS Administration GUI
ZFS Administration GUI

ZYGGY ZFS Administration GUI Zyggy is a very simple GUI for basic ZFS administration. The system provides graphical access for most frequently used ZF

A Minimalistic Backup GUI for your Windows, Mac or Linux
A Minimalistic Backup GUI for your Windows, Mac or Linux

BlobBackup is a minimalistic backup utility for your Windows, Mac or Linux computer. With an excellent engine, extensive storage support, and an easy

This is a GUI based text and image messenger. Other functionalities will be added soon.

Pigeon-Messenger (Requires Python and Kivy) Pigeon is a GUI based text and image messenger using Kivy and Python. Currently the layout is built. Funct

My Git GUI version made in Python and Tkinter.

Description My Git GUI version made in Python and Tkinter. How to use Basically, create a folder in your computer, open the software, select the path

GUI for Volatility forensics tool written in PyQT5
GUI for Volatility forensics tool written in PyQT5

Volatility GUI This is a GUI for Volatility forensics tool written in PyQT5 Prerequisites: 1- Installed version of Volatility. 2- Install PyQT5. sudo

Make nixos usable for non-technical users through a settings / package management GUI.
Make nixos usable for non-technical users through a settings / package management GUI.

Nix-Gui Make nixos usable for non-technical users through a settings / package management GUI. Motives The declarative nature of ni

Comments
  • screen size & rotation

    screen size & rotation

    Trying to get this to work with the 1.3inch LCD HAT from Waveshare I have made a few tweaks to get it to display, but everything is rotated 90degrees counter clockwise.

    Just wondering if there is a simple way to rotate the display so it shows up properly on my lcd screen?

    Found the answer: Changed the variable SCAN_DIR_DFT

    opened by sgtbane 1
  • Errors!

    Errors!

    I am trying to install but getting these errors

    root@kali:~/rpi_gui# sh setup.sh Hit:1 http://mirror.serverius.net/kali kali-rolling InRelease Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python3-netifaces Requirement already satisfied: spidev in /usr/local/lib/python3.10/dist-packages (3.5) Requirement already satisfied: keyboard in /usr/local/lib/python3.10/dist-packages (0.13.5) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv Setting up interfaces : Invalid argumentt create /boot/config.txt : Invalid argumentt create /boot/config.txt : Invalid argumentt create /boot/config.txt : not found0: -e Installing munifying

    fatal: destination path 'munifying' already exists and is not an empty directory. setup.sh: 13: cd: can't cd to munifying : not found4: ./install_libusb.sh can't load package: package .: no Go files in /root/rpi_gui -e Munifying Failed!!!

    : not found6: -e Setting up startup scripts

    : not found2: Invalid unit name "ctrl-alt-del.target " escaped as "ctrl-alt-del.target\x0d" (maybe you should use systemd-escape?). Unknown operation daemon-reload . : not found5: mkdir: cannot create directory 'rpi_gui/log\r': No such file or directory mkdir: cannot create directory 'rpi_gui/ducky\r': No such file or directory : not found8: -e Now you need to reboot!

    opened by LeoL2312 3
  • Waveshare UPS - I'm getting OSError: [Errno 121] Remote I/O error

    Waveshare UPS - I'm getting OSError: [Errno 121] Remote I/O error

    Hello,

    at first I want to say the project looks very nice and huge thank you for your work! I was able to run it without UPS options, but I've just got a UPS and when I try to run the original main.py I get:

    Hi! Display routine has started! Traceback (most recent call last): File "/root/rpi_gui/main.py", line 1172, in PowerOnReset(bus) File "/root/rpi_gui/main.py", line 179, in PowerOnReset bus.write_word_data(address, 0xfe, 0x0054) OSError: [Errno 121] Remote I/O error

    I have a Waveshare UPS HAT For Raspberry Pi Zero do you have any idea how can I deal with it? It's probably about the communication ports differencies but how can I find the mapping for my ups?

    opened by teospl 1
Owner
John
He really loves hardware but he is sometimes lost when it comes to using a git.
John
A GUI for designing Python GUI's for PySimpleGUI.

SimpleGUIBuilder A GUI for designing Python GUI's for PySimpleGUI. Installation There is none :) just download the file from a release and run it. Don

Miguel Martins 65 Dec 22, 2022
PyQt5 Sample GUI Program - Python PyQt5 Sample GUI application

Python PyQt5 Sample GUI application Program work like this Designed GUI using De

Dimuth De Zoysa 5 Mar 27, 2022
The GUI application by Python3.8. Using QT Design draw UI and generator UI XML file provides to PySide2 build GUI components

The GUI application by Python3.8. Using QT Design draw UI and generator UI XML file provides to PySide2 build GUI components. Total adopt OOD design class, service, and abstract class. OOP implemented this project.

Jiage 1 Jan 11, 2022
A little Python library for making simple Electron-like HTML/JS GUI apps

Eel Eel is a little Python library for making simple Electron-like offline HTML/JS GUI apps, with full access to Python capabilities and libraries. Ee

Chris Knott 5.4k Jan 7, 2023
Turn (almost) any Python command line program into a full GUI application with one line

Gooey Turn (almost) any Python 2 or 3 Console Program into a GUI application with one line Support this project Table of Contents Gooey Table of conte

Chris 17k Jan 9, 2023
Build GUI for your Python program with JavaScript, HTML, and CSS

https://pywebview.flowrl.com pywebview is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its o

Roman 3.3k Jan 1, 2023
A Python native, OS native GUI toolkit.

Toga A Python native, OS native GUI toolkit. Prerequisites Minimum requirements Toga requires Python 3. Python 2 is not supported. If you're on macOS,

BeeWare 3.3k Dec 31, 2022
Custom GUI for your Blender add-ons using Dear ImGui

Dear Imgui for Blender Use the infamous Dear ImGui library directly in your Blender scripts! This means custom GUI drawing in your operators: Normally

Elie Michel 83 Dec 25, 2022
Edifice: a declarative GUI library for Python

Edifice is a Python library for building reactive UI, inspired by modern Javascript libraries such as React.

David Ding 193 Dec 11, 2022
A Python native, OS native GUI toolkit.

Toga A Python native, OS native GUI toolkit. Prerequisites Minimum requirements Toga requires Python 3. Python 2 is not supported. If you're on macOS,

BeeWare 3.3k Jan 2, 2023