Skip to content

Commit 0b31e99

Browse files
authored
Update BadPS.ps1
1 parent bb8dbfd commit 0b31e99

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

BadPS.ps1

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# features will be added later. This project is meant for development
77
# and education purposes only.
88
# AUTHOR: InfoSecREDD
9-
# Version: 2.3.6
9+
# Version: 2.3.7
1010
# Target: Windows
11-
$version = "2.3.6"
11+
$version = "2.3.7"
1212
$source = @"
1313
using System;
1414
using System.Collections.Generic;
@@ -813,6 +813,13 @@ function runFlipper {
813813
} else {
814814
$lastLine = $line
815815
}
816+
if ($line -match '^WAIT_FOR_BUTTON_PRESS(.*)') {
817+
Write-Host "`n`n${BW}[${R}Paused${BW}] ${BY}WAITING FOR BUTTON PRESS${BW}... Press ${BR}ENTER${BW} to continue...`n`n"
818+
$null = Read-Host
819+
Write-Host " ${C}Performing a ${BW}ALT-TAB${C} to refocus last Window and resuming in 5 seconds...`n ${BR}DO NOT TOUCH OR TYPE ANYTING! PAYLOAD IS STILL RUNNING!!!"
820+
Sleep 5
821+
[System.Windows.Forms.SendKeys]::SendWait('%{TAB}')
822+
}
816823
if ($line -match '^STRING_DELAY (\d+)' -Or $line -match '^STRINGDELAY (\d+)') {
817824
$global:delayString = [int]$matches[1]
818825
}
@@ -1068,6 +1075,13 @@ function runFlipper {
10681075
if ($line -match '^ENTER(.*)') {
10691076
SendKeys -SENDKEYS '{ENTER}'
10701077
}
1078+
if ($line -match '^WAIT_FOR_BUTTON_PRESS(.*)') {
1079+
Write-Host "`n`n[Paused] WAITING FOR BUTTON PRESS... Press any key to continue...`n`n"
1080+
$null = Read-Host
1081+
Write-Host " ${C}Performing a ${BW}ALT-TAB${C} to refocus last Window and resuming in 5 seconds...`n ${BR}DO NOT TOUCH OR TYPE ANYTING! PAYLOAD IS STILL RUNNING!!!"
1082+
Sleep 5
1083+
[System.Windows.Forms.SendKeys]::SendWait('%{TAB}')
1084+
}
10711085
if ($line -match '^CTRL-SHIFT(.*)' -Or $line -match '^CTRL\+SHIFT(.*)') {
10721086
$char = $matches[1]
10731087
if ($char -ne '' -Or $char -ne ' ') {
@@ -1644,7 +1658,6 @@ function runMenu {
16441658
Write-Host "${C} CAPSLOCK, INSERT, SPACE, PAUSE, PRINTSCREEN`n`n`n"
16451659
Write-Host "`n`n`n Press any key to continue...`n`n`n`n`n"
16461660
$null = Read-Host
1647-
Sleep
16481661
}
16491662
if ( $global:core -eq "1" ) {
16501663
Clear-Host
@@ -1716,9 +1729,9 @@ function runMenu {
17161729
} elseif ($selectedIndex -ge 0 -and $selectedIndex -lt $txtFiles.Count) {
17171730
$selectedFile = $txtFiles[$selectedIndex]
17181731
$file = $($selectedFile.Name)
1719-
Write-Host "`n`nUser selected: ${BY}$($selectedFile.Name)`nRunning payload using $coreDesc Core.`n"
1732+
Write-Host "`n`n${W}User selected: ${BY}$($selectedFile.Name)`n${W}Running payload using ${R}BadUSB${W} Core: ${BY}$coreDesc`n"
17201733
$confirm = ""
1721-
$confirm = Read-Host "You are about to run $($selectedFile.Name). Are you sure? (y`/N)"
1734+
$confirm = Read-Host "${W}You are about to run ${BR}$($selectedFile.Name)${W}. Are you sure? (y`/N)"
17221735
if ( $confirm -eq "yes" -Or $confirm -eq "y" -Or $confirm -eq "Y" ) {
17231736
if ([string]::IsNullOrEmpty($global:payloadDelay)) {
17241737
$j = 0
@@ -1743,7 +1756,7 @@ function runMenu {
17431756
Write-Host "`n ${C}Returning to Main Menu in 10 seconds...`n`n"
17441757
Sleep 10
17451758
} else {
1746-
Write-Host "`n Returning to Menu."
1759+
Write-Host "`n ${W}Returning to ${R}Main Menu${W}."
17471760
Sleep 4
17481761
}
17491762
} else {
@@ -1802,4 +1815,3 @@ while ($true) {
18021815
$ChkRun = "1"
18031816
}
18041817
}
1805-

0 commit comments

Comments
 (0)