Skip to content

Instantly share code, notes, and snippets.

@chrisdlangton
chrisdlangton / waybacksploit.sh
Last active January 16, 2026 12:19
The real dark web - find and exploit forgotten files on servers
#!/usr/bin/env bash
if [ -z $(which retire) ]; then
echo "retire not found. try npm install -g retire"
exit 1
fi
if [ -z $(which parallel) ]; then
echo "parallel not found. try 'apt install -y parallel'"
exit 1
fi
@chrisdlangton
chrisdlangton / dump_cert.sh
Created January 18, 2019 03:19
Script to dump the entire cert.sh database as CSV
#!/usr/bin/env bash
SCHEMA=public
DB=certwatch
HOST=crt.sh
PORT=5432
USER='guest --no-password'
DIR=$(pwd)
mkdir -p $DIR
@chrisdlangton
chrisdlangton / syscall2seccomp.py
Last active May 30, 2025 14:41
Automatically generate seccomp profile json by learning from container activity using sysdig
#!/usr/bin/env python3
import fileinput
import json
import argparse
SECCOMP_PROFILE = ('{"defaultAction": "SCMP_ACT_ERRNO",'
'"architectures": ['
'"SCMP_ARCH_X86_64",'
'"SCMP_ARCH_X86",'
@chrisdlangton
chrisdlangton / update-route53.sh
Last active May 7, 2024 14:00
Keep AWS Route53 ipv4 A and ipv6 AAAA records updated
#!/usr/bin/env bash
readonly LOG_FILE=${HOME}/route53.log
touch $LOG_FILE
exec 1>>$LOG_FILE
exec 2>&1
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
@chrisdlangton
chrisdlangton / hmac_decorator.py
Last active May 2, 2024 03:03
Time-based HMAC signature SHA256, SHA512, SHA3-256, SHA3-384, SHA3-512, and BLAKE2 for Python Flask with Javascript Forge.js and Bash/OpenSSL/Curl clients
import hashlib
import hmac
from base64 import b64encode
from functools import wraps
from datetime import datetime, timedelta
from flask import request, abort
from flask_login import login_user
from models import User, ApiKey
def require_hmac(not_before_seconds: int = 3, expire_after_seconds: int = 3):
@chrisdlangton
chrisdlangton / user-data.sh
Last active December 13, 2023 09:13
run ubuntu with kali on ec2
#!/bin/bash -ex
sudo su -
apt-get update
apt-get install -y build-essential git jq curl wget gnupg
wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add -
sh -c "echo 'deb https://http.kali.org/kali kali-rolling main non-free contrib' > /etc/apt/sources.list.d/kali.list"
sh -c "echo 'Package: *' > /etc/apt/preferences.d/kali.pref
echo 'Pin: release a=kali-rolling' >> /etc/apt/preferences.d/kali.pref
echo 'Pin-Priority: 50' >> /etc/apt/preferences.d/kali.pref"
wget http://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2022.1_all.deb
@chrisdlangton
chrisdlangton / xor.py
Created November 16, 2023 00:02
Use NLP to filter results of bruteforce key length for XOR encoded words, alphanumeric, or phrase
import string, itertools, time, re
from nltk.corpus import words
from nltk.tokenize import word_tokenize
import nltk
flag = "The message is too secret"
secret_key = 'CTFKey'
def is_mostly_english(text, threshold: float = 0.5):
@chrisdlangton
chrisdlangton / hawkauth_mitm_poc.js
Last active July 24, 2023 01:30
PoC for GHSA-mrcf-5cch-47mc mozilla/hawk
/**
* Gist: https://gist.github.com/chrisdlangton/cd32ad083294c56c509828a7b9f7e90e
* Advisory: https://github.com/chrisdlangton/hawk/security/advisories/GHSA-mrcf-5cch-47mc
*/
const hawk = require('hawk')
const credentials = {
id: 'dh37fgj492je',
key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
algorithm: 'sha256'
@chrisdlangton
chrisdlangton / coverletter.txt
Created February 2, 2023 08:39
ChatGPT Cloud Engineer job application cover letter
Cloud Engineer Cover Letter
Chris
Write a cover letter for a cloud engineer job at a product focussed company
Dear Hiring Manager,
I am writing to apply for the Cloud Engineer position at [Company Name], and I am confident that my extensive experience and skills make me an ideal candidate for this role. I have a passion for developing and deploying innovative cloud solutions that drive business success, and I am excited about the opportunity to bring my expertise to your team.
@chrisdlangton
chrisdlangton / hosting_providers.py
Created October 26, 2020 13:43
List of web hosting providers - expected these services have customers that use CNAME records for custom/vanity domains
"""
The following python list of tuples is in the form of;
(<url_segment>, <provider_name>)
url_segment: str = a substring match, can be of prefix suffic or any substring
provider_name: str = human friendly name of the provier
"""
hosting_providers = [
('.clients.turbobytes.net', 'TurboBytes',),
('.turbobytes-cdn.com', 'TurboBytes',),
('.afxcdn.net', 'afxcdn.net',),