Skip to content

Instantly share code, notes, and snippets.

View lnattrass's full-sized avatar
💭
Hindsight is 50-50

Liam Nattrass lnattrass

💭
Hindsight is 50-50
View GitHub Profile

My favourite base64 string prefix to discover

Hint: it's not LS0t, but close.

This is an old one from the archives.

TLDR

AWS EKS was logging ServiceAccount tokens in plaintext, the very same used to AssumeRoleWithWebIdentity, or connect to the kubernetes API server.

This occurred for us between March 2020 and May 2021.

@lnattrass
lnattrass / get_tds_cert.py
Last active February 6, 2025 23:30
A terrible way to connect to MS SQL Server and dump the certificate as a PEM
import sys
import pprint
import struct
import socket
import ssl
from time import sleep
# Standard "HELLO" message for TDS
prelogin_msg = bytearray([ 0x12, 0x01, 0x00, 0x2f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x06, 0x01, 0x00, 0x20,
0x00, 0x01, 0x02, 0x00, 0x21, 0x00, 0x01, 0x03, 0x00, 0x22, 0x00, 0x04, 0x04, 0x00, 0x26, 0x00,