Skip to content

Instantly share code, notes, and snippets.

@PeterGabaldon
PeterGabaldon / noVNCpaste.js
Created September 6, 2026 20:26
noVNC Paste
/**
* Based on https://github.com/alew140/stupid-NoVNC-copy-paste/blob/main/Index.js
* VNCPaste
*
* Pastes clipboard text into a noVNC session by synthesising keyboard events
* on the canvas.
*
* Key points:
* - noVNC resolves the keysym from event.key, never from event.shiftKey,
* so the literal character must go in `key` ('@', not '2' + shiftKey).
@PeterGabaldon
PeterGabaldon / export-cloudflare-dmarc.ps1
Created September 2, 2026 08:29
Cloudflare DMARC Reports Exporter
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[ValidatePattern('^[0-9a-fA-F]{32}$')]
[string]$ZoneTag,
[Parameter(Mandatory)]
[Security.SecureString]$XAtok,
[Parameter(Mandatory)]
@PeterGabaldon
PeterGabaldon / gsocket_bincrypter.yar
Last active August 24, 2026 15:59
YARA rules — bincrypter-packed gsocket / gs-netcat implants
/*
YARA rules — bincrypter-packed gsocket / gs-netcat implants
------------------------------------------------------------------
Derived from analysis of a live intrusion sample ("netd.sh").
Chain: bincrypter shell dropper
-> AES+gzip -> UPX-packed ELF (UPX! magics zeroed)
-> gs-netcat 1.4.42beta5 (--enable-stealth)
+ 664-byte operator config appended to the packed file
@PeterGabaldon
PeterGabaldon / upx_elf.hexpat
Last active August 30, 2026 20:17
UPX-packed ELF64 HexPat
#pragma description UPX-packed ELF64 (tolerant of stripped UPX! magics)
#pragma author Peter Gabaldon
#pragma endian little
/*
* upx_elf.hexpat
* -----------------------------------------------------------------------
* Parses the UPX metadata that lives *after* the ELF program header table:
*
* Elf64_Ehdr @ 0x00
POST /[REDACTED]/oauth2/v2.0/token HTTP/2
Host: login.microsoftonline.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Content-Length: 1544
Referer: [REDACTED]
Origin: [REDACTED]
// Version 8.6 - 4:06PM EST 7/21/24
// Get ConfigStateUpdate and SensorHeartbeat events
#event_simpleName=/^(ConfigStateUpdate|SensorHeartbeat)$/ event_platform=Win
| cid=?cid
// Splitting aid list for large customers
| regex(field=aid, regex=?aidsubset)
// Parse ConfigStateUpdate and extract Channel File 291 version number; accept all SensorHeartbeat events and rename timestamp field
// Get ConfigStateUpdate and SensorHeartbeat events
#event_simpleName=/^(ConfigStateUpdate|SensorHeartbeat)$/ event_platform=Win
// Narrow search to Channel File 291 and extract version number; accept all SensorHeartbeat events within impact window
| case{
#event_simpleName=ConfigStateUpdate | regex("\|1,123,(?<CFVersion>.*?)\|", field=ConfigStateData, strict=false) | parseInt(CFVersion, radix=16);
#event_simpleName=SensorHeartbeat | rename([[@timestamp, LastSeen]]);
}
| case{
@PeterGabaldon
PeterGabaldon / gist:1740b412f7ea9f2520506c9b712194ec
Created March 1, 2024 11:38
Spanish Names.Surnames Wordlist
Aaron.Aguilar
Aaron.Alonso
Aaron.alvarez
Aaron.Arias
Aaron.Benitez
Aaron.Blanco
Aaron.Blesa
Aaron.Bravo
Aaron.Caballero
Aaron.Cabrera
@PeterGabaldon
PeterGabaldon / krbrelay_privesc_howto.md
Created September 22, 2022 10:10 — forked from tothi/krbrelay_privesc_howto.md
Privilege Escalation using KrbRelay and RBCD

KrbRelay with RBCD Privilege Escalation HOWTO

Short HOWTO about one use case of the work from Cube0x0 (KrbRelay) and others.

TL;DR

No-Fix Local Privilege Escalation from low-priviliged domain user to local system on domain-joined computers.

Prerequisites:

  • LDAP signing not required on Domain Controller (default!)
@PeterGabaldon
PeterGabaldon / create_backup.sh
Last active May 27, 2021 16:39
Backup to a partition identifying it by its UUID. Generate an exclude from backup file interactively.
#! /bin/bash
# Pedro Gabaldon Julia 2021
# https://petergabaldon.github.io/
### COLORS
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'