Skip to content

Instantly share code, notes, and snippets.

@baderj
baderj / dga_shiz.py
Last active September 9, 2015 02:20
DGA of Simda / Shiz
import argparse
def get_domains(nr, how_many):
bases = {
1: {
'length': 7,
'tld': 'com',
'key': '1676d5775e05c50b46baa5579d4fc7',
'base': 0x45AE94B2
},
@9b
9b / k10.py
Last active September 20, 2015 16:53
import datetime, re, difflib
def k10(stack):
if len(stack) <= 1:
return
checkHashes, checkDuplicates, checkDelta, checkName = True, True, True, True
score, dCount, fCount, deltaScore, fnameScore, chainAverage = 65, 0, 0, 0, 0, 0
duplicates, dChain, fChain, features = [], [], [], [ 'valid_filenames' ]
@nyov
nyov / pysmjs.py
Created July 19, 2013 15:31
python spidermonkey javascript evaluation example
import os
import subprocess
def spidermonk(script, user):
""" JavaScript wrapper
smjs notes: not recommended for production use,
as it contains dangerous (security-wise) debugging features.
-- Make sure not to load unsafe javascripts!
"""
@baderj
baderj / dga.py
Last active January 12, 2016 13:02
"""
generate domains according to:
- https://www.endgame.com/blog/malware-with-a-personal-touch.html
- http://www.rsaconference.com/writable/presentations/file_upload/br-r01-end-to-end-analysis-of-a-domain-generating-algorithm-malware-family.pdf
requires words1.txt and words2.txt
"""
import time
from datetime import datetime
import argparse
@rjp
rjp / robohash.js
Created July 8, 2011 15:04
Replace twitter avatars with robohash robots
// ==UserScript==
// @name RoboHash Your Twitters
// @namespace rjp
// @description Replace twitter avatars with RoboHash avatars
// @include http://twitter.com/
// ==/UserScript==
// linkifyContainer idea gratefully and wholly stolen from
// http://arantius.com/misc/greasemonkey/linkify-plus.user.js#
// with minor reformatting by me to make a nicer gist
@stepchowfun
stepchowfun / finite_automaton.h
Created October 18, 2012 05:45
This header declares structures and interfaces for manipulating finite automata, both deterministic and nondeterministic.
/*
This header declares structures and interfaces for manipulating finite automata,
both deterministic and nondeterministic.
The code is written in a portable subset of C++11. The only C++11 features used
are std::unordered_map and std::unordered_set, which easily can be replaced with
the (less-efficient) C++03 equivalents: std::map and std::set.
*/
#ifndef FINITE_AUTOMATON_H
/* Copyright (C) 2016 Salvatore Sanfilippo. All Rights Resereved.
* This code is released under the BSD 3 clause license. */
#include <math.h>
#include <stdlib.h>
/* Return a random number with normal distribution and the specified
* mean and variance. It uses the "polar method" but does not cache one
* of the previously generated random numbers, it just returns a single
* one per iteration in order for the function to be completely stateless. */
@mnp
mnp / export-pushbullet
Created March 9, 2016 16:16
export from pushbullet to a pile of json
#!/bin/bash
# see https://docs.pushbullet.com/#list-pushes
mytoken=$1
n=0
cursor=''
while true; do