Skip to content

Instantly share code, notes, and snippets.

@KasparNagu
KasparNagu / requests_auth_gssapi_spnego.py
Created January 3, 2016 16:30
Spnego over GSSAPI and SSPI
from requests.auth import AuthBase
import re
import base64
import gssapi
from requests.compat import urlparse
class HTTPAuthSPNEGOGSSAPI(AuthBase):
"""Attaches HTTP GSSAPI/Kerberos Authentication to the given Request
object."""
negoRegex = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I)
@KasparNagu
KasparNagu / wikitableparser.py
Created May 12, 2017 20:27
Python parser and editor for wiki tables
#/usr/bin/python
import re
class BorderedTextList:
def __init__(self,lst):
self.lst = lst
def text(self):
return "".join([l.text() for l in self.lst])
def split(self,re):
return BorderedTextList([l.split(re) for l in self.lst])
@KasparNagu
KasparNagu / advancedInstallerExtractor.py
Last active June 28, 2025 19:13
Script to extract Advanced Installer Exes
#!/usr/bin/env python
import sys
import struct
import os
#inspired by https://aluigi.altervista.org/bms/advanced_installer.bms
#with some additionaly reverse engeneering, quite heursitic (footer search, xor guessing etc)
#licence: public domain