Skip to content

Instantly share code, notes, and snippets.

# Rack HoneyToken Middleware
#
# Honey Tokens are unique and unlikely values that should be planted in various
# places within your web application to assist in the detection of a security
# breach. They are useful at trying to detect SQL injection attacks where the
# intended logic of an SQL query is bypassed and the HTTP request is used to
# attempt to download private data instead for example the users or accounts
# table and associated password hashes.
#
# Below is an example of creating three fake users with their password hashes
@mclosson
mclosson / baseline-freebsd.sh
Last active November 4, 2015 15:35
Create known good baseline of FreeBSD server basics
#!/bin/sh
# Script to generate a baseline of known good values for a FreeBSD 10.x server
# The outputs should be able to be diff'd later to verify that no changes have occured
BASELINE=baseline
SUDO=/usr/local/bin/sudo
/bin/rm -rf $BASELINE
/bin/mkdir $BASELINE
/bin/hostname > $BASELINE/hostname
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# devel/libCello
# devel/libCello/distinfo
# devel/libCello/Makefile
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# libCello
# libCello/distinfo
# libCello/Makefile
@mclosson
mclosson / Problem Description
Last active August 29, 2015 14:16
Attempting to make stage on a new port
Above I'm working on a new port for libCello but getting stuck on a few issues I'm not sure how to approach:
Here's the port so far:
https://github.com/mclosson/libcello-freebsd-port/tree/master/ports/devel/libCello
https://github.com/mclosson/libcello-freebsd-port/blob/master/ports/devel/libCello/Makefile
https://github.com/mclosson/libcello-freebsd-port/blob/master/ports/devel/libCello/distinfo
https://github.com/mclosson/libcello-freebsd-port/blob/master/ports/devel/libCello/pkg-descr
https://github.com/mclosson/libcello-freebsd-port/blob/master/ports/devel/libCello/pkg-plist
@mclosson
mclosson / svn diff
Last active August 29, 2015 14:10
FreeBSD /usr/ports/net/tcpdump patch 4.5.1 -> 4.6.2
Index: net/tcpdump/Makefile
===================================================================
--- net/tcpdump/Makefile (revision 373799)
+++ net/tcpdump/Makefile (working copy)
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= tcpdump
-PORTVERSION= 4.5.1
+PORTVERSION= 4.6.2
# https://blog.spideroak.com/20140814060007-status-reports-transparency-overall-safety
# https://spideroak.com/canary
# https://en.wikipedia.org/wiki/Warrant_canary
# https://www.eff.org/deeplinks/2014/04/warrant-canary-faq
# https://en.wikipedia.org/wiki/National_security_letter
#
# SpiderOak now maintains a warrant canary so they can passively let their users know
# if they have been served a National Security Letter or other legal tool which
# prevents them from actively disclosing to their users that they are being coerced
# or forced into compromising the security or privacy of their userbase.
@mclosson
mclosson / keybase.md
Last active August 29, 2015 14:05
keybase.md

Keybase proof

I hereby claim:

  • I am mclosson on github.
  • I am mclosson (https://keybase.io/mclosson) on keybase.
  • I have a public key whose fingerprint is E3D7 09DA F9F6 F3B3 0E9E 1D32 9656 6C5B 0883 A308

To claim this, I am signing this object:

require 'minitest/autorun'
class Bitlib
# Add Implementation Here
end
class Encryptor
# Add Implementation Here
end
require 'minitest/autorun'
require 'set'
class FiniteSet < Set
def fetch(item)
if member?(item)
delete(item)
item
end
end