Skip to content

Instantly share code, notes, and snippets.

View cpu's full-sized avatar
🛠️

Daniel McCarney cpu

🛠️
View GitHub Profile
@cpu
cpu / ShittyCrypto.java
Last active December 31, 2015 23:58
Example code using BSAFE & DUAL_EC_DRBG to generate n bytes of randomness from a terrifically suspect CSRNG, unlike https://gist.github.com/binaryparadox/8063008 this version allows you to supply your own backdoored curve points instead of using the NIST standard points for DUAL_EC_DRBG. You must have the BSAFE shareCrypto.jar library on your cl…
import java.math.BigInteger;
import java.security.Provider;
import java.security.SecureRandom;
import java.security.Security;
import com.rsa.crypto.ECPoint;
import com.rsa.jsafe.provider.ECDRBGInstantiationParameterSpec;
import com.rsa.jsafe.provider.ECPointVerifiable;
import com.rsa.jsafe.provider.SecureRandomEx;
import com.rsa.jsafe.provider.SensitiveData;
@cpu
cpu / ShittyCrypto.java
Last active December 31, 2015 23:49
Example code using BSAFE & DUAL_EC_DRBG to generate n bytes of randomness from a terrifically suspect CSRNG. You must have the BSAFE shareCrypto.jar library on your classpath. If you can't find a copy of that you should get in touch with me.
import java.math.BigInteger;
import java.security.Provider;
import java.security.SecureRandom;
import java.security.Security;
import com.rsa.jsafe.provider.SensitiveData;
//Largely cribbed from RSA BSAFE Docs.
public class ShittyCrypto {
@cpu
cpu / dnscrypt.configure.log
Created June 3, 2013 19:24
DNSCrypt configure/build output to be shared.
checking build system type... checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
@cpu
cpu / geoLookup.py
Last active December 10, 2015 04:48
Look up one or more IPs using the free Maxmind Geolookup API (http://www.maxmind.com/en/geoip_demo). Print the results in a plain format easily processed by script/human.
#!/usr/bin/env python
#
# geoLookup.py
# https://gist.github.com/4383810
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@cpu
cpu / gist:4002482
Created November 2, 2012 16:34
Left Screen Tmux Setup
#!/bin/sh
# Create a new session called 'left' and open a ssh connection
tmux new-session -d -s left 'ssh danm_mud@pdox'
# Run 'resume' inside the ssh connection
tmux send-keys -t left:1 resume C-m
# Splice the screen in half by 50%
tmux splitw -h -p 50 -t left:1 'bash'
@cpu
cpu / post-commit.sh
Created May 2, 2012 21:27
SVN Post-commit hook for Pushover messages.
#!/bin/bash
#
# SVN Post-commit hook for the Pushover API
# Filters commits to only push when specific authors commit.
# Sends commit messages to one or more device KEYS.
# List of keys to push to
KEYS=( DEVICE_KEY_ONE DEVICE_KEY_TWO DEVICE_KEY_THREE )
# Which commit authors should generate push messages?
@cpu
cpu / pushover.pl
Created May 2, 2012 20:24
Irssi script to send DM's via Pushover API
use strict;
use vars qw($VERSION %IRSSI);
use LWP::UserAgent;
use Irssi;
$VERSION = '0.0.1';
%IRSSI = (
authors => 'Daniel McCarney',
contact => 'daniel@binaryparadox.net',
@cpu
cpu / pushoverbooted.conf
Created May 2, 2012 14:21
Simple Upstart Script to send a PushOver notification when the machine boots.
#
# pushoverbooted service
#
# Sends a PushOver notification when the box has finished booting. To
# install, place this file in /etc/init/ You can test the service by
# running 'start pushoverbooted'
#
# You will need to replace TOKEN with the value you get upon following the
# registration process for a pushover application detailed at:
# https://pushover.net/api#registration
@cpu
cpu / pushoverbooted.conf
Created May 2, 2012 03:13
Simple Upstart Script to send a PushOver notification when the machine boots.
#
# pushoverbooted service
#
# Sends a PushOver notification when the box has finished booting. To
# install, place this file in /etc/init/ You can test the service by
# running 'start pushoverbooted'
#
# You will need to replace TOKEN with the value you get upon following the
# registration process for a pushover application detailed at:
# https://pushover.net/api#registration
@cpu
cpu / gist:1276006
Created October 10, 2011 18:00
Python Twitter Avatar Downloader
###############################################################################
# Quick & Dirty script to download the Avatars of your Twitter Followers
# Daniel McCarney -- 10/10/11
#
# Emphasis on the quick & dirty. There's no error handling, and bad things
# are liable to happen if you have Twitter followers with malicious avatars
#
# Requirements: Python 2.6, python-twitter, OAuth keys*
#
# *Twitter requires OAuth authentication for the API calls this script uses.