Skip to content

Instantly share code, notes, and snippets.


Kevin Kirsche kkirsche

View GitHub Profile
kkirsche / Install Composer to use MAMP's
Last active March 3, 2023 12:08
How to install Composer globally using MAMP's PHP
View Install Composer to use MAMP's

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

kkirsche / aes256-gcm.go
Last active February 19, 2023 10:52
AES-256 GCM Encryption Example in Golang
View aes256-gcm.go
package example_test
import (
// AES-GCM should be used because the operation is an authenticated encryption
kkirsche /
Created August 22, 2016 23:42
Nmap XML to Elasticsearch
import os
import glob
from datetime import datetime
from elasticsearch import Elasticsearch
from libnmap.parser import NmapParser
dir_path = os.path.dirname(os.path.realpath(__file__))
es = Elasticsearch()
kkirsche / asdf-update-all
Last active December 16, 2022 15:53
ASDF Auto Updater
View asdf-update-all
#!/usr/bin/env python
from shlex import split
from subprocess import CompletedProcess, run # noqa
from typing import cast
from packaging.version import InvalidVersion, parse
from requests import get
kkirsche / inetAton-inet6Aton.go
Last active October 25, 2022 15:18
inet_aton and inet6_aton in Golang
View inetAton-inet6Aton.go
package nessusProcessor
import (
// Inet_Aton converts an IPv4 net.IP object to a 64 bit integer.
func Inet_Aton(ip net.IP) int64 {

How to pass the OSCP

  1. Recon
  2. Find vuln
  3. Exploit
  4. Escalate
  5. Document it

Time yourself

kkirsche /
Last active September 14, 2022 19:28
TOML Path — A simple utility class to retrieve a specific key path in a TOML file
from os import PathLike
from functools import reduce
from operator import getitem
# Python 3.11+
from tomllib import load, loads
except ImportError:
from tomli import load, loads
from typing import Any, BinaryIO, Iterable, Mapping, TypeAlias, TypeGuard, Union
kkirsche / write-blob.go
Last active August 24, 2022 13:24
Writing Git Blob Objects
View write-blob.go
package main
import (
kkirsche /
Last active August 12, 2022 12:38
rsync algorithm in Python
#!/usr/bin/env python
# based on
from import Generator
from hashlib import md5
from io import BufferedReader, TextIOWrapper
from logging import DEBUG, INFO, basicConfig, getLogger
from os import PathLike
kkirsche /
Last active June 16, 2022 12:34
Backdoor a PE file
#!/usr/bin/env python2
import mmap
import os
import pefile
def align(val_to_align, alignment):
return ((val_to_align + alignment - 1) / alignment) * alignment