Created
November 4, 2013 15:06
-
-
Save MatthewWilkes/7303862 to your computer and use it in GitHub Desktop.
Generate a plone.session cookie for an arbitrary user, given access to the server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import binascii | |
session = app.site.acl_users.session | |
while True: | |
username = raw_input("User ID: ") | |
if not username: | |
break | |
if app.site.acl_users.getUserById(username) is None: | |
print "User not found" | |
continue | |
ticket = session.source.createIdentifier(username) | |
cookie = binascii.b2a_base64(ticket).rstrip() | |
print "document.cookie = '%s=%s'" % (session.cookie_name, cookie) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I love you for this.