Skip to content

Instantly share code, notes, and snippets.

@krmaxwell
krmaxwell / emoji.pl
Created January 3, 2014 22:25 — forked from windytan/emoji.pl
# Oona Räisänen 2013
@emoji = qw( 🌀 🌂 🌅 🌈 🌙 🌞 🌟 🌠 🌰 🌱 🌲 🌳 🌴 🌵 🌷 🌸
🌹 🌺 🌻 🌼 🌽 🌾 🌿 🍀 🍁 🍂 🍃 🍄 🍅 🍆 🍇 🍈
🍉 🍊 🍋 🍌 🍍 🍎 🍏 🍐 🍑 🍒 🍓 🍔 🍕 🍖 🍗 🍘
🍜 🍝 🍞 🍟 🍠 🍡 🍢 🍣 🍤 🍥 🍦 🍧 🍨 🍩 🍪 🍫
🍬 🍭 🍮 🍯 🍰 🍱 🍲 🍳 🍴 🍵 🍶 🍷 🍸 🍹 🍺 🍻
🍼 🎀 🎁 🎂 🎃 🎄 🎅 🎈 🎉 🎊 🎋 🎌 🎍 🎎 🎏 🎒
🎓 🎠 🎡 🎢 🎣 🎤 🎥 🎦 🎧 🎨 🎩 🎪 🎫 🎬 🎭 🎮
🎯 🎰 🎱 🎲 🎳 🎴 🎵 🎷 🎸 🎹 🎺 🎻 🎽 🎾 🎿 🏀
@krmaxwell
krmaxwell / get_url.py
Created January 15, 2014 04:47
Wrapper function to handle logic around urllib2.urlopen()
# Utility function to get a URL with error handling
# Accepts URL string or urllib2.Request object
def get_url(orig_request):
if isinstance(orig_request, basestring):
url = orig_request.encode('utf8')
request = urllib2.Request(url)
elif isinstance(orig_request, urllib2.Request):
request = orig_request
else:
return None
@krmaxwell
krmaxwell / 01-OriginalTweet.md
Last active January 4, 2016 13:09
Twitter spam
Duhokunijei Lawiqoo
@DLawiqoo
N3u.hi.d9p1.info/Pnla

3:55pm · 25 Jan 14

Account already suspended.

#! /usr/bin/perl
#
# Script written to pull IP data from openIOC and search Splunk.
#
use strict;
use warnings;
$|=1;
@krmaxwell
krmaxwell / thug-docker.md
Last active August 29, 2015 13:56
Running thug under docker on EC2
  1. Started an EC2 instance using Docker instructions
  2. Installed thug with sudo docker pull jnazario/thug
  3. Created directory in my home named thuglogs (can be anything)
  4. alias thug='docker run -w /usr/local/src/thug/src -v /home/ubuntu/thuglogs:/usr/local/src/thug/logs jnazario/thug python thug.py'
  5. thug -r http://example.net/myreferer http://evil.example.com/badstuffhere
  6. Logs will go in /home/ubuntu/thuglogs or whatever directory you specify in the alias
@krmaxwell
krmaxwell / vcdb-join.py
Created March 4, 2014 20:33
Merge all of VCDB data (https://github.com/vz-risk/VCDB) into one big JSON file
import os
import json
import sys
# initialization
directory = sys.argv[1]
dir_list = os.listdir(directory)
vcdb = []
for filename in dir_list:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"incident": {
"action": {
"Unknown": {}
},
"actor": {
"internal": {
"job_change": ["Promoted"],
"notes": "This is a test",
"variety": [
kmaxwell@gauss:~/src/veris$ nosetests --nocapture > tmp
........................................................................................................................E
======================================================================
ERROR: Failure: JSONDecodeError (Expecting ',' delimiter or '}': line 43 column 3 (char 776))
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 251, in generate
for test in g():
File "/home/kmaxwell/src/veris/tests/tests.py", line 32, in test_Schema
test = simplejson.loads(open('./tests/'+eachTestFile).read())
@krmaxwell
krmaxwell / StopDDOS.ipynb
Created March 31, 2014 14:57
IPython Notebook for collecting info from http://stopddos.ru
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.