Skip to content

Instantly share code, notes, and snippets.

View williamzujkowski's full-sized avatar
💭
Secure infrastructure and LEGO forts -- equally over-engineered.

William Zujkowski williamzujkowski

💭
Secure infrastructure and LEGO forts -- equally over-engineered.
View GitHub Profile
@williamzujkowski
williamzujkowski / doh-geo-selector.py
Created November 3, 2025 22:49
DoH Advanced Routing - nginx load balancing and geo-based provider selection
#!/usr/bin/env python3
# DoH Provider Selection Based on Geographic Location
def select_doh_provider(client_ip):
"""Select optimal DoH provider based on location"""
# Simplified geo-detection
if client_ip.startswith('192.168.'):
return "https://local-doh.home.arpa/dns-query"
elif is_asian_ip(client_ip):
return "https://dns.google/dns-query" # Better in Asia
@williamzujkowski
williamzujkowski / doh-troubleshooting.sh
Created November 3, 2025 22:49
DoH Troubleshooting - Fixes for caching, timeouts, and corporate network compatibility
#!/bin/bash
# DoH Troubleshooting - Common fixes
# 1. Slow Initial Queries
# Implement DNS caching
# For dnsmasq
echo "cache-size=10000" >> /etc/dnsmasq.conf
echo "min-cache-ttl=3600" >> /etc/dnsmasq.conf
# For systemd-resolved
@williamzujkowski
williamzujkowski / doh-cert-pinning.py
Created November 3, 2025 22:49
DoH Security Hardening - Firewall rules and certificate pinning for DNS-over-HTTPS
#!/usr/bin/env python3
# DoH Certificate Pinning for Self-Hosted Servers
import ssl
import hashlib
import base64
class SecureDoHClient:
# ... (additional implementation details)
@williamzujkowski
williamzujkowski / doh-monitoring-tools.py
Created November 3, 2025 22:49
DoH Monitoring Tools - Performance testing, DNS leak checks, and log analysis for DNS-over-HTTPS
#!/usr/bin/env python3
# DoH Performance Monitoring Tools
import time
import dns.resolver
import requests
from statistics import mean, stdev
# Test using curl
# curl -H 'content-type: application/dns-message' \
@williamzujkowski
williamzujkowski / doh-router-setup.sh
Created November 3, 2025 22:49
DoH Router Setup - Configurations for Linux (cloudflared), Dream Machine Pro (dnscrypt-proxy), and OpenWrt
#!/bin/bash
# DoH Router Setup - Multiple platform configurations
# Linux (cloudflared) setup
# Install cloudflared
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb
# Configure as DNS proxy
# ... (additional implementation details)
@williamzujkowski
williamzujkowski / iot-lab-setup.sh
Created November 3, 2025 22:49
IoT Security Lab Setup - Tools installation, IoTGoat Docker deployment, firmware analysis toolkit
#!/bin/bash
# IoT Security Lab Setup Script
# Combines tools installation, IoTGoat deployment, and firmware analysis toolkit
# Core analysis tools installation
echo "[*] Installing core IoT analysis tools..."
sudo apt-get update
sudo apt-get install -y \
wireshark \
nmap \
@williamzujkowski
williamzujkowski / iot-network-monitor.py
Created November 3, 2025 22:49
IoT Network Monitor - Real-time packet monitoring and anomaly detection using scapy
#!/usr/bin/env python3
"""
IoT Network Monitor
Real-time packet monitoring and anomaly detection for IoT devices using scapy
"""
from scapy.all import *
import json
from datetime import datetime
@williamzujkowski
williamzujkowski / iot-vulnerability-testing.py
Created November 3, 2025 22:49
IoT Vulnerability Testing Toolkit - Default credentials, MQTT discovery, command injection tests for OWASP IoTGoat
#!/usr/bin/env python3
"""
IoT Vulnerability Testing Toolkit
Combines default credential testing, MQTT discovery, and command injection tests
for OWASP IoTGoat security assessment
"""
import telnetlib
import time
import paho.mqtt.client as mqtt
@williamzujkowski
williamzujkowski / bitwarden-cli-setup.sh
Created November 3, 2025 22:36
Bitwarden CLI Client Setup and Usage - Install, configure, and use the command-line interface
#!/bin/bash
# Bitwarden CLI Client Setup and Usage
# Install Bitwarden CLI
npm install -g @bitwarden/cli
# Configure server
bw config server https://vault.example.com
# Login
@williamzujkowski
williamzujkowski / bitwarden-backup-restore-testing.sh
Created November 3, 2025 22:36
Bitwarden Backup Restoration Testing - Decrypt, restore, and verify database backups
#!/bin/bash
# Bitwarden Backup Restoration Testing Script
# Decrypt backup
gpg --decrypt bitwarden_20250901_030000.sql.gz.gpg > bitwarden_restore.sql.gz
gunzip bitwarden_restore.sql.gz
# Restore to test database
docker exec -i vaultwarden-db psql -U bitwarden bitwarden < bitwarden_restore.sql