Skip to content

Instantly share code, notes, and snippets.

View DonnchaC's full-sized avatar

Donncha Ó Cearbhaill DonnchaC

View GitHub Profile
@DonnchaC
DonnchaC / keybase.md
Last active September 15, 2019 19:14

Keybase proof

I hereby claim:

  • I am donnchac on github.
  • I am donnchac (https://keybase.io/donnchac) on keybase.
  • I have a public key ASD_GTJsWifE9w34yRQPX9dhr8rJJXVmHCVpGnn6A6XyJgo

To claim this, I am signing this object:

@DonnchaC
DonnchaC / cryptnote.py
Created July 6, 2017 13:12
CryptNote is an encryption app for Windows, Android and Linux alleged by Turkey to be used by "FETÖ" - http://www.aksam.com.tr/guncel/fetonun-yeni-haberlesme-agi-cryptnote-desifre-edildi/haber-639566
"""
Cryptnote encryption algorithim
"""
import hashlib
import base64
from binascii import unhexlify
from Crypto.Cipher import AES
"""
@DonnchaC
DonnchaC / css-private-language-selector.html
Last active December 13, 2017 19:54
Show a translated page using only CSS and without leaking the language choice to the webserver
<!DOCTYPE html>
<html>
<head>
<style>
/* Hide the original text when a non-default language is selected */
#french:target ~ [data-i18n-fr],
#french:target ~ * [data-i18n-fr],
#french:target ~ * * [data-i18n-fr],
#french:target ~ * * * [data-i18n-fr] {
"ua": [
{
"doc_count": 2,
"key": "Facebook"
},
{
"doc_count": 1,
"key": "Other"
},
{
Vidalia Tor Bundles have been discontinued
------------------------------------------
The Vidalia Tor client and relay bundles are no longer supported. They client bundles have been replaced with the Tor Browser Bundle.
https://blog.torproject.org/blog/plain-vidalia-bundles-be-discontinued-dont-panic
If you would like to run a Tor relay please download the a recent copy of Tor from the main Tor Project download page.
https://www.torproject.org/download/download.html.en
@DonnchaC
DonnchaC / dkim-email-repair.py
Created October 21, 2016 20:11
Simple script to strip all headers which are not included in the signature of a DKIM signed email
import re
import copy
import logging
import argparse
import email.parser
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
required_headers = ["dkim-signature", "content-type"]
@DonnchaC
DonnchaC / dkim-results.txt
Last active October 21, 2016 20:47
Another script for stripping unsigned content from an email - https://gist.github.com/DonnchaC/070b82ab465ae0b9babc0004b05694c2
# sudo apt-get install libmail-dkim-perl
# perl validate-dkim.pl < 5205
signature identity: @hillaryclinton.com
verify result: pass
pass
@DonnchaC
DonnchaC / huaiwei-unlock.py
Created September 24, 2016 19:27
Huaiwei unlock code generator - Based on the disassembler generated C code in https://github.com/forth32/huaweicalc
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import hashlib
import argparse
import binascii
import struct
def encrypt_v1(imei, key):
# bwscan --verbose scan --no-launch-tor -p 3000 --timeout 5
2016-07-31 20:15:40+0200 [-] Log opened.
2016-07-31 20:15:40+0200 [-] Verbose log mode is on.
2016-07-31 20:15:40+0200 [-] Using /home/donnncha/.config/bwscanner as the data directory.
2016-07-31 20:15:40+0200 [-] Connecting to a running Tor instance
2016-07-31 20:15:40+0200 [-] Connected to a Tor instance.
2016-07-31 20:15:40+0200 [-] Performing a measurement scan with 3 relays.
2016-07-31 20:15:40+0200 [-] Downloading https://bwauth.torproject.org/bwauth.torproject.org/32M over $8C7106C880FE8AA1319DD71B59623FCB8914C9F1, $0DB5577A293D70F014663C68364F4D449C4D62DD
2016-07-31 20:15:40+0200 [-] Starting factory <txsocksx.client.SOCKS5ClientFactory instance at 0x7f9a74571cf8>
2016-07-31 20:15:40+0200 [-] Downloading https://bwauth.torproject.org/bwauth.torproject.org/16M over $CCA1BE38F343CF1E1B4BB1857A786957B056DC0F, $C92EAF09EB7B2B6D63DB776F7A7C025075765D29
@DonnchaC
DonnchaC / tor-circuit-cell-monitor.py
Created May 7, 2016 17:24
Rough script for reading Tor CIRC and a custom CELL control events and keep tracking of Tor's circuits and cells
# -*- coding: utf-8 -*-
"""
Monitors Tor control port for descriptor lookups and INTRODUCE1
requests.
"""
import os
import time
import datetime
import argparse
import logging