Skip to content

Instantly share code, notes, and snippets.

@chrisdlangton
chrisdlangton / install_testssl.sh
Last active November 17, 2019 14:03
Install testssl.sh
#!/usr/bin/env bash
# call as sudo or modify variables to suit your needs
GREEN='\033[0;32m'
NC='\033[0m' # No Color
CWD=$(pwd)
CUR_USER=$(whoami)
HOME_DIR=/home/${CUR_USER}
TESTSSL_INSTALL_DIR=${HOME_DIR}/testssl
@chrisdlangton
chrisdlangton / install_amass.sh
Last active November 17, 2019 13:56
Install amass
#!/usr/bin/env bash
# call as sudo or modify variables to suit your needs
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
NC='\033[0m' # No Color
CWD=$(pwd)
CUR_USER=$(whoami)
HOME_DIR=/home/${CUR_USER}
@chrisdlangton
chrisdlangton / payloads.txt
Created July 24, 2019 15:07
SQLi payloads
' or '1'='1
-'
' '
'&'
'^'
'*'
' or ''-'
' or '' '
' or ''&'
' or ''^'
@chrisdlangton
chrisdlangton / test_pfs.py
Last active December 2, 2019 22:56
Enforcing Perfect Forward Secrecy for AWS Query Request HTTP API
"""
Based on https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html
"""
from requests.packages.urllib3.util.ssl_ import create_urllib3_context
from requests.adapters import HTTPAdapter
import hmac
import hashlib
import datetime
import base64
import os
@chrisdlangton
chrisdlangton / decrypt.py
Created February 22, 2019 05:05
Decrypt using python
#!/usr/bin/env python
# -*- coding:utf-8
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
import requests
import base64
import sys
# Generate a keys from the key server, distribute the public key to encryptors
@chrisdlangton
chrisdlangton / cform_install.sh
Created January 29, 2019 01:59
Deploy and update AWS CloudFormation Stack to all regions
#!/usr/bin/env sh
template_url=https://.../template.yml
aws_regions=( us-east-1 us-east-2 us-west-1 us-west-2 ca-central-1 eu-west-1 eu-central-1 eu-west-2 ap-northeast-1 ap-northeast-2 ap-southeast-1 ap-southeast-2 ap-south-1 sa-east-1 )
stack_name=MyStack
stack_version=1
parameters="ParameterKey=MyTemplateParam,ParameterValue=MyTemplateParamVal"
if ! command -v aws >/dev/null 2>&1
then
@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 / czdap_icann_zonefiles_download.py
Created January 11, 2019 03:16
Download, decrypt, and decompress all zonefiles from czdap.icann.org
#!/usr/bin/env python
# -*- coding:utf-8
"""
requires Python 2.x
requirements.txt
pycrypto==2.6.1
requests==2.21.0
urllib3==1.24.1
@chrisdlangton
chrisdlangton / waybacksploit.sh
Last active July 8, 2022 21:18
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 / awsrole.py
Last active May 7, 2020 23:17
AWS Assume Role interactive utility - stores temporary session tokens and manages local credentials profile
#!/usr/bin/env python3
import boto3
import argparse
import configparser
from os.path import expanduser
from botocore.exceptions import ClientError
def chose_profile()->str:
session = boto3.Session()