Skip to content

Instantly share code, notes, and snippets.

Created August 25, 2015 18:37
What would you like to do?
mod_uid cookie to hex, python
import base64
import struct
import sys
def main():
Sample input: 'CtQF91SMxKx6nR1XWfrKAg=='
yields sample output: 'F705D40AACC48C54571D9D7A02CAFA59'
x = sys.argv[1]
cdec = base64.b64decode(x)
s = struct.unpack("<IIII",cdec)
uid = "%08X%08X%08X%08X" % s
print uid
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment