Skip to content

Instantly share code, notes, and snippets.

@MayerDaniel
MayerDaniel / default_wsl_user.sh
Created October 1, 2025 20:24
run inside of wsl in the the context of the user you want to be default
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe "Get-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss\*\ DistributionName | Where-Object -Property DistributionName -eq $WSL_DISTRO_NAME | Set-ItemProperty -Name DefaultUid -Value $(id -u)"
@MayerDaniel
MayerDaniel / deshittify.sh
Created April 25, 2025 15:59
deshittify log file
cat 20241127_* | perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g' | ansifilter | col -b | less
@MayerDaniel
MayerDaniel / proxifier.bat
Last active November 7, 2024 20:22
proxifier setup kerberos
ksetup /addkdc INTERNAL.LAB dc01.internal.lab
ksetup /setrealmflags INTERNAL.LAB tcpsupported
add lsass.exe to proxifier
@MayerDaniel
MayerDaniel / mount_shared_drive.sh
Created August 23, 2024 18:37
mount shared drives vmware
sudo vmhgfs-fuse .host:/ /mnt/hgfs/ -o allow_other -o uid=1000
import struct
import argparse
def hex_string_to_guid(hex_string):
# Convert the hex string to bytes
guid_bytes = bytes.fromhex(hex_string)
if len(guid_bytes) != 16:
print("Invalid GUID hex string length")
return None
Import-Module -Name NtObjectManager
$rpc = ls C:\Windows\System32\* | Get-RpcServer
$rpc | Where-Object {$_.InterfaceId -eq '4b324fc8-1670-01d3-1278-5a47bf6ee188'} | Format-List
$server = $rpc | Where-Object {$_.InterfaceId -eq '4b324fc8-1670-01d3-1278-5a47bf6ee188'}
$Proc12 = $server.Procedures | Where-Object {$_.ProcNum -eq 12}
$Proc12
@MayerDaniel
MayerDaniel / submodule_rm.sh
Created March 8, 2024 17:37
remove git submodule
git rm --cached submodule_path # delete reference to submodule HEAD (no trailing slash)
git rm .gitmodules # if you have more than one submodules,
# you need to edit this file instead of deleting!
rm -rf submodule_path/.git # make sure you have backup!!
git add submodule_path # will add files instead of commit reference
git commit -m "remove submodule"
@MayerDaniel
MayerDaniel / capstone_server.md
Last active October 9, 2025 20:35
Capstone notes
@MayerDaniel
MayerDaniel / create_service.md
Last active September 11, 2025 08:03
create_service.md

Service Creation Logs: Security 4697 and System 7045

Create Service

# Define service parameters
$serviceName = "MyTestService"
$serviceDisplayName = "MY Test Service"
$serviceDescription = "This is a test service created for demonstration purposes."
$serviceExecutablePath = "C:\Windows\System32\cmd.exe"
@MayerDaniel
MayerDaniel / guidconvert.py
Last active June 25, 2024 10:29
Example IDA Plugin - GUID Convert
import idaapi
import idautils
import idc
import struct
CONTEXT_MENU_PATH = 'GUIDConvert/'
ITEM_NAME = 'Convert GUID Bytes'
class GuidConverterActionHandler(idaapi.action_handler_t):
def activate(self, ctx):