Skip to content

Instantly share code, notes, and snippets.

@DTailor
DTailor / sniffer.py
Created May 8, 2012 20:16
Raw Socket Sniffer
import socket
from struct import *
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)
while True:
pack = s.recvfrom(20000)
#Get the single element from the tuple
#!/usr/bin/env python
import base64, hashlib, hmac, json, sys, getpass
from Crypto.Cipher import AES
from Crypto.Hash import RIPEMD, SHA256
base58_chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
def prompt(p):
return getpass.getpass(p + ": ")
@josephkern
josephkern / bloom.py
Created June 8, 2012 19:04
A Simple Bloom Filter in Python
#!/usr/bin/env python
"""A simple Bloom Filter implementation
Calculating optimal filter size:
Where:
m is: self.bitcount (how many bits in self.filter)
n is: the number of expected values added to self.filter
k is: the number of hashes being produced
(1 - math.exp(-float(k * n) / m)) ** k
http://en.wikipedia.org/wiki/Bloom_filter
"""
@fcicq
fcicq / mywallet.py
Created August 16, 2012 08:49 — forked from anfedorov/mywallet.py
tools to decrypt blockchain.info wallet.json.aes
#!/usr/bin/env python
import base64, hashlib, hmac, json, sys, getpass
from Crypto.Cipher import AES
from Crypto.Hash import RIPEMD, SHA256
base58_chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
def prompt(p):
return getpass.getpass(p + ": ")
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@edwardbadboy
edwardbadboy / signalfdReaperDemo.py
Created January 29, 2013 03:20
Useful Python code snippet.
from operator import itemgetter
import multiprocessing
import os
import signal
# yum install python-signalfd
import signalfd
import struct
import threading
import time
#!/bin/bash
# PoC tty_tickets spoofing exploit by Ryan Castellucci
# Originally written October 2012, see CVE-2013-1776
# This does not implement using setsid to cause fallback
DUMMY=/does/not/exist/$RANDOM/$RANDOM/$RANDOM/$RANDOM
WAIT_LOOP=0
# Usage ./sudosudo.sh command [args]
@jonls
jonls / brain-wallet-many.html
Last active April 18, 2018 22:43
HTML/Javascript generator of many bitcoin brain wallets (based on bitaddress.org).
<!doctype html>
<html>
<head>
<!--
Donation Address: 1NiNja1bUmhSoTXozBRBEtR8LeF9TGbZBN
Notice of Copyrights and Licenses:
***********************************
The bitaddress.org project, software and embedded resources are copyright bitaddress.org.
The bitaddress.org name and logo are not part of the open source license.
@Ayrx
Ayrx / miller_rabin.py
Created June 28, 2013 13:47
Python implementation of the Miller-Rabin Primality Test
def miller_rabin(n, k):
# Implementation uses the Miller-Rabin Primality Test
# The optimal number of rounds for this test is 40
# See http://stackoverflow.com/questions/6325576/how-many-iterations-of-rabin-miller-should-i-use-for-cryptographic-safe-primes
# for justification
# If number is even, it's a composite number
if n == 2:
@drhelius
drhelius / Game Boy Boot ROM Disassembly
Last active June 11, 2024 22:04
Game Boy Boot ROM Disassembly
LD SP,$fffe ; $0000 Setup Stack
XOR A ; $0003 Zero the memory from $8000-$9FFF (VRAM)
LD HL,$9fff ; $0004
Addr_0007:
LD (HL-),A ; $0007
BIT 7,H ; $0008
JR NZ, Addr_0007 ; $000a
LD HL,$ff26 ; $000c Setup Audio