Skip to content

Instantly share code, notes, and snippets.

View obormot's full-sized avatar
👾
hacking

Oscar I obormot

👾
hacking
View GitHub Profile
@obormot
obormot / udplb.py
Created December 8, 2012 23:25
Simple UDP load balancer
#!/usr/bin/env python
#------------------------------------------------------------------------------
# UDP Load Balancer featuring simple round robin with session affinity.
#------------------------------------------------------------------------------
import sys
import signal
import logging
from socket import *

Keybase proof

I hereby claim:

  • I am obormot on github.
  • I am obormot (https://keybase.io/obormot) on keybase.
  • I have a public key ASAHCTx0UWxGQLvHRRuazn8FxPLSUTUC6viWXgZOAH47YQo

To claim this, I am signing this object:

@obormot
obormot / enc.py
Last active May 30, 2026 22:54
cryptohack.org/challenges
# py2
import base64, codecs, json, socket
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect(('socket.cryptohack.org', 13377))
for i in range(101):
data = json.loads(conn.recv(1024))
print i, data,
@obormot
obormot / enc1.py
Created April 12, 2020 19:09
cryptohack.org/challenges
# py2
import socket, json
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect(('socket.cryptohack.org', 13372))
conn.recv(100) # "Gotta go fast!"
# OTP key len is 32 bytes (sha256 digest)
# by using all zeroes for input we don't need to de-XOR the key
input_data = '00' * 32
@obormot
obormot / enc2.py
Created April 12, 2020 20:43
cryptohack.org/challenges
# py2
# for each character of plaintext we could observe many variants of ciphertext value (XORed)
# but we'll never observe the actual value (no leaks!)
# so we could collect enough data and exclude what we have observed
# we end up with something we've never observed - the actual bytes of the key
import base64, socket, json
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@obormot
obormot / security-review-warn.sh
Last active May 31, 2026 07:25
Claude Code hook that warns the user about /security-review being affected by model anchoring bias
#!/usr/bin/env bash
# Warns when /security-review is run in a long-running session (model anchoring bias risk).
# the solution counts the number of conversation turns in the LLM session transcript and
# blocks the `security-review` invocation if the count exceeds 8, using that as a heuristic
# signal that this is a long-running session rather than a fresh review
input=$(cat)
echo "$input" | jq -r '.prompt // ""' | grep -qi "security-review" || exit 0
transcript=$(echo "$input" | jq -r '.transcript_path // ""')
turns=$(jq -s '[.[] | select(.type == "user" and .userType == "external")] | length' "$transcript" 2>/dev/null || echo 0)
@obormot
obormot / gist:8c3709e83ba69b577f7dbc8549912ef7
Created June 3, 2026 19:18 — forked from janreiche/gist:b20a5345e69c8af67f247391403d17a7
AWS list ec2 instance types from free-tier
# get all aws regions
AWS_REGIONS="$(aws ec2 describe-regions --query 'Regions[].RegionName' --output text)"
# for each region
for REGION in ${AWS_REGIONS}; \
do \
echo ${REGION};
aws ec2 describe-instance-types --filters Name=free-tier-eligible,Values=true --region ${REGION}| grep "InstanceType\"";
done
@obormot
obormot / .bash_profile
Created June 4, 2026 20:43
Pretty print python dict or JSON from stdin, with optional value masking
# pipe to jq for colored output
pyjq(){ "${HOME}/pyjq" "$@" | jq . ;}