Skip to content

Instantly share code, notes, and snippets.

@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
@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
# 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
# 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
@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
# 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 / timeout.c
Last active November 11, 2015 23:03
/*
* timeout - application to check a list of users against the current time
* and return a message on whether each user is authorized to login to the
* system during this time on a FreeBSD system.
*
* These time frames are configured in the /etc/login.conf or the user's
* ~/login.conf files for their class of user. The login application will
* check these allowed or denied time lists and prevent the user from logging
* in during unauthorized times however users whom are already logged in will
* be able to remain logged in regardless of the time.
#!/bin/sh
#
# authpf-rules: this needs a better name (authpfconf?)
#
# Generate per user rules for authpf based on the groups a user is a member of.
# If the user is a member of the engineering & support groups then they should
# get access to the hosts in the associated pf tables upon authenticating.
#
# Example:
#
require 'httparty'
require 'minitest/autorun'
require 'minitest/mock'
require 'httparty'
class GoogleClient
BASE_URI = "http://google.com"
require 'httparty'
require 'minitest/autorun'
require 'minitest/mock'
require 'httparty'
class GoogleClient
BASE_URI = "http://google.com"