Skip to content

Instantly share code, notes, and snippets.

@hellais
hellais / gist:10496214
Created April 11, 2014 19:50
random int generation.
# random int generation as gist.
randint = lambda a,b: a + int(''.join("%x" % ord(i) for i in os.urandom(b-a+1)), 16) % (b - a + 1)
@hellais
hellais / gist:a1a63df6e9f4958c9ab0
Created August 11, 2014 15:32
Enumerate HS descriptors
import json
from pprint import pprint
from base64 import b64decode
from twisted.internet import reactor, defer
from txtorcon import launch_tor, TorConfig, TorState
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet.task import react
from twisted.web.client import readBody
@hellais
hellais / designer.html
Created August 23, 2014 17:02
designer
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<polymer-element name="my-element">
<template>
@hellais
hellais / report-dns_injection-2014-12-12T101910Z.yamloo
Created December 15, 2014 18:21
first ever libight ooniprobe report
---
test_name: dns_injection
test_version: 0.0.1
probe_ip: 127.0.0.1
software_name: ight
software_version: 0.0.1
data_format_version: 0.1
...
---
input: google.com
@hellais
hellais / votes.csv
Last active August 29, 2015 14:15
votes for OONI roadmap
Goal asn sbs cda irl average phw feamster phillipa mer
Implement data analytics and visualization for OONI tests 5 4 5 5 4.75 "+1" "+1" "+1"
Reach production quality ooni rasperry-pi (beagle-board) images 4 4 4 5 4.25 "+1"
Develop OONI tests for censorship circumvention tools 4 4 3 5 4 "+1" "+1"
Develop scheme for orchestrating ooni-probes 3 3 5 5 4 "+1"
Promote and further develop OONI on mobile (Android, iOS) 3 4 4 5 4
Get daily OONI measurements from 50 countries 4 4 2 5 3.75
Publish monthly reports about the status of internet censorship in a country 4 5 2 4 3.75
Implement a GUI for ooniprobes 3 3 5 4 3.75
Do research based on OONI 3 3 5 3.666666667
@hellais
hellais / gist:1d6a7ce672f0130b8f63
Created March 16, 2015 15:24
blind signatures
import os
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends.openssl.backend import Backend
from config import priv_key_path
def generate_private_key(private_key_path):
private_key = rsa.generate_private_key(
@hellais
hellais / binario.py
Last active August 29, 2015 14:21
A minimalist parallel processing python framework
import time
import traceback
from datetime import datetime
from multiprocessing import Process, Semaphore, JoinableQueue
class BaseNode(object):
def __init__(self, concurrency=1):
self.concurrency = concurrency
@hellais
hellais / gist:2039763
Created March 14, 2012 21:44
get mozilla ciphers
# Read the cpp file to understand what Ciphers map to what name
fileA = open('security/manager/ssl/src/nsNSSComponent.cpp','r')
start = None
lines = fileA.readlines()
for i, line in enumerate(lines):
if line.strip().startswith('static CipherPref CipherPrefs'):
# Get the starting boundary of the Cipher Preferences
start = i
@hellais
hellais / gist:2040125
Created March 14, 2012 22:40
Client Helo Firefox 10.0.2 on Ubuntu oneiric
Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff)
Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a)
Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014)
Cipher Suite: TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA (0x0088)
Cipher Suite: TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA (0x0087)
Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039)
Cipher Suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA (0x0038)
Cipher Suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA (0xc00f)
Cipher Suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA (0xc005)
@hellais
hellais / gist:2719870
Created May 17, 2012 16:09
Simple Hidden Chat
import tempfile
import functools
import os
from datetime import datetime
from twisted.internet.protocol import Factory
from twisted.internet.endpoints import TCP4ServerEndpoint
from twisted.internet import fdesc
from twisted.protocols.basic import LineReceiver
from twisted.internet import reactor