Skip to content

Instantly share code, notes, and snippets.

View 9b's full-sized avatar
🐗
Creating.

Brandon Dixon 9b

🐗
Creating.
View GitHub Profile
{
'errors': [],
'results': {
'focusPoint': 'net.chiquita-brands.com',
'dynMatch': '',
'tags': [],
'userTags': ['chinese'],
'tld': 'com',
'dynamic': False,
'lastSeen': '2014-04-26 21:05:52',
@9b
9b / fucker.cpp
Last active August 29, 2015 13:55
#include <sstream>
#include <string>
#include <cstring>
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
@9b
9b / gist:6428140
Created September 3, 2013 19:02
Logging for fun!
loggersS = set()
def logger(loggerName, level, logFile=None):
'''
Get a logging instance
@param loggerName name of the logging instance
@param level level in which to log
@param logFile the absolute path to the log file to use. you must have write perms for this!
@return logging object used for later on
@9b
9b / poorMansConvert.py
Created May 19, 2013 20:01
Uses the Google Drive API to upload a file, convert it to a file format, download it locally and delete it from Drive.
#!/usr/bin/python
def poorMansConvert(di, inPath, outType, outPath):
from apiclient.http import MediaFileUpload
valid_output = [
'text/html','text/plain','application/rtf','application/vnd.oasis.opendocument.text',\
'application/pdf','application/vnd.openxmlformats-officedocument.wordprocessingml.document',\
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet','application/x-vnd.oasis.opendocument.spreadsheet',\
'image/jpeg','image/png','image/svg+xml','application/vnd.openxmlformats-officedocument.presentationml.presentation'
#!/usr/bin/python
def poorMansConvert(di, inPath, outType, outPath):
from apiclient.http import MediaFileUpload
valid_output = [
'text/html','text/plain','application/rtf','application/vnd.oasis.opendocument.text',\
'application/pdf','application/vnd.openxmlformats-officedocument.wordprocessingml.document',\
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet','application/x-vnd.oasis.opendocument.spreadsheet',\
'image/jpeg','image/png','image/svg+xml','application/vnd.openxmlformats-officedocument.presentationml.presentation'
@9b
9b / pdf2xdp.py
Created June 16, 2012 23:11
PDF => XDP
import base64
import sys
def main():
if len(sys.argv) < 3:
sys.exit('Usage (2 arguments): %s "%s" %s' % (sys.argv[0],"malicious file","outfile"))
else:
f = open(sys.argv[1],"rb")
con = f.read()
f.close()
@9b
9b / string_rippah.py
Created March 22, 2012 20:16
Build JSON structure representing how often a given string occurs and insert into a mongodb collection
var map = function () {
fhash = this.hash;
this.static.strings.forEach(function (z) {emit(z.name, {hash: fhash, count_sum: z.count, count: 1});});
}
var reduce = function (key, values) {
var hashes = [];var total = 0;var count = 0;var stotal = 0;
for (var i = 0; i < values.length; i++) {
stotal += values[i].count;
total += values[i].count_sum;
@9b
9b / clean_tibet.py
Created March 21, 2012 03:57
Parse the Twitter stream for #tibet or #freetibet and identify potential spammers based on static traits.
import pycurl
import simplejson as json
import urllib
import time
import datetime
STREAM_URL = "https://stream.twitter.com/1/statuses/filter.json"
USER = "YOUR USERNAME"
PASS = "YOUR PASSWORD"
@9b
9b / shortspam.py
Created February 14, 2012 20:45
Quick Payback to the cat facts idioits
import sys
import smtplib
import socket
from email.mime.text import MIMEText
def sendmail(user):
   sender = "admin@smscatfacts.com"
   recv = user
   subject = "Shave it up!"
@9b
9b / jshooker.js
Created December 13, 2011 16:50
Hook JS calls for easier analysis
//preserve originals
var ori = function() {
var self = this;
this.unescape = unescape;
this.alert = alert;
this.eval = eval;
this.fromCharCode = String.fromCharCode;
this.call_unescape = function(e) {
document.write("<br>original unescape was passed data");