#!/usr/bin/env python # OpenRG (http://www.jungo.com/openrg/pr_openrg.html) password deobfuscator # # Credits # ~~~~~~~ # thanks to Zibri (http://www.zibri.org/2009/11/obfuscation-will-never-work.html) # # Contact # ~~~~~~~ # cygeus at gmail dot com # # Changelog # ~~~~~~~~~ # version 0.1 # - initial release import re import sys def deobfuscate(enc): key = [86, -12, -17, 80, 52, 169, -17, 107, 85, 75, 3, 60, 154, 1, 120, 179, -3, 177, 61, 211, 155, 210, 203, 159, 6, 209, 209, 101, -24, 189, 45, 159, 177, -17, 141, 216, -12, -4, 187, 195, 184, 161, 11, 174, 61, 193, 46, 174, -29, 84, 7, -15, 10, 90, 208, 138, 120, 4, 6, 50, 134, 44, 172, -14] index = [0] def decode(m): text = m.group(0) # character reference if text[:1] == "&": value = int(text[1:-1], 16) # character else: value = ord(text[:1]) zib = value - key[index[0]] if zib < 0: zib = zib + 255 index[0] = index[0] + 1 return chr(zib); return re.sub("&\w+;|[^&]", decode, enc) def usage(): print "Usage: decrypt.py " if __name__ == "__main__": if len(sys.argv) != 2: usage() else: print deobfuscate(sys.argv[1])