Skip to content

Instantly share code, notes, and snippets.

@jandryuk
jandryuk / format-xsm-policy.sh
Last active November 23, 2020 17:13
Script to normalize an XSM Flask policy
#!/bin/bash
# pipe an expanded XSM Flask policy.conf in:
# $0 < policy.conf
#
# The script chokes on booleans, edit policy.conf to remove
# "if ( ) { } else { } " and just leave the case you want to evaluate.
set -o noglob
@jandryuk
jandryuk / mod-sig-chk.py
Created September 25, 2020 12:59
mod-sig-chk.sh is a script to check the kernel modules signatures against a cert. mod-sig-chk.py is a helper, called by mod-sig-chk.sh, to extract the actual signature data for verification. mod-sig-chk.py should be in the user's home (~/) directory.
#!/usr/bin/env python
import struct
import sys
magic = "~Module signature appended~\n"
magic_len = len(magic)
PKEY_ID_PKCS7 = 2
@jandryuk
jandryuk / gist:50ca8ababe0daff508ce94674d3afff3
Created February 19, 2020 18:18
OpenXT Cap PCR-15 TPM1.2
dhash="b714bb4ba08ab2e4ed7e96dac2484bccb057c40e"
hashlib.sha1(unhexlify(dhash) + hashlib.sha1("MEASUREDLAUNCHCLOSED".encode("utf-8")).digest()).hexdigest()
@jandryuk
jandryuk / sdf.org MD5 SSH fingerprints
Created October 1, 2016 14:40 — forked from anonymous/sdf.org MD5 SSH fingerprints
sdf.org SSH public key info as of 20161001
2048 MD5:6e:cd:53:4f:75:a1:e8:5b:63:74:32:4f:0c:85:05:17 ol.sdf.org (RSA)
256 MD5:e4:ff:65:d7:be:5d:c8:44:1d:89:6b:50:f5:50:a0:ce ol.sdf.org (ED25519)
256 MD5:e4:ff:65:d7:be:5d:c8:44:1d:89:6b:50:f5:50:a0:ce mx.sdf.org (ED25519)
2048 MD5:6e:cd:53:4f:75:a1:e8:5b:63:74:32:4f:0c:85:05:17 mx.sdf.org (RSA)
2048 MD5:6e:cd:53:4f:75:a1:e8:5b:63:74:32:4f:0c:85:05:17 sdf.lonestar.org (RSA)
256 MD5:e4:ff:65:d7:be:5d:c8:44:1d:89:6b:50:f5:50:a0:ce sdf.lonestar.org (ED25519)
2048 MD5:6e:cd:53:4f:75:a1:e8:5b:63:74:32:4f:0c:85:05:17 bjork.sdf.org (RSA)
256 MD5:e4:ff:65:d7:be:5d:c8:44:1d:89:6b:50:f5:50:a0:ce bjork.sdf.org (ED25519)
2048 MD5:6e:cd:53:4f:75:a1:e8:5b:63:74:32:4f:0c:85:05:17 miku.sdf.org (RSA)
256 MD5:e4:ff:65:d7:be:5d:c8:44:1d:89:6b:50:f5:50:a0:ce miku.sdf.org (ED25519)
@jandryuk
jandryuk / gist:1f55df5016e23d264e80
Created February 2, 2016 13:26
SSH MitM attempt over TOR
$ torsocks ssh ec2-user@ec2.compute-1.amazonaws.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
e7:0e:73:a5:88:23:67:9c:01:87:3c:61:96:f6:e8:0a.
Please contact your system administrator.
@jandryuk
jandryuk / gist:7076553
Created October 20, 2013 23:19
Pipelight Xorg backtrace.
[ 24.407]
X.Org X Server 1.13.3
Release Date: 2013-03-07
[ 24.407] X Protocol Version 11, Revision 0
[ 24.407] Build Operating System: Linux 3.2.0-37-generic x86_64 Ubuntu
[ 24.407] Current Operating System: Linux shine 3.8.0-31-generic #46-Ubuntu SMP Tue Sep 10 20:03:44 UTC 2013 x86_64
[ 24.407] Kernel command line: BOOT_IMAGE=/vmlinuz-3.8.0-31-generic root=/dev/mapper/ubuntu-root ro quiet splash vt.handoff=7
[ 24.407] Build Date: 16 October 2013 04:35:36PM
[ 24.407] xorg-server 2:1.13.3-0ubuntu6.2 (For technical support please see http://www.ubuntu.com/support)
[ 24.407] Current version of pixman: 0.28.2
@jandryuk
jandryuk / gist:7076542
Created October 20, 2013 23:17
Pipelight Xorg backtrace.
[ 6660.281] (EE)
[ 6660.281] (EE) Backtrace:
[ 6660.282] (EE) 0: /usr/bin/X (xorg_backtrace+0x36) [0x7f9800e584d6]
[ 6660.282] (EE) 1: /usr/bin/X (0x7f9800ca8000+0x1b4319) [0x7f9800e5c319]
[ 6660.282] (EE) 2: /lib/x86_64-linux-gnu/libpthread.so.0 (0x7f97ffdab000+0xfbd0) [0x7f97ffdbabd0]
[ 6660.282] (EE) 3: /usr/lib/xorg/modules/extensions/libglx.so (0x7f97fd87d000+0xd96c) [0x7f97fd88a96c]
[ 6660.282] (EE) 4: /usr/lib/xorg/modules/extensions/libglx.so (0x7f97fd87d000+0x3c403) [0x7f97fd8b9403]
[ 6660.282] (EE) 5: /usr/bin/X (0x7f9800ca8000+0x58ac1) [0x7f9800d00ac1]
[ 6660.282] (EE) 6: /usr/bin/X (0x7f9800ca8000+0x4757a) [0x7f9800cef57a]
[ 6660.282] (EE) 7: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xf5) [0x7f97fe9f8ea5]