Skip to content

Instantly share code, notes, and snippets.

@adamdriscoll
adamdriscoll / Html5ColorPicker.ps1
Created January 2, 2025 08:23
HTML5 Color Picker for PowerShell Universal
function New-UDColorPicker {
[CmdletBinding()]
param(
[Parameter()]
[string]$Id = [Guid]::NewGuid(),
[Parameter()]
[ScriptBlock]$OnChange,
[Parameter()]
[string]$Value,
[Parameter()]
#Requires -PSEdition Desktop
function Get-AzureValidateResourceMoveResult
{
<#
.SYNOPSIS
Function to call Azure Validation API
.EXAMPLE
PS C:\>$validateSplat = @{
>> SourceSubscriptionID = '11111111-1111-1111-1111-111111111111'
@zadjii-msft
zadjii-msft / README.md
Last active October 14, 2025 23:37
Warp Workflows for the Windows Terminal

Add all the Warp Workflows to Windows Terminal

With a combination of features all available in Windows Terminal 1.22, you can now add all your favorite Warp Workflows directly to the Windows Terminal.

image image

This works by adding the workflows to your settings via a "settings fragment". You can then open a menu with all these workflows with the openSuggestions action.

@lumynou5
lumynou5 / youtube-commenter-names.user.js
Last active November 2, 2025 00:24
Make YouTube display the names of commenters instead of their handles.
// ==UserScript==
// @name YouTube Commenter Names
// @version 1.10.4
// @description Make YouTube display the names of commenters instead of their handles.
// @author Lumynous
// @license MIT
// @match https://www.youtube.com/*
// @match https://studio.youtube.com/*
// @exclude https://www.youtube.com/persist_identity
// @exclude https://studio.youtube.com/persist_identity
@Digiover
Digiover / Get-RandomString.ps1
Created June 7, 2023 08:27
Easily create a random string (or secure password) using PowerShell. Add to your PS profile
# Add to your PS profile to create random strings / secure passwords
# from within your PowerShell shell.
#
# Source / Author: Daniel Kåven
# https://teams.se/powershell-script-generate-a-random-password/
function Get-RandomString {
param (
[CmdletBinding(PositionalBinding=$false)]
[Parameter(Position=0)]
[ValidateRange(8, 256)]
NOTE: Copied as-is from "Linux Expert" forum in linkedin - https://www.linkedin.com/feed/update/urn:li:activity:7031604358630805504?utm_source=share&utm_medium=member_desktop
Not entirely tested from my end.
```
#!/bin/bash
# Update the package repository
apt-get update -y
# Install and configure the firewall (ufw)
apt-get install -y ufw
@FriedrichWeinmann
FriedrichWeinmann / DomainCryptographyScan.ps1
Last active October 24, 2024 16:27
Scans an Active Directory domain's and its principal's kerberos encryption configuration.
<#
.SYNOPSIS
Scans an Active Directory domain's and its principal's kerberos encryption configuration.
.DESCRIPTION
Scans an Active Directory domain's and its principal's kerberos encryption configuration.
It will generate all data via LDAP, and analyze the results for possible authentication issues.
It supports three ways to report:
- Print: Write analysis of results to screen
// ==UserScript==
// @name Gmail Sender Utils
// @namespace https://github.com/szhu
// @match https://mail.google.com/mail/u/*
// @version 1.3
// @author Sean Zhu
// @description Quickly drill down by sender or label in Gmail.
// @homepageURL https://gist.github.com/szhu/1d816086307c5de02bc9a2bb1cf01fe0
// @updateURL https://gist.github.com/szhu/1d816086307c5de02bc9a2bb1cf01fe0/raw/gmail-sender-utils.user.js
// @downloadURL https://gist.github.com/szhu/1d816086307c5de02bc9a2bb1cf01fe0/raw/gmail-sender-utils.user.js
@tothi
tothi / certifried_with_krbrelayup.md
Last active December 18, 2024 19:47
Certifried combined with KrbRelayUp: non-privileged domain user to Domain Admin without adding/pre-owning computer accounts

Certifried combined with KrbRelayUp

Certifried (CVE-2022-26923) gives Domain Admin from non-privileged user with the requirement adding computer accounts or owning a computer account. Kerberos Relay targeting LDAP and Shadow Credentials gives a non-privileged domain user on a domain-joined machine local admin access on (aka owning) the machine. Combination of these two: non-privileged domain user escalating to Domain Admin without the requirement adding/owning computer accounts.

The attack below uses only Windows (no Linux tools interacting with the Domain), simulating a real-world attack scenario.

Prerequisites:

@jdhitsolutions
jdhitsolutions / ADChangeReport.ps1
Created January 27, 2021 18:23
A PowerShell script to create an HTML report on recent changes in Active Directory.
#requires -version 5.1
#requires -module ActiveDirectory,DNSClient
# https://jdhitsolutions.com/blog/powershell/8087/an-active-directory-change-report-from-powershell/
#Reporting on deleted items requires the Active Directory Recycle Bin feature
[cmdletbinding()]
Param(
[Parameter(Position = 0,HelpMessage = "Enter a last modified datetime for AD objects. The default is the last 4 hours.")]
[ValidateNotNullOrEmpty()]