Skip to content

Instantly share code, notes, and snippets.

@Und3rf10w
Und3rf10w / auto_update_git_repos.sh
Created October 29, 2015 16:55
Automatically updates all git repos within a directory. Great for manaing a large collection of tools installed in something like /opt
for repo in $(ls -l |grep dr |awk {'print $9'}); do
cd $repo;
if [ -d ".git" ]; then
echo "Attempting to update $repo"| logger
git pull;
if [ $? -ne 0 ]; then
echo "Error attempting to update $repo" 1> >(logger -s 2>> /opt/repoupdate.err)
fi;
fi;
cd ..;
# Pushover setup,
# Run with 'pushover $MSG'
# Example: $ pushover "this is a test notification"
# Can be piped to as well
# Example: $ echo "this is also a test" | pushover
#!/bin/bash
if [[ $# -gt 0 ]]; then
a=$@
else
@Und3rf10w
Und3rf10w / purge_quassel_db-sqlite.sh
Created April 19, 2016 14:37
Weekly purge of Quassel chat database for sqlite instances
#!/bin/sh
# Taken from http://blog.encomiabile.it/2011/02/03/prune-quassel-database/
BAK_PATH="${HOME}/.config/quassel-irc.org/quassel-storage.sqlite.bak"
CURRENT_PATH="${HOME}/.config/quassel-irc.org/quassel-storage.sqlite"
# first day of data that will be maintained
# -7 day means that *every* chatline stored before 8 days ago and so on are going to be eliminated.
# only the last 7 days are keeped.
DATE_TO_PRUNE='-7 day'
#!/usr/bin/env python2
# Example usage: office_365_mail_relay.py --from-addr sender@example.com --to-addr recipient@example.com --domain example.com --subject "SPAM TIME!" --from-name "John Doe" --to-name "John Smith"
# 20170709 - @Und3rf10w
import dns.resolver
import socket
import smtplib
import argparse
from termcolor import cprint
@Und3rf10w
Und3rf10w / Injectable.cpp
Created December 19, 2017 14:19 — forked from anonymous/Injectable.cpp
Simple UserMode Hook Example
#include <windows.h>
#include <stdio.h>
FARPROC fpCreateProcessW;
BYTE bSavedByte;
// Blog Post Here:
// https://0x00sec.org/t/user-mode-rootkits-iat-and-inline-hooking/1108
// tasklist | findstr explore.exe
function Get-Doppelgangers
{
<#
.SYNOPSIS
Detects use of NTFS transactions for stealth/evasion, aka 'Process Doppelganging'
Author: Joe Desimone (@dez_)
License: BSD 3-Clause
@Und3rf10w
Und3rf10w / nyancair_gif_test.py
Last active January 31, 2018 04:12
Experiment at applying LSB stego to gifs
from PIL import Image
from cStringIO import StringIO
import requests
import imageio
import base64
import re
def GetGifPixel(gif):
frame = Image.open(gif)
nframes = 0
@Und3rf10w
Und3rf10w / generate_nyancair_png.py
Last active February 5, 2018 03:49
Generates and tests a nyancat png with an embedded eicar string
from PIL import Image
from cStringIO import StringIO
import requests
import imageio
import base64
import zlib
import PIL
import re
def encode(data, imageio):
sudo mount -t tmpfs -o size=1024m tmpfs ~/ramdisk/
@Und3rf10w
Und3rf10w / objdumpfunc.sh
Created August 23, 2018 15:29
Function to pipe into from objdump that will dump just a given function name
objdumpfunc() {
funcname="$1"
sed "/<$funcname>:/,/^\$/!d"
}
# objdump -M intel -M hex -j .text -D a.out | objdumpfunc main