Skip to content

Instantly share code, notes, and snippets.

View kkirsche's full-sized avatar

Kevin Kirsche kkirsche

View GitHub Profile
@kkirsche
kkirsche / magic.py
Last active May 20, 2020 13:43
Padding Oracle
# -*- coding: utf-8 -*-
from paddingoracle import BadPaddingException, PaddingOracle
from base64 import b64encode, b64decode
from urllib import quote, unquote
import requests
import socket
import time
class PadBuster(PaddingOracle):
@kkirsche
kkirsche / add CA cert on CentOS.md
Created August 2, 2017 20:00 — forked from kekru/add CA cert on CentOS Debian Ubuntu.md
Add CA cert to local trust store on CentOS or Debian
  • Open a webpage that uses the CA with Firefox
  • Click the lock-icon in the addressbar -> show information -> show certificate
  • the certificate viewer will open
  • click details and choose the certificate of the certificate-chain, you want to import to CentOS
  • click "Export..." and save it as .crt file
  • Copy the .crt file to /etc/pki/ca-trust/source/anchors on your CentOS machine
  • run update-ca-trust extract
  • test it with wget https://thewebsite.org
@kkirsche
kkirsche / longest_file_in_dir.sh
Created June 26, 2017 17:30
Longest File in directory
#!/bin/bash
for file in $(find .)
do
if [ -f $file ]; then
wc -l $file
fi
done | sort -n
@kkirsche
kkirsche / python-convert-dictionary-to-object
Created June 20, 2017 21:59 — forked from rorheden/python-convert-dictionary-to-object
Convert a dictionary to an object (recursive).
class DictionaryUtility:
"""
Utility methods for dealing with dictionaries.
"""
@staticmethod
def to_object(item):
"""
Convert a dictionary to an object (recursive).
"""
def convert(item):
@kkirsche
kkirsche / Dockerfile
Last active March 15, 2017 17:03
recon-ng docker
FROM python:2.7
MAINTAINER Kevin Kirsche
RUN apt-get update && apt-get -y dist-upgrade && apt-get -y install git
RUN git clone https://LaNMaSteR53@bitbucket.org/LaNMaSteR53/recon-ng.git && cd recon-ng && pip install -U pip && pip install -r REQUIREMENTS
ENTRYPOINT ["/bin/bash"]
@kkirsche
kkirsche / prompts.sh
Created February 28, 2017 22:20
Shell Prompt Coloring
Red Prompt — Production
STARTCOLOR="\e[0;31m"
ENDCOLOR="\e[0;0m"
PS1="\[$STARTCOLOR\][\u@\h \W]\\$ \[$ENDCOLOR\]"
Yellow Prompt — Staging
STARTCOLOR="\e[0;33m"
ENDCOLOR="\e[0;0m"
PS1="\[$STARTCOLOR\][\u@\h \W]\\$ \[$ENDCOLOR\]"
@kkirsche
kkirsche / ansible.cfg
Created December 16, 2016 17:54
General Ansible Configuration File
[defaults]
inventory: ./inventories/production/hosts.yml
remote_user: kkirsche
remote_port: 22
forks: 20
pipelining: True
callback_whitelist: json
retry_files_enabled: False
@kkirsche
kkirsche / extract_osx_plists.sh
Created December 15, 2016 19:56
OS X Password Hash Extraction
#!/bin/bash
pat="^[0-9a-zA-Z ]{1,}\.plist"
xml_pat="^<\?xml.*"
if [[ $EUID -ne 0 ]]; then
echo "[-] Not running as root, you probably won't see any results."
fi
for f in /var/db/dslocal/nodes/Default/users/*
# or use https://docs.python.org/3/library/itertools.html#itertools.permutations
def permutations(string, step = 0):
# if we've gotten to the end, print the permutation
if step == len(string):
print "".join(string)
# everything to the right of step has not been swapped yet
for i in range(step, len(string)):
# copy the string (store as array)
@kkirsche
kkirsche / recursive_grep.sh
Created October 4, 2016 14:30
Grep for pattern in file(s)
#
sudo grep -rni --exclude-dir={proc,boot,sys} "searchingfor" /