Skip to content

Instantly share code, notes, and snippets.

@kjlubick
kjlubick / track.js
Created April 1, 2015 17:33
Track Reddit's "the button" http://www.reddit.com/r/thebutton
var saveAs=saveAs||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r="download"in o,i=function(n){var o=t.createEvent("MouseEvents");o.initMouseEvent("click",!0,!1,e,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(o)},a=e.webkitRequestFileSystem,c=e.requestFileSystem||a||e.mozRequestFileSystem,s=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},u="application/octet-stream",f=0,d=500,l=function(t){var o=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?o():setTimeout(o,d)},v=function(e,t,n){t=[].concat(t);for(var o=t.length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(i){s(i)}}},p=function(t,s){var d,p,w,y=this,m=t.type,S=!1,h=function(){v(y,"writestart progress write writeen
// The Grid component allows an element to be located
// on a grid of tiles
Crafty.c('Grid', {
init: function() {
this.attr({
w: Game.map_grid.tile.width,
h: Game.map_grid.tile.height
});
},
@kjlubick
kjlubick / ArrayListString.java
Created April 9, 2015 23:43
String ArrayList. Targeted at AP Computer Science Students. Used with https://www.youtube.com/watch?v=JcTA3grnERo
public class ArrayListString{
private String[] arr;
private int capacity;
private int size;
public ArrayListString() {
arr = new String[10];
capacity = 10;
size = 0;
@kjlubick
kjlubick / HTTPServer.java
Last active September 3, 2015 20:25
Example Jetty Exploit
import org.eclipse.jetty.server.Server;
public static HTTPServer startUpAnHTTPServer(WebQueryInterface wqi, UserManager um)
{
HTTPServer httpServer = new HTTPServer();
if (HTTPServer.getUserManager() == null)
{
userManager = um;
}
//Exploitable, this port can be accessed by anyone on the local network
@kjlubick
kjlubick / afl-fuzz-whitepaper.md
Last active October 28, 2015 14:27
Technical "whitepaper" for afl-fuzz. Copied from http://lcamtuf.coredump.cx/afl/technical_details.txt, (which is released under the Apache 2.0 License) and slightly modified for GitHub Flavored Markdown

=================================== Technical "whitepaper" for afl-fuzz

This document provides a quick overview of the guts of American Fuzzy Lop. See README for the general instruction manual; and for a discussion of motivations and design goals behind AFL, see historical_notes.txt.

  1. Design statement

@kjlubick
kjlubick / afl-fuzz-readme.md
Last active October 28, 2015 16:41
Readme for afl-fuzz

================== american fuzzy lop

Written and maintained by Michal Zalewski lcamtuf@google.com

Copyright 2013, 2014, 2015 Google Inc. All rights reserved. Released under terms and conditions of Apache License, Version 2.0.

For new versions and additional information, check out:

@kjlubick
kjlubick / Imageuploader.java
Created July 2, 2014 19:46
Uploading images using Apache HTTPComponents (HTTPClient, MultipartEntityBuilder)
//The following is in snippet form.
//It shows 2 ways to upload files, the first is the cannonical way, if you have the image on disk
//the second is a way to upload it without having to write a modified image to disk (in this instance, a cropped image)
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
@kjlubick
kjlubick / d3-svg-example-animation.md
Last active May 18, 2016 13:32
This is an example for Google I/O of the D3 visualization, with animation.
@kjlubick
kjlubick / spanish_letters.ahk
Created May 28, 2016 19:23
Autohotkey script to easily add spanish letters to keyboards w/o numpads
#Hotstring EndChars `n `t
# Type ' then letter for lower case " then letter for uppercase
# The accented letter will appear after you hit tab, return or space.
::'a::
Send, {U+00E1}
Return
::"A::
Send, {U+00C1}
@kjlubick
kjlubick / afl-fuzz-help.txt
Created October 28, 2015 16:28
Help text for afl-fuzz
./afl-fuzz [ options ] -- /path/to/fuzzed_app [ ... ]
Required parameters:
-i dir - input directory with test cases
-o dir - output directory for fuzzer findings
Execution control settings:
-f file - location read by the fuzzed program (stdin)