Skip to content

Instantly share code, notes, and snippets.

@WitherOrNot
WitherOrNot / a.md
Last active October 9, 2025 19:15
Disable S Mode without disabling secure boot or using MS account

S Mode Escape

Requirements

  • Access to Administrator-level account
  • Does not require MS account
  • Does not require disabling secure boot

How to Use

@WitherOrNot
WitherOrNot / tspkgen.py
Last active October 31, 2025 11:48
Terminal Services License Server ID + License Key Pack generator
from Crypto.Cipher import ARC4
from hashlib import sha1, md5
from random import randint
from ecutils.core import Point, EllipticCurve
from sys import argv
KCHARS = "BCDFGHJKMPQRTVWXY2346789"
SPK_ECKEY = {
"a": 1,
@Weithenn
Weithenn / WS2022_SBC_Lab_for_Azure_VM.ps1
Created July 27, 2022 03:12
Windows Server 2022 Single Node Caching/Tiering for Azure VM
# ===========================================================================
# Author: Weithenn Wang (weithenn at weithenn.org)
# Version: v0.1 - July 26, 2022
# Description: Windows Server 2022 Single Node Caching/Tiering for Azure VM
# ===========================================================================
# Install the Failover Clustering feature
Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools
@neggles
neggles / Set-VGpuEternalTrial.ps1
Last active October 20, 2025 04:24
Sets nVidia vGPU unlicensed state timeout to 24 hours and adds a daily scheduled task to restart the GPU drivers and reset the clock.
<#
.SYNOPSIS
Set vGPU VM instance into eternal trial.
.DESCRIPTION
Configures a Windows vGPU client for a 24-hour trial period and automatic daily driver restarts.
.EXAMPLE
Set-VGpuEternalTrial -RestartTime 2AM
.EXAMPLE
Set-VGpuEternalTrial -RestartTime 3AM -Filter '*GRID*'
.INPUTS
@neggles
neggles / New-GPUPDriverPackage.ps1
Last active November 4, 2025 20:46
Hyper-V GPU Virtualization
<#
.SYNOPSIS
Create a GPU-P Guest driver package.
.DESCRIPTION
Gathers the necessary files for a GPU-P enabled Windows guest to run.
.EXAMPLE
New-GPUPDriverPackage -DestinationPath '.'
.EXAMPLE
New-GPUPDriverPackage -Filter 'nvidia' -DestinationPath '.'
.INPUTS
@jessfraz
jessfraz / boxstarter.ps1
Last active November 9, 2025 07:03
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@mattifestation
mattifestation / FileReadPrimitive.ps1
Last active June 12, 2023 16:33
A WMI file content read primitive - ROOT/Microsoft/Windows/Powershellv3/PS_ModuleFile
$CimSession = New-CimSession -ComputerName 10.0.0.2
$FilePath = 'C:\Windows\System32\notepad.exe'
# PS_ModuleFile only implements GetInstance (versus EnumerateInstance) so this trick below will force a "Get" operation versus the default "Enumerate" operation.
$PSModuleFileClass = Get-CimClass -Namespace ROOT/Microsoft/Windows/Powershellv3 -ClassName PS_ModuleFile -CimSession $CimSession
$InMemoryModuleFileInstance = New-CimInstance -CimClass $PSModuleFileClass -Property @{ InstanceID= $FilePath } -ClientOnly
$FileContents = Get-CimInstance -InputObject $InMemoryModuleFileInstance -CimSession $CimSession
$FileLengthBytes = $FileContents.FileData[0..3]
[Array]::Reverse($FileLengthBytes)
@Neo23x0
Neo23x0 / nmap-cmdline
Last active March 19, 2020 17:10
Nmap Scan Params for CVE-2017-0143 MS17-010 Scanning
# Scan for CVE-2017-0143 MS17-010
# The vulnerability used by WannaCry Ransomware
#
# 1. Use @calderpwn's script
# http://seclists.org/nmap-dev/2017/q2/79
#
# 2. Save it to Nmap NSE script directory
# Linux - /usr/share/nmap/scripts/ or /usr/local/share/nmap/scripts/
# OSX - /opt/local/share/nmap/scripts/
#
@rpothier
rpothier / Examples
Last active February 4, 2018 21:25
HOT templates to bring up the ASAv and CRS 1000v
glance image-create --name asav971 --disk-format qcow2 --container-format bare --file ./asav971.qcow2
glance image-create --name csr1000v --disk-format qcow2 --container-format bare --file ./csr1000v-universalk9.16.04.01.qcow2
glance image-update b1b57ece-9d08-4f7a-b78c-91f5aedfd6ef --property hw_disk_bus=ide
glance image-update b1b57ece-9d08-4f7a-b78c-91f5aedfd6ef --property hw_vif_model=e1000
To bring up the ASAv
heat stack-create -f asav.yaml -P private_net=af747d91-5a40-4e0f-8d13-e4ae720ead85 asav
localadmin@gg33-ds2:~$ ssh [email protected]
[email protected]'s password: