Table of Contents
This function can be used to set the volume of your targets PC
In this function we will create an object to allow us to use the Send Keys method to either raise or lower the volume using the following syntax
Set-Volume 50
Function Set-Volume
{
Param(
[Parameter(Mandatory=$true)]
[ValidateRange(0,100)]
[Int]
$volume
)
# Calculate number of key presses.
$keyPresses = [Math]::Ceiling( $volume / 2 )
# Create the Windows Shell object.
$obj = New-Object -ComObject WScript.Shell
# Set volume to zero.
1..50 | ForEach-Object { $obj.SendKeys( [char] 174 ) }
# Set volume to specified level.
for( $i = 0; $i -lt $keyPresses; $i++ )
{
$obj.SendKeys( [char] 175 )
}
}
Listed below are payloads that have used one of these functions: