Skip to content

Instantly share code, notes, and snippets.

View deadbits's full-sized avatar
🪴

Adam Swanda deadbits

🪴
View GitHub Profile
#!/usr/bin/python
''' Not my script, found on the Internet, and rediscovered on my hard drive
'''
import sys
def cidr_to_regex(cidr):
ip, prefix = cidr.split('/')
base = 0
for val in map(int, ip.split('.')):
@deadbits
deadbits / docs.txt
Created February 16, 2015 21:13
documentation format
Functions and Methods (function or method docstrings)
@param p: ... A description of the parameter p for a function or method. It may appear in the class docstring to describe a costructor parameter: mostly useful for C extensions.
@type p: ... The expected type for the parameter. p.
@return: ... The return value for a function or method.
@rtype: ... The type of the return value for a function or method.
@keyword p: ... A description of the keyword parameter p. It may appear in the class docstring to describe a costructor keyword parameter.
@raise e: ... A description of the circumstances under which a function or method raises exception e. It may appear in the class docstring to describe an exception that can be raised by the costructor.
Variables (module, class or variable docstrings)
@deadbits
deadbits / hashdeep.py
Last active August 29, 2015 14:16 — forked from techtonik/hashdeep.py
"""
Build recursive hash of files in directory tree in hashdeep format.
Hashdeep format description:
http://md5deep.sourceforge.net/start-hashdeep.html
hashdeep.py differences from original hashdeep:
- if called without arguments, automatically starts to build
@deadbits
deadbits / keybase.md
Created September 23, 2015 20:39
keybase.md

Keybase proof

I hereby claim:

  • I am deadbits on github.
  • I am deadbits (https://keybase.io/deadbits) on keybase.
  • I have a public key whose fingerprint is D65D 4712 2018 9C21 E5D2 13B5 D65E F900 37DD 79AF

To claim this, I am signing this object:

@deadbits
deadbits / iprange.py
Created February 25, 2012 03:14
new get local IP and range
#!/usr/bin/python
from scapy.all import *
localIP = [x[4] for x in scapy.all.conf.route.routes if x[2] != '0.0.0.0'][0]
splitIP = localIP.split('.')
splitIP[3:] = (['0/24'])
IPRange = ".".join(splitIP)
print IPRange
@deadbits
deadbits / gist:2069269
Created March 18, 2012 05:58 — forked from codian/gist:2069206
current git branch name on prompt
export PS1="\[\033[34m\]\w\[\033[35m\]\`ruby -e \"print (%x{git branch 2> /dev/null}.split(/\n/).grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1)')\"\`\[\033[00m\]> "
@deadbits
deadbits / marshal2.py
Created April 12, 2012 22:30
and again...
import marshal
script = """
print 'hello'
"""
code = compile(script, "<script>", "exec")
data = marshal.dumps(code)
@deadbits
deadbits / multi.py
Created April 13, 2012 02:44
Multiple connections
import os,sys
import socket
import time
HOST = ''
PORT = 4444
activePID = []
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.bind((HOST, PORT))
@deadbits
deadbits / filequeue.rb
Created November 14, 2012 00:04
traverse and populate
# part of the MinusOne project.
# methods from minus/lib/environment.rb
# traverse a given directory tree to determine
# if a path is a file or a directory.
# if the file extension of any file matches the
# specified language, add that file to the scan queue.
def determine_extension
puts "[~] determining file extension..."
case $options[:language].downcase
@deadbits
deadbits / dropper_strings.txt
Created November 23, 2012 04:27
malware strings with (most) junk removed
GET ^&&%$%$^%$#^&**(*((&*^%$##$%^&*(*&^%$%^&*.htmGET ^*%%RTG*(&^%FTGYHJIJ%^&*()*&*^&%RDFG(JKJH.aspGET *(&*^TGH*JIHG^&*(&^%*(*)OK)(*&^%$EDRGF%&^.htmlGET ^&&%$%$^%$#^&**(*((&*^%$##$%^&*(*&^%$%^&*.htmGET ^*%%RTG*(&^%FTGYHJIJ%^&*()*&*^&%RDFG(JKJH.aspGET *(&*^TGH*JIHG^&*(&^%*(*)OK)(*&^%$EDRGF%&^.htmlGET ^*%%RTG*(&^%FTGYHJIJ%^&*()*&*^&%RDFG(JKJH.aspGET *(&*^TGH*JIHG^&*(&^%*(*)OK)(*&^%$EDRGF%&^.htmlGET ^&&%$%$^%$#^&**(*((&*^%$##$%^&*(*&^%$%^&*.htmGET ^*%%RTG*(&^%FTGYHJIJ%^&*()*&*^&%RDFG(JKJH.aspGET *(&*^TGH*JIHG^&*(&^%*(*)OK)(*&^%$EDRGF%&^.htmlGET ^*%%RTG*(&^%FTGYHJIJ%^&*()*&*^&%RDFG(JKJH.aspGET *(&*^TGH*JIHG^&*(&^%*(*)OK)(*&^%$EDRGF%&^.htmlGET ^*%%RTG*(&^%FTGYHJIJ%^&*()*&*^&%RDFG(JKJH.aspGET ^&&%$%$^%$#^&**(*((&*^%$##$%^&*(*&^%$%^&*.htmGET ^&&%$%$^%$#^&**(*((&*^%$##$%^&*(*&^%$%^&*.htmGET ^*%%RTG*(&^%FTGYHJIJ%^&*()*&*^&%RDFG(JKJH.aspGET *(&*^TGH*JIHG^&*(&^%*(*)OK)(*&^%$EDRGF%&^.htmlGET ^&&%$%$^%$#^&**(*((&*^%$##$%^&*(*&^%$%^&*.htmGET ^*%%RTG*(&^%FTGYHJIJ%^&*()*&*^&%RDFG(JKJH.aspGET ^&&%$%$^%$#^&**(*((&*^%$##$%^&*(*&