Skip to content

Instantly share code, notes, and snippets.

View ciwghuntress's full-sized avatar

Garret Huntress ciwghuntress

View GitHub Profile
@mprahl
mprahl / sid2str.py
Created October 30, 2016 01:53
Python 2.7/3.5 function to convert an Active Directory binary SID to string format (sid_to_str)
import sys
import struct
def sid_to_str(sid):
""" Converts a hexadecimal string returned from the LDAP query to a
string version of the SID in format of S-1-5-21-1270288957-3800934213-3019856503-500
This function was based from: http://www.gossamer-threads.com/lists/apache/bugs/386930
"""
# The revision level (typically 1)