Skip to content

Instantly share code, notes, and snippets.

View shadowbq's full-sized avatar
👔
Doing Things

shadowbq shadowbq

👔
Doing Things
View GitHub Profile
@shadowbq
shadowbq / gem_hunt.sh
Created May 23, 2015 15:54
find shebangs that are explict .. and likely wrong.
#!/usr/bin/env bash
#
# Find FreeBSD gems that are hardcoded to a ruby minor version
# example: /usr/local/bin/ruby20
find /usr/local/bin/ -type f | xargs file | grep Ruby | awk 'BEGIN { FS = ":" }; { print $1 }' |xargs head -1
@shadowbq
shadowbq / barnyard_waldo.rb
Created May 14, 2015 20:23
Print the struct data from the barnyard waldo file
#!/usr/bin/env ruby
#
# $> ./barnyard_waldo.rb
# Barnyard spool: /var/log/snort/merged.log.1431634445
# 2015-05-14 20:14:05 +0000
# Notes:
# Ruby String #unpack
# V | Integer | 32-bit unsigned, VAX (little-endian) byte order
@shadowbq
shadowbq / CheckExif.sh
Last active August 29, 2015 14:14
Zenity (Gnome) Shell popup to show Exif data or Hash files
#!/bin/bash
AppVer="1.0.1-shadowbq"
if [ "$1" = "" ]; then
SelectedFile=`zenity --title="Choose a file to check" --file-selection`
fi
if [ "$SelectedFile" = "" ]; then
if [ $# -gt 1 ]; then
@shadowbq
shadowbq / .gitignore
Last active August 29, 2015 14:14 — forked from cehoffman/.gitignore
SSHGuard => sshguard-dump sshguard-reprieve
build/
Makefile
sshguard-prefix/
CMakeFiles
CMakeCache.txt
cmake_install.cmake
@shadowbq
shadowbq / test-deps-barnyard2-mysql-freebsd-9.3.rb
Created January 26, 2015 16:42
Dependency test for Barnyard2 compiled on FreeBSD 9.3 with MySQL
#!/usr/bin/env ruby
## Barnyard2 compiled on FreeBSD 9.3 with MySQL
filelist = %w{ /usr/local/lib/mysql/libmysqlclient.so.18 /lib/libz.so.6 /lib/libpcap.so.8 /lib/libm.so.5 /lib/libc.so.7 /usr/lib/libstdc++.so.6 /lib/libgcc_s.so.1 /lib/libthr.so.3}
require 'fileutils'
filelist.each do |libso|
puts "Missing: #{libso}" unless File.file?(libso)
end
puts "done."
@shadowbq
shadowbq / cdn-reverse-check.rb
Last active January 2, 2021 06:08
Check if reverse dns lookup matches a known CDN. (used for unblocking in blacklists)
#/usr/bin/env ruby
# github/shadowbq - 2014
# GNU GENERAL PUBLIC LICENSE Version 2, June 1991
# Things to match..
# CDN List provided by - (23 Dec 2014) https://github.com/WPO-Foundation/webpagetest/blob/master/agent/wpthook/cdn.h
require 'rubygems'
require 'net/dns'
@shadowbq
shadowbq / apparmor_usr.sbin.named
Last active February 13, 2019 03:31
Logrotate.d script for bind9 named server in ubuntu
# vim:syntax=apparmor
# Last Modified: Fri Jun 1 16:43:22 2007
#include <tunables/global>
/usr/sbin/named {
#include <abstractions/base>
#include <abstractions/nameservice>
capability net_bind_service,
capability setgid,
@shadowbq
shadowbq / PeID.yara
Created October 23, 2014 04:13
PeID.yara
rule MSLRHv032afakePCGuard4xxemadicius
{
strings:
$a0 = { FC 55 50 E8 00 00 00 00 5D EB 01 E3 60 E8 03 00 00 00 D2 EB 0B 58 EB 01 48 40 EB 01 35 FF E0 E7 61 58 5D EB 05 E8 EB 04 40 00 EB FA E8 0A 00 00 00 E8 EB 0C 00 00 E8 F6 FF FF FF E8 F2 FF FF FF 83 C4 08 74 04 75 02 EB 02 EB 01 81 50 E8 02 00 00 00 29 5A 58 6B C0 03 E8 02 00 00 00 29 5A 83 C4 04 58 74 04 75 02 EB 02 EB 01 81 0F 31 50 0F 31 E8 0A 00 00 00 E8 EB 0C 00 00 E8 F6 FF FF FF E8 F2 FF FF FF }
condition:
$a0 at entrypoint
}
@shadowbq
shadowbq / mysql-proxy.conf
Created October 1, 2014 04:00
ubuntu 14.04 upstart mysql-proxy service configuration
# mysql-proxy.conf (Ubuntu 14.04.1) Upstart proxy configuration file for AWS RDS
# mysql-proxy - mysql-proxy job file
description "mysql-proxy upstart script"
author "shadowbq <[email protected]>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn
@shadowbq
shadowbq / Guard Celluloid - Gem list
Last active August 29, 2015 14:07
Celluloid rb-kqueue on freebsd test
*** LOCAL GEMS ***
benchmark-ips (1.2.0)
benchmark_suite (1.0.0)
bundler (1.3.5, 1.3.1)
celluloid (0.15.2, 0.15.0)
coderay (1.1.0)
coveralls (0.7.0)
diff-lcs (1.2.5)
docile (1.1.1)