Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@debedb
Created August 25, 2015 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debedb/6b02c2c3e3ef1f9ae627 to your computer and use it in GitHub Desktop.
Save debedb/6b02c2c3e3ef1f9ae627 to your computer and use it in GitHub Desktop.
mod_uid cookie to hex, python
import base64
import struct
import sys
def main():
"""
http://www.lexa.ru/programs/mod-uid-eng.html
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__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment