Skip to content

Instantly share code, notes, and snippets.

@olivierlemoal
olivierlemoal / custom_base64.py
Created August 11, 2015 22:02
Custom base64 encoder/decoder
#!/usr/bin/env python3
import base64
custom_b64 = "CDEFGHIJKLMNOPQRSTUVWXYZABcdefghijklmnopqrstuvwxyzab0123456789+/"
original_b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
def encode(clear_text):
b64 = base64.b64encode(clear_text)
@olivierlemoal
olivierlemoal / decrypt_lorobot.py
Created August 11, 2015 22:02
Decrypt files encoded with LoroBot malware
#! /usr/bin/env python3
from itertools import cycle
import binascii
key = binascii.unhexlify("C9936BCADFBFC0614649334746AE8FCC")
key = bytearray(key)
def xor(data, key):
return bytearray([a ^ b for (a, b) in zip(data, cycle(key))])
@olivierlemoal
olivierlemoal / wireshark_userpriv.sh
Created August 3, 2015 09:46
wireshark with user privileges
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
# verify :
getcap /usr/bin/dumpcap
List driver objects :
kd> !object \Driver
Display driver structure :
kd> dt nt!_DRIVER_OBJECT 0x000000
Display SSDT:
kd> dd dwo(KeServiceDescriptorTable) L100
Driver :
@olivierlemoal
olivierlemoal / dunstrc
Created July 22, 2015 20:39
dunst config
[global]
font = Monospace 8
# Allow a small subset of html markup in notifications and formats:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
#! /usr/bin/env python3
import subprocess
from i3pystatus import Status
status = Status(standalone=True)
# Displays clock like this:
# Tue 30 Jul 11:59:46 PM KW31
# ^-- calendar week
@olivierlemoal
olivierlemoal / config.base
Last active August 29, 2015 14:25
i3 base config, gen with j4-make-config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
Remote wireshark :
with tshark
ssh <REMOTE HOST> sudo tshark -w - not tcp port 22 | wireshark -k -i -
with tcpdump
ssh <REMOTE HOST> sudo tcpdump -U -s0 -w - -i eth0 'not port 22' | wireshark -k -i -
rwireshark () { ssh $1 sudo tcpdump -U -s0 -w - -i eth0 'not port 22' | wireshark -k -i - }
@olivierlemoal
olivierlemoal / webrtc_services
Created June 23, 2015 19:20
WebRTC Services
http://talky.io
http://vmux.co
http://vline.com
http://tokbox.com
https://appear.in/
https://jumpch.at/
https://www.gruveo.com/
http://hibuddy.monkeypatch.me/
@olivierlemoal
olivierlemoal / test_ocsp.sh
Last active August 29, 2015 14:21
Test OCSP server with OpenSSL
# We first download the certificate to check
openssl s_client -connect olivierlemoal.fr:443 2>&1 < /dev/null | sed -n '/-----BEGIN/,/-----END/p' > cert.pem
# We get the OCSP URI from the certificate
openssl x509 -in cert.pem -noout -ocsp_uri
# Get the Issuer URI :
openssl x509 -in cert.pem -noout -text | grep "CA Issuers"
# Download...
wget http://aia.startssl.com/certs/sub.class1.server.ca.crt
# Convert to PEM format from DER
openssl x509 -in sub.class1.server.ca.crt -inform DER -out sub.class1.server.ca.crt