Skip to content

Instantly share code, notes, and snippets.

View zacscott's full-sized avatar

Zac Scott zacscott

View GitHub Profile
@zacscott
zacscott / secman.php
Last active August 29, 2015 14:04
Checks HTTP requests for common attacks/exploits (XSS, XSRF and SQL injection).
<?php
/**
Plugin Name: Secman
Plugin URI: https://gist.github.com/zscott92/0b052fc6f5fd42d33a02
Description: Checks HTTP requests for common attacks/exploits (XSS, XSRF and SQL injection). Just activate and forget - no configuration!
Version: 1.0
License: MIT License
Author: Zachary Scott
Author URI: http://www.zacscott.net
*/
License Key PhpStorm 8
User Name : EMBRACE
===== LICENSE BEGIN =====
43136-12042010
00002UsvSON704l"dILe1PVx3y4"B3
49AU6oSDJrsjE8nMOQh"8HTDJHIUUh
gd1BebYc5U"6OxDbVsALB4Eb10PW8"
===== LICENSE END =====
@zacscott
zacscott / s3_signed_url.php
Last active August 29, 2015 14:21
AWS S3 Signed URL
<?php
/** @file s3_signed_url.php - provides the s3_signed_url() function to produce time-limited URL's using AWS S3.
* Based off; http://dev.wattswork.com/make-signed-urls-for-amazon-s3-with-php/
*/
if ( !function_exists('s3_signed_url' ) ) {
/**
* Create signed URLs to your protected Amazon S3 files.
*
@zacscott
zacscott / GeoIP.php
Last active August 29, 2015 14:22
GeoIP.php
<?php
/** GeoIP.php - GeoIP API lookup interface
* Uses the Free GeoIP API to perform lookup - http://freegeoip.net
*/
// dont double include
if ( class_exists( 'GeoIP' ) ) {
return;
}
@zacscott
zacscott / WpVulnDb.php
Created June 9, 2015 20:43
WpVulnDb.php
<?php
/** @file WpVulnDb.php - WordPress utility class for the WPScan API
* Uses the WPVulnDB - https://wpvulndb.com/api
*/
/**
* WPScan vulnerability database/API interface.
*
* @author Zachary Scott <zscott.dev@gmail.com>
*/
@zacscott
zacscott / HashUtil.java
Last active December 16, 2015 16:49
A utility to assist in creating hashCode() implementations (in Java).
package net.zeddev.util;
import java.lang.reflect.Field;
/**
* <p>
* A utility to assist in creating <code>hashCode()</code> implementations.
* Can simply be used like so;
* </p>
*
@zacscott
zacscott / FastCache.java
Last active December 16, 2015 18:09
A small, compact in-memory cache designed for high data throughput.
package net.zeddev.util;
import java.lang.ref.SoftReference;
import java.lang.reflect.Array;
/**
* <p>
* A small, compact in-memory cache designed for high data throughput.
* The cache can be simply integrated with existing source using the following
* pattern;
@zacscott
zacscott / SimpleDialog.java
Last active December 17, 2015 03:38
Provides some common swing dialogs in Java.
package net.zeddev.util;
import java.awt.Frame;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import java.util.logging.Logger;
/**
* <p>
@zacscott
zacscott / NamedLog.java
Last active December 18, 2015 00:29
A wrapper for the android log, providing a more robust, useful interface.
package net.zeddev.android.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;
import android.util.Log;
@zacscott
zacscott / Assertions.java
Last active December 18, 2015 14:19
A simple facility to support design-by-contract principles (in Java).
package net.zeddev.util;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* A simple facility to support design-by-contract principles.
* Significantly smaller and simpler than other more heavy-weight frameworks
* (such as contract2j, OVal, etc) but provides better functionality over the