Skip to content

Instantly share code, notes, and snippets.

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

Brandon Dixon 9b

🐗
Creating.
View GitHub Profile
@9b
9b / mr_named_funcs.js
Created March 24, 2011 19:37
Unique named functions with instance and total counts
var map = function () {
this.structure.keywords.keyword.forEach(
function (z) {
emit(z.name, {count_sum: z.count, count: 1});
}
);
}
var reduce = function (key, values) {
var total = 0;
@9b
9b / pdf_renamer.py
Created March 22, 2011 18:46
Rename a directory of malicious PDFs with the hash.pdf.vir format
import hashlib
import optparse
import os
def get_hash_data(file, type):
if type == "md5":
output = hashlib.md5()
elif type == "sha1":
output = hashlib.sha1()
elif type == "sha256":
@9b
9b / VtNewFormat.py
Created March 22, 2011 03:32
Take the existing VirusTotal format and put it into a more user-friendly output
__description__ = 'Convert VT format to a user-friendly format'
__author__ = 'Brandon Dixon'
__version__ = '1.0'
__date__ = '2011/03/21'
import simplejson as json
import urllib
import urllib2
import hashlib
@9b
9b / uma.py
Created January 19, 2011 20:51
Take a blob of IP traffic and let me know if anything currently is in communication with a known compromised host
#!/usr/bin/python
__description__ = 'Get the MDL list and search a blob'
__author__ = 'Brandon Dixon'
__version__ = '1.0'
__date__ = '2011/19/01'
import optparse
import os
@9b
9b / unique_hash_objects.py
Created January 4, 2011 13:10
Goes through MongoDB store and checks if any object hash is duplicated
import pymongo
import json
from pymongo import Connection
def connect_to_mongo(host, port, database, collection):
connection = Connection(host, port)
db = connection[database]
collection = db[collection]
return collection