Skip to content

Instantly share code, notes, and snippets.

@conioh
conioh / README.md
Created May 1, 2021 22:06 — forked from cerebrate/README.md
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

NOTE

See https://gist.github.com/cerebrate/d40c89d3fa89594e1b1538b2ce9d2720#gistcomment-3563688 below before doing anything else.

Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

Yes, I've done this, and yes, it works. It is, however, entirely unsupported and assembled through reasonable guesswork, so if you try this and it explodes your computer, brain, career, relationships, or anything else, you agree that you take sole responsibility for doing it, that I never claimed it was a good idea, and that you didn't get these instructions from me .

@conioh
conioh / VMCXEditor.ps1
Created June 17, 2020 12:05 — forked from BenjaminArmstrong/VMCXEditor.ps1
PowerShell to edit VMCX files
# Editing a virtual machine file
# This PowerShell code takes an unregistered VMCX file
# It change the VM Name, disables Dynamic Memory, and sets the memory to 2GB
# It then saves the changed virtual machine configuration to a new path
# Parameters that will be changed
$VMConfigurationToEdit = "D:\VMs\Virtual Machines\3F99446F-1D9A-4010-8C8B-4E554E845181.vmcx"
$pathToSaveNewConfigTo = "D:\"
$newVMName= "NewVMName"
@conioh
conioh / Find-OrphanDockerLayers.ps1
Created October 30, 2019 03:08 — forked from olljanat/Find-OrphanDockerLayers.ps1
Find Windows containers orphan layers
param (
[switch]$RenameOrphanLayers
)
If ($RenameOrphanLayers) {
Write-Warning "$($env:COMPUTERNAME) -RenameOrphanLayers option enabled, will rename all orphan layers"
}
# Get known layers on Docker images
[array]$ImageDetails += docker images -q | ForEach { docker inspect $_ | ConvertFrom-Json }
$LanguageToAdd = "ar-IL"
$LanguageList = Get-WinUserLanguageList
$LanguageFound = $LanguageList | Where-Object LanguageTag -like $LanguageToAdd
If ($LanguageFound) {
$LanguageList.Remove($LanguageFound)
} Else {
$LanguageList.Add($LanguageToAdd)
Start-Process osk.exe
/*
* exception handling routines (xp 32-bit, partial/incomplete)
*
* ntdll 5.1.2600.5755
* v2 (updated jan 2011)
*
* - hawkes <hawkes@sota.gen.nz>
*
* useful link: http://www.eeye.com/html/resources/newsletters/vice/VI20060830.html
*
@conioh
conioh / HowtodownloadConsumerIso.txt
Created August 4, 2018 22:58 — forked from CHEF-KOCH/HowtodownloadConsumerIso.txt
Windows Redstone 4 (1803) - All download links - April Update
1. Open Chrome and search for User-Agent Switcher for Chrome extension, link https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg and select Add to Chrome
2. After the extension is installed/added, click the User-Agent extension and change User-Agent to Safari or Android mode
3. Open this link https://www.microsoft.com/en-us/software-download/windows10ISO
4. You will see the April Update ISO files, select the language and bit what you want, finally you can download it using download manager
5. Done, that's all, the direct link are valid only 24 hours after you created them.
Mirrors are here via adguard:
https://tb.rg-adguard.net/public.php
@conioh
conioh / CIPolicyParser.ps1
Created April 2, 2018 16:08 — forked from mattifestation/CIPolicyParser.ps1
Functions to recover information from binary Device Guard Code Integrity policies.
# Ensure System.Security assembly is loaded.
Add-Type -AssemblyName System.Security
function ConvertTo-CIPolicy {
<#
.SYNOPSIS
Converts a binary file that contains a Code Integrity policy into XML format.
Author: Matthew Graeber (@mattifestation)
@conioh
conioh / WMI_persistence_template.ps1
Created September 20, 2017 14:25
Fileless WMI persistence payload template (CommandlineEventConsumer, __IntervalTimerInstruction trigger, w/ registry payload storage)
# Step #1 - Prep payload
$Hive = 'HKLM'
$PayloadKey = 'SOFTWARE\PayloadKey'
$PayloadValue = 'PayloadValue'
$TimerName = 'PayloadTrigger'
$EventFilterName = 'TimerTrigger'
$EventConsumerName = 'ExecuteEvilPowerShell'
switch ($Hive) {
'HKLM' { $HiveVal = [UInt32] 2147483650 }
Function Set-VMNetworkConfiguration {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$true,
Position=1,
ParameterSetName='DHCP',
ValueFromPipeline=$true)]
[Parameter(Mandatory=$true,
Position=0,
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Symbol Server\Exclusions]
"AUDIOKSE.pdb"=""
"AppxDeploymentServer.pdb"=""
"Bridge.pdb"=""
"CONEQMSAPOGUILibrary.pdb"=""
"CPFilters.pdb"=""
"ClipUp.pdb"=""
"CprmLib.pdb"=""