Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright 2017 frennkie (https:/
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
USERNAME = "admin2"
PASSWORD = "not-very-secret"
APIURL = "" # no trailing slash
# Check if the user is in the right group
# and afterwards retrieve the SSH public key from LDAP
# Logs directly in Syslog
# requires ldap-utils
# sshd_config for OpenSSH 6.2 or higher:
frennkie /
Last active August 23, 2017 20:32
#!/usr/bin/env python3
import datetime
import argparse
import re
def mkdate(datestring):
if isinstance(datestring, datetime.datetime):

Keybase proof

I hereby claim:

  • I am frennkie on github.
  • I am frennkie ( on keybase.
  • I have a public key ASDnUdnZrWbMaGeLVSkUpYfxfru5cOQMXMI5cubPq6tL_wo

To claim this, I am signing this object:

frennkie /
Created May 13, 2018 10:06 — forked from ageis/
Technical guide for using YubiKey series 4 for GPG and SSH

YubiKey 4 series GPG and SSH setup guide

Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.

You'll probably be working with a single smartcard, so you'll want only one primary key (1. Sign & Certify) and two associated subkeys (2. Encrypt, 3. Authenticate).

import base64
from http import HTTPStatus
from http.server import BaseHTTPRequestHandler
import json
import logging
from random import randint
import sys
import socketserver
import threading
set -x
mkdir -p output
mkdir -p merge split tiff
find ./originals -type f -name '*.pdf' -exec sh -c '
#!/usr/bin/env python
# Exfiltrate a file from Windows Powershell over HTTP Post using certutil for
# Base64 conversion to avoid broken file due to text based post transmission.
# Requires
# pip install tornado
# Sample usage (exfiltrate flag.docx)
# python
View gist:e8d3cd0fd90be6338ea5bd8c79b5c2e3
from O365 import Account, Connection, FileSystemTokenBackend, MSGraphProtocol, MSOffice365Protocol
import re
client_id = "<client_id>"
client_secret = "<client_secret>"
tenant_id = "<tenant_id>"
credentials = (client_id, client_secret)