This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function New-PSHostSession { | |
[CmdletBinding(DefaultParameterSetName = 'ById')] | |
param ( | |
[Parameter(ParameterSetName = 'ById', Mandatory = $true, Position = 0)] | |
[int] $Id, | |
[Parameter(ParameterSetName = 'ByProcess', Mandatory = $true, ValueFromPipeline = $true)] | |
[System.Diagnostics.Process] $Process, | |
[Parameter(ParameterSetName = 'ByCustomPipeName', Mandatory = $true)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[Parameter(Mandatory = $true, Position = 0)] | |
[string] $InputPath, | |
[string] $OutputPath, | |
[ValidateSet("x64", "arm64")] | |
[string] $TargetArch = "x64", | |
[ValidateSet("windows", "linux", "osx")] | |
[string] $TargetOS = "windows", | |
[Parameter(Mandatory = $true)] | |
[string] $RuntimeConfigFile, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env pwsh | |
param( | |
[Parameter(Position = 0, Mandatory = $true)] | |
[string] $ZipFilePath, | |
[Parameter(Position = 1, Mandatory = $true)] | |
[string] $FilePattern, | |
[Parameter(Position = 2, Mandatory = $true)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Install-WinDbg { | |
param( | |
[switch] $Start | |
) | |
# Change default progress preference (faster downloads) | |
$DefaultProgressPreference = $ProgressPreference | |
$ProgressPreference = 'SilentlyContinue' | |
Write-Host "Downloading windbg.appinstaller (XML manifest file)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Install-DbgHelp { | |
param ( | |
[Parameter(Mandatory=$true, Position=0)] | |
[string] $DbgHelpBaseDir, | |
[Parameter()] | |
[string[]] $DbgHelpFiles = @('dbghelp.dll','symsrv.dll','srcsrv.dll'), | |
[Parameter()] | |
[switch] $Cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -TypeDefinition @" | |
using System; | |
using System.Runtime.InteropServices; | |
namespace WinCred | |
{ | |
public enum CRED_MARSHAL_TYPE | |
{ | |
CertCredential = 1, | |
UsernameTargetCredential, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -TypeDefinition @' | |
using System; | |
using System.Runtime.InteropServices; | |
using System.Security.Cryptography.X509Certificates; | |
public enum DSREG_JOIN_TYPE { | |
DSREG_UNKNOWN_JOIN = 0, | |
DSREG_DEVICE_JOIN = 1, | |
DSREG_WORKPLACE_JOIN = 2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__int64 KdcInitializeCerts(void) | |
{ | |
unsigned __int8 v0; // cl | |
int v1; // r12d | |
HANDLE EventW; // rax | |
unsigned int v3; // r14d | |
char *Heap; // rax | |
char *v5; // r15 | |
const char *v6; // r9 | |
const char *v7; // rdi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script to duplicate and edit the smartcard logon certificate template for easy testing | |
$certca = @" | |
using System; | |
using System.Runtime.InteropServices; | |
public class CertCA | |
{ | |
public const uint CA_FLAG_ENUM_ALL_TYPES = 0x00000004; | |
public const uint CT_FIND_LOCAL_SYSTEM = 0x00000002; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-PortKnock | |
{ | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true,Position=0)] | |
[string] $HostName, | |
[Parameter(Mandatory=$true,Position=1)] | |
[Int32[]] $Sequence, | |
[Parameter(Mandatory=$false,Position=2)] | |
[Int32] $Delay = 500 |
NewerOlder