Skip to content

Latest commit

 

History

History
127 lines (96 loc) · 3.32 KB

Set-Volume.md

File metadata and controls

127 lines (96 loc) · 3.32 KB

Logo

Table of Contents
  1. Description
  2. The Function
  3. Examples
  4. Contact
  5. Acknowledgments

Set Volume

Python
YouTube Tutorial

Description

This function can be used to set the volume of your targets PC

The Function

[Set-Volume]

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 )
    }
}

(back to top)

Examples

Listed below are payloads that have used one of these functions:

Acid Burn

JumpScare

(back to top)

Contact

📱 My Socials 📱

C#
YouTube
Python
Twitter
Golang
Instagram
Jsonnet
Discord

(back to top)

Acknowledgments


HOME-PAGE

(back to top)