From Little Cheetah, 5 Days ago, written in Python.
This paste will shuffle off the mortal coil in 1 Day.
Embed
  1. import binascii
  2. import sys
  3. from operator import xor
  4. from itertools import cycle, izip
  5. from time import sleep
  6. import signal
  7.  
  8.  
  9.  
  10. # Print the current line on when terminated via ctrl-c
  11.  
  12. def signal_handler(signal, frame):
  13.     print 'Stopped at line: ' + str(currentLine)
  14.     sys.exit(0)
  15. signal.signal(signal.SIGINT, signal_handler)
  16.  
  17.  
  18.  
  19. # Encrypting and decrypting functions
  20.  
  21. def makeList(stringVal):
  22.     list = []
  23.     for c in stringVal:
  24.         list.append(c)
  25.     return list
  26.  
  27. def superCrypt(stringVal,keyVal):
  28.     keyPos = 0
  29.     key = makeList(keyVal)
  30.     xored = []
  31.     for c in stringVal:
  32.         xored.append(binascii.hexlify(chr(ord(c) ^ ord(keyVal[keyPos]))))
  33.         if keyPos == len(key) - 1:
  34.             keyPos = 0
  35.         else:
  36.             keyPos += 1
  37.     hexVal = ''
  38.     for n in xored:
  39.         hexVal += n
  40.     return hexVal
  41.  
  42.  
  43. def superDeCrypt(stringVal,keyVal):
  44.     cypher = binascii.hexlify(stringVal)
  45.     xored = '-'.join(cypher[i:i+2] for i in range(0, len(cypher), 2))
  46.  
  47.     print ""
  48.     print "The xored string:"
  49.     print xored
  50.     print ""
  51.  
  52.     f = open(str(sys.argv[1]), "rb")
  53.     keyPos = 0
  54.     decrypted = ""
  55.    
  56.     try:
  57.         byte = f.read(1)
  58.         while byte != "":
  59.             xbyte = ord(byte) ^ ord(key[keyPos])
  60.             if keyPos == len(key) - 1:
  61.                 keyPos = 0
  62.             else:
  63.                 keyPos += 1
  64.             decrypted += chr(xbyte)
  65.             byte = f.read(1)
  66.     finally:
  67.         print decrypted
  68.         return decrypted
  69.        
  70.  
  71.  
  72.  
  73.  
  74. # GLOBAL VARS
  75. delay = 5
  76. wordlist = '/root/rockyou.txt'
  77. startAt = 0
  78. count = 0
  79. maxEmptyCount = 80000
  80. currentLine = 0
  81. g = open(sys.argv[1], "r")
  82. g = g.read()
  83.  
  84. # END VARS
  85.  
  86.  
  87.  
  88. # Wordlist loop while decrypting
  89.  
  90. with open(wordlist, "r") as f:
  91.     key = f.readline().strip('\n')
  92.     if startAt > 0:
  93.         print "Skipping: " + str(startAt)
  94.         while count < startAt:
  95.             key = f.readline().rstrip('\n')
  96.             count += 1
  97.     while key:
  98.         currentLine += 1
  99.         emptyCount = 0
  100.         print key
  101.         decoded = superDeCrypt(g, key)
  102.         if "JET{" in decoded:
  103.             print "*"*72
  104.             print "*"*20 + "    WE FOUND THE FUCKING KEY    " + "*"*20
  105.             print "*"*72
  106.             print "*"*20 + "    The key is: " + key + "     " + "*"*25
  107.             print "*"*20 + "    At line" + str(currentLine) + "       " + "*"*30
  108.             sys.exit(0)
  109.         key = f.readline().rstrip('\n')
  110.         while not key:
  111.             emptyCount += 1
  112.             if emptyCount > maxEmptyCount:
  113.                 sys.exit(0)
  114.             key = f.readline().rstrip('\n')
  115.         sleep(delay / 1000.0)
  116.  
  117.  
  118.  
  119.