Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Graphictoria Quick Banner
- import requests
- import pyotp
- import os
- import time
- cls = lambda: os.system('cls')
- from bs4 import BeautifulSoup
- x=int(input("ID:"))
- print("\n<Please enter your account credentials>\n")
- #account credentials
- user=""
- password=""
- #2fa "secret key"
- auth = pyotp.TOTP("")
- #newSession
- session = requests.Session()
- #login
- login = session.post("https://xdiscuss.net/core/func/api/auth/login.php", data={"username": user, "passwd": password, "csrf":" "})
- #get CSRF token
- twofactor = session.get("https://xdiscuss.net/account/verification/twostepauth")
- soup = BeautifulSoup(twofactor.text, "html.parser")
- token = soup.find("meta", {"name":"csrf-token"})
- #ban function
- #ban menu
- login2fa = session.post("https://xdiscuss.net/core/func/api/auth/twostep.php", data={"factorCode": auth.now(), "csrf": token["content"]})
- soup = BeautifulSoup(login2fa.text,"html.parser")
- if soup.find(text="success"):
- print("\n==Logged in as: {}".format(user) + "==")
- print("\n<Graphictoria Ban Menu>\n")
- while True:
- friends=session.get('https://xdiscuss.net/friends/show/' + str(x))
- soup = BeautifulSoup(friends.text, 'html.parser')
- if soup.find(text="""
- User not found"""):
- print("User not found")
- x += 1
- else:
- found = soup.find('h4', text=True).text
- #username = found.replace("'s", "")
- offender=username = found.split("'s")[0]
- x += 1
- ban = session.post("https://xdiscuss.net/core/func/api/admin/post/banUser.php", data={"csrf":token["content"], "username": offender, "banReason": "", "duration": "5"}) ## termination
- soup = BeautifulSoup(ban.text,'html.parser')
- if not soup.find(text='success'):
- print('\nError: {}'.format(soup))
- else:
- print("\nBanned {}".format(offender) + " [ID={}]".format(x))
- else:
- print("\nWrong account information.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement