Skip to content

Instantly share code, notes, and snippets.

@BuffaloWill
BuffaloWill / cloud_metadata.txt
Last active October 30, 2025 17:29
Cloud Metadata Dictionary useful for SSRF Testing
## IPv6 Tests
http://[::ffff:169.254.169.254]
http://[0:0:0:0:0:ffff:169.254.169.254]
## AWS
# Amazon Web Services (No Header Required)
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/meta-data/iam/security-credentials/dummy
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
@major
major / ca.py
Last active October 28, 2025 09:27
Making a certificate authority (CA) with python cryptography
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid import NameOID
import datetime
import uuid
one_day = datetime.timedelta(1, 0, 0)
private_key = rsa.generate_private_key(
public_exponent=65537,
@surjikal
surjikal / macos-openssh-portable.sh
Last active October 9, 2025 12:16
Compile OpenSSH Portable on OSX / MacOS
#!/usr/bin/env bash
brew install openssl
git clone git://anongit.mindrot.org/openssh.git
cd openssh
# The './configure' script does not exist, so we have to build it
autoreconf
@mmas
mmas / floyd_warshall.py
Created October 24, 2013 00:19
Floyd-Warshall algorithm implementation in Python
class FloydWarshall(object):
def __init__(self, file_):
nodes = file_.read().splitlines()
file_.close()
self.get_graph(nodes)
self.len_ = len(self.nodes)
self.create_fw_matrix()
def get_graph(self, nodes):
@aras-p
aras-p / preprocessor_fun.h
Last active October 9, 2025 17:55
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@pmuellr
pmuellr / unzip-recurse.py
Created November 19, 2010 15:41
tool to recursively unzip .zip and .jar files
#!/usr/bin/env python
import os
import sys
import subprocess
#-----------------------------------------------------------------------------
def main():
fileNames = sys.argv[1:]