Skip to content

Instantly share code, notes, and snippets.

@zorix
Last active October 4, 2017 22:06
Show Gist options
  • Select an option

  • Save zorix/810d1f568fdc65bfc90e02300bd25132 to your computer and use it in GitHub Desktop.

Select an option

Save zorix/810d1f568fdc65bfc90e02300bd25132 to your computer and use it in GitHub Desktop.
import urllib2 as ul
cookie = bytearray(ul.unquote('6VhhU05LYPoyhOCajJ9mZw%2BdSO1%2FAj4%3D').decode('base64'))
cookie[-6] ^= (ord('u') ^ ord('a'))
cookie[-5] ^= (ord('s') ^ ord('d'))
cookie[-4] ^= (ord('e') ^ ord('m'))
cookie[-3] ^= (ord('r') ^ ord('i'))
cookie[-2] ^= (ord('"') ^ ord('n'))
cookie[-1] ^= (ord('}') ^ ord('"'))
temp = bytearray(b'\xff')
temp[0] = ord(temp) ^ ord('Y') ^ ord('}')
cookie += temp
newCookie = ul.quote(bytes(cookie).encode('base64')[:-1])
print newCookie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment