Skip to content

Instantly share code, notes, and snippets.

@aydynx
Last active September 3, 2024 20:50
Show Gist options
  • Save aydynx/5d29e903417354fd25641b98efc9d437 to your computer and use it in GitHub Desktop.
Save aydynx/5d29e903417354fd25641b98efc9d437 to your computer and use it in GitHub Desktop.
discord stuff

tokens

all scripts written by me
they should continue working until the next webpack update

obtaining your token

v1:

webpackChunkdiscord_app.push([[0],,e=>Object.keys(e.c).find(d=>(t=e(d)?.default?.getToken?.())&&console.log(t))])

v2:

t="extra_id";w=webpackJsonp.push([[],{[t]:(x,y,z)=>x.exports=z},[[t]]]);Object.keys(w.c).find(e=>t=w(e)?.default?.getToken?.());t
version v1 v2
size 113 129
desktop
browser
console
injectable
uses per restart 1

logging in using tokens

v1:

t="";webpackChunkdiscord_app.push([[0],,e=>Object.keys(e.c).find(x=>e(x)?.default?.setToken?.(t))]);this.location.reload()

v2:

t="";i="extra_id";w=webpackJsonp.push([[],{[i]:(x,y,z)=>x.exports=z},[[i]]]);Object.keys(w.c).find(x=>w(x)?.default?.setToken?.(t));this.location.reload()
version v1 v2
size 123 155
desktop
browser
console
injectable

for both versions just paste your token in t

token structure

v1:

/([\w-]{24}\.[\w-]{6}\.[\w-]{27}|mfa\.[\w-]{84})/g

v2:

/[a-z\d]{24}\.[a-z\d]{6}\.([\w-]{107}|[\w-]{38}|[\w-]{27})|mfa\.[\w-]{84}/gi
version v1 v2
steps 5470 785
desktop
browser
2fa
bots

*steps were tested using https://regex101.com/, and only represents the speed to match 100 randomly generated tokens
the table shows what tokens will match depending on which client generated the token
for these example functions, you can put the respective value inside of the quotes
the first part of the token is the user id encoded in base64

btoa("")

the second part is the first 6 digits of the current epoch - 1293840000 encoded in hex then to base64
v1:

b="";new Date((("0x"+[...atob(b)].map(c=>c.charCodeAt().toString(16)).join``>>>0)+1293840000)*1000)

v2:

b="";new Date((parseInt(Buffer.from(b,"base64").toString("hex"),16)+1293840000)*1000)
version v1 v2
node
browser

the last part is a cryptographic hmac, there is no way to obtain this as it is interal to discord

misc

get friend invite link:

(async()=>{i=0;webpackChunkdiscord_app.push([[0],,e=>Object.values(e.c).find(d=>i=d?.exports?.default?.createFriendInvite)]);console.log(`https://discord.gg/${(await i()).code}`)})()

bypass nsfw:

webpackChunkdiscord_app.push([[0],,e=>Object.keys(e.c).find(x=>x?.exports?.default?.getCurrentUser?.().nsfwAllowed=1)]);

credit/license

mit license
please give credit if you use any of these in your code

@xhvn
Copy link

xhvn commented Feb 26, 2023

Hi I am not very experience with JavaScript but I was wondering is their any way to send the token to a webhook?

@DinoscapeProgramming
Copy link

Hi I am not very experience with JavaScript but I was wondering is their any way to send the token to a webhook?

So basically you're trying to be a hacker?

@CodeByAidan
Copy link

Hi I am not very experience with JavaScript but I was wondering is their any way to send the token to a webhook?

So basically you're trying to be a hacker?

holy shit mate shut up man, this is github, not reddit

@AFRIENDLYHACKER
Copy link

Hi I am not very experience with JavaScript but I was wondering is their any way to send the token to a webhook?

ye thats easy lmfao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment