$Path = "$PSScriptRoot\TotallyNotMalware.dll"
$bytes = [System.IO.File]::ReadAllBytes($Path)
$string = [System.Convert]::ToBase64String($bytes)
$string | Set-Clipboard
$dll = 'TVqQAAMAAAAEAAAA//8AALgAAAAA...'
$bytes = [System.Convert]::FromBase64String($dll)
[System.Reflection.Assembly]::Load($bytes)
function Add2Obj {
param (
$FirstName,
$LastName
)
return (New-Object psobject -Property @{FirstName=$FirstName;LastName=$LastName;})
}
$Names = @()
$Names += Add2Obj -FirstName "Justin" -LastName "Perdok"
<#
PS> $Names
LastName FirstName
-------- ---------
Perdok Justin
#>
Get-ChildItem | Where-Object {$_.name -ne 'Policydefinitions'} | Get-ChildItem -Recurse -File | ForEach-Object {$_.fullname; Get-Content $_.fullname | Select-String cpassword}
https://github.com/PowerShellMafia/PowerSploit/blob/master/Exfiltration/Get-GPPPassword.ps1
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
N/A