Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@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
@hellais
hellais / .vimrc
Created May 22, 2012 14:50
vimrc
filetype off
set foldmethod=indent
set foldlevel=99
set ruler
set tabstop=4
set shiftwidth=4
set expandtab
@hellais
hellais / gunner.py
Created July 4, 2012 16:51
gunnerbot
import re
import random
from twisted.words.protocols import irc
from twisted.internet import protocol
gunner_words = ['BOOM, love ya!', 'Love it!',
'Does anybody have any ah-has they would like to share',
'Close your laptops']
class GunnerBot(irc.IRCClient):
@hellais
hellais / gist:4028998
Created November 7, 2012 01:33
Starting a tor process and not making it stop
import txtorcon
from twisted.internet import defer
from ooni.utils import log
from ooni import nettest
class ExampleTorProcess(nettest.NetTestCase):
name = "Example Tor Process"
def tearDown(self):
Foobar
from twisted.internet import reactor
from ooni.lib.txagentwithsocks import Agent, Headers
agent = Agent(reactor)
headers = Headers({'SoMeHeader-TEsT': ['antani']})
def done(result):
reactor.stop()
d = agent.request('GET', 'http://127.0.0.1:57001/', headers)
2012-11-27 07:35:50+0400 [SOCKSv5ClientProtocol,client] Unhandled Error
Traceback (most recent call last):
Failure: twisted.web._newclient.ResponseNeverReceived: [<twisted.python.failure.Failure <class 'twisted.internet.error.ConnectionDone'>>]
INFO:ooniprobe:Log opened.
INFO:ooniprobe:No test deck detected
DEBUG:ooniprobe:processing options
DEBUG:ooniprobe:Running [(<class 'http_body_length.HTTPBodyLength'>, 'test_get')]
DEBUG:ooniprobe:Options {'inputs': [None], 'version': '0.1', 'name': 'HTTP Body length test'}
DEBUG:ooniprobe:cmd_line_options {'pcapfile': None, 'help': 0, 'subargs': ('-u', 'http://lowes.com/'), 'resume': 0, 'test': 'nettests/blocking/http_body_length.py', 'logfile': None, 'collector': None, 'reportfile': None}
DEBUG:ooniprobe:Creating report_http_body_length_29_November_2012_10-08-27.yamloo
DEBUG:ooniprobe:Writing report with YAML reporter
INFO:ooniprobe:Reporting to file report_http_body_length_29_November_2012_10-08-27.yamloo
DEBUG:ooniprobe:Not going to resume http_body_length.py