Skip to content

Instantly share code, notes, and snippets.

View eiginn's full-sized avatar

Ryan Carter eiginn

View GitHub Profile
@eiginn
eiginn / routeros.vim
Created October 17, 2012 07:24
RouterOS vim syntax file -WORK IN PROGRESS-
" Vim syntax file
" Language: RouterOS configuration files
" Maintainer: Ryan Carter
" Latest Revision: 16OCT2012
" GistID: 3904202
if exists("b:current_syntax")
finish
endif
@eiginn
eiginn / prowl.cpp
Created November 8, 2012 15:42 — forked from garrettreid/prowl.cpp
Updated Prowl module for ZNC
/*
* Copyright (C) 2009 flakes @ EFNet
* New match logic by Gm4n @ freenode
* Version 1.0 (2012-08-19)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
@eiginn
eiginn / ssh-agent-import.sh
Created December 19, 2012 19:12
ssh-agent-import.sh
unset SSH_AGENT_PID SSH_ENV_REFRESH
[ -r ~/.ssh/env ] && . ~/.ssh/env
[ -n "$SSH_AGENT_PID" ] || {
killall ssh-agent
# No env file (or it's badly corrupted:
eval $(ssh-agent 2>/dev/null) &> /dev/null
printenv | grep "^SSH_A"
SSH_ENV_REFRESH=1
}
#!/bin/bash
#GistID: 5696462
list+=("begin")
list+=("verbose")
# check that script is in a pipeline
if [ -t 0 ] && [ -t 1 ]; then
for i in $(echo $* | grep -Eo -e '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' -e '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))' | sort -V | uniq); do
list+=($i)
done
#! /usr/env/ruby
require "benchmark"
require 'digest/md5'
# The password hash to crack
password_hash = "e1f3ecc31656795a128db19da490c9ec"
# Helper for hashing passwords
def md5(password)
Digest::MD5.hexdigest(password)
@eiginn
eiginn / brutedns.rb
Created February 28, 2014 16:58 — forked from mubix/brutedns.rb
#!/usr/bin/env ruby
#
## Brute code stolen form: https://gist.github.com/petehamilton/4755855
#
@domain = 'contoso.com'
def result?(sub)
results = %x(dig +noall #{sub}.#{@domain} +answer)
@eiginn
eiginn / brutelist.rb
Created February 28, 2014 16:58 — forked from mubix/brutelist.rb
#!/usr/bin/env ruby
#
## Brute code stolen form: https://gist.github.com/petehamilton/4755855
#
def result?(sub)
puts sub
1 == 2
#!/bin/bash
#GistID: 9498189
# wrapper to take a file with the output of "ipset save" and restore with conflicting set names
# begrudgingly uses mktemp
# ignore: ^(realm_|ipjail_|cali(4|6)-)
# "realm_" from gatesetter
# "ip(6?)jail_" from ipjaild (cflare.co/spec-ipjail)
# "cali(4|6)-" from calico (k8s)
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
#!/bin/bash
#GistID: 11102164
# modified from http://lzone.de/Nagios%20Check%20Plugin%20for%20nofile%20Limit
# Check "nofile" limit for all running processes using lsof
MIN_COUNT=512 # default "nofile" limit is usually 1024, so no checking for
# processes with much less open fds needed
WARN_THRESHOLD=80 # default warning: 80% of file limit used