@yognky/premium-security 1.0.1 → 1.0.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.
- package/dist/index.js +12 -7
- package/package.json +1 -1
- package/src/index.ts +16 -23
package/dist/index.js
CHANGED
|
@@ -23,7 +23,8 @@ const timingAttack_1 = require("./defenses/timingAttack");
|
|
|
23
23
|
const PREMIUM_PASSWORD = 'Yongkykiyotaka';
|
|
24
24
|
const VERSION = '1.0.1';
|
|
25
25
|
function showBanner() {
|
|
26
|
-
console.log(
|
|
26
|
+
console.log('\n');
|
|
27
|
+
console.log(chalk_1.default.yellow('╔══════════════════════════════════════════════════════════╗'));
|
|
27
28
|
console.log(chalk_1.default.yellow('║ 💎 PREMIUM SECURITY 💎 ║'));
|
|
28
29
|
console.log(chalk_1.default.green(`║ 12 DEFENSES ACTIVE | v${VERSION} ║`));
|
|
29
30
|
console.log(chalk_1.default.yellow('╚══════════════════════════════════════════════════════════╝\n'));
|
|
@@ -34,14 +35,16 @@ function askPassword() {
|
|
|
34
35
|
output: process.stdout
|
|
35
36
|
});
|
|
36
37
|
return new Promise((resolve) => {
|
|
37
|
-
|
|
38
|
+
console.log(chalk_1.default.cyan('\n🔐 MASUKKAN PASSWORD PREMIUM:'));
|
|
39
|
+
console.log(chalk_1.default.gray(' (Password tidak akan muncul saat diketik - ini normal!)\n'));
|
|
40
|
+
rl.question(chalk_1.default.yellow('👉 Password: '), (answer) => {
|
|
38
41
|
rl.close();
|
|
39
42
|
resolve(answer);
|
|
40
43
|
});
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
function Premium(app) {
|
|
44
|
-
console.log(chalk_1.default.cyan('⚙️ Memasang 12 Defense Premium...\n'));
|
|
47
|
+
console.log(chalk_1.default.cyan('\n⚙️ Memasang 12 Defense Premium...\n'));
|
|
45
48
|
app.use(express_1.default.json());
|
|
46
49
|
app.use(express_1.default.urlencoded({ extended: true }));
|
|
47
50
|
app.use((0, ddos_1.ddosProtection)({ maxPerMinute: 100, blockDuration: 60 }));
|
|
@@ -80,15 +83,17 @@ async function start(port = 3000) {
|
|
|
80
83
|
showBanner();
|
|
81
84
|
const pass = await askPassword();
|
|
82
85
|
if (pass !== PREMIUM_PASSWORD) {
|
|
83
|
-
console.log(chalk_1.default.red('\n❌ PASSWORD SALAH!\n'));
|
|
86
|
+
console.log(chalk_1.default.red('\n❌ PASSWORD SALAH! Akses ditolak!\n'));
|
|
87
|
+
console.log(chalk_1.default.gray(' Password premium: Yongkykiyotaka (case sensitive)\n'));
|
|
84
88
|
process.exit(1);
|
|
85
89
|
}
|
|
86
|
-
console.log(chalk_1.default.green('\n✅ PREMIUM VERIFIED!\n'));
|
|
90
|
+
console.log(chalk_1.default.green('\n✅ PREMIUM VERIFIED! License valid!\n'));
|
|
87
91
|
const app = (0, express_1.default)();
|
|
88
92
|
Premium(app);
|
|
89
93
|
app.listen(port, () => {
|
|
90
|
-
console.log(chalk_1.default.green(`✅
|
|
91
|
-
console.log(chalk_1.default.yellow(`🛡️ 12 Defenses Active
|
|
94
|
+
console.log(chalk_1.default.green(`✅ Premium server running on http://localhost:${port}`));
|
|
95
|
+
console.log(chalk_1.default.yellow(`🛡️ 12 Defenses Active!`));
|
|
96
|
+
console.log(chalk_1.default.gray(`💎 Premium Security by YOGNKY\n`));
|
|
92
97
|
});
|
|
93
98
|
return app;
|
|
94
99
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -21,7 +21,8 @@ const PREMIUM_PASSWORD = 'Yongkykiyotaka';
|
|
|
21
21
|
const VERSION = '1.0.1';
|
|
22
22
|
|
|
23
23
|
function showBanner() {
|
|
24
|
-
console.log(
|
|
24
|
+
console.log('\n');
|
|
25
|
+
console.log(chalk.yellow('╔══════════════════════════════════════════════════════════╗'));
|
|
25
26
|
console.log(chalk.yellow('║ 💎 PREMIUM SECURITY 💎 ║'));
|
|
26
27
|
console.log(chalk.green(`║ 12 DEFENSES ACTIVE | v${VERSION} ║`));
|
|
27
28
|
console.log(chalk.yellow('╚══════════════════════════════════════════════════════════╝\n'));
|
|
@@ -32,8 +33,11 @@ function askPassword(): Promise<string> {
|
|
|
32
33
|
input: process.stdin,
|
|
33
34
|
output: process.stdout
|
|
34
35
|
});
|
|
36
|
+
|
|
35
37
|
return new Promise((resolve) => {
|
|
36
|
-
|
|
38
|
+
console.log(chalk.cyan('\n🔐 MASUKKAN PASSWORD PREMIUM:'));
|
|
39
|
+
console.log(chalk.gray(' (Password tidak akan muncul saat diketik - ini normal!)\n'));
|
|
40
|
+
rl.question(chalk.yellow('👉 Password: '), (answer) => {
|
|
37
41
|
rl.close();
|
|
38
42
|
resolve(answer);
|
|
39
43
|
});
|
|
@@ -41,60 +45,46 @@ function askPassword(): Promise<string> {
|
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
function Premium(app: Express) {
|
|
44
|
-
console.log(chalk.cyan('⚙️ Memasang 12 Defense Premium...\n'));
|
|
48
|
+
console.log(chalk.cyan('\n⚙️ Memasang 12 Defense Premium...\n'));
|
|
45
49
|
|
|
46
|
-
// Auto middleware
|
|
47
50
|
app.use(express.json());
|
|
48
51
|
app.use(express.urlencoded({ extended: true }));
|
|
49
52
|
|
|
50
|
-
// 1. Anti DDoS
|
|
51
53
|
app.use(ddosProtection({ maxPerMinute: 100, blockDuration: 60 }));
|
|
52
54
|
console.log(chalk.green(' ✓ ') + 'Anti DDoS');
|
|
53
55
|
|
|
54
|
-
// 2. Anti SQL Injection
|
|
55
56
|
app.use(sqlInjectionProtection);
|
|
56
57
|
console.log(chalk.green(' ✓ ') + 'Anti SQL Injection');
|
|
57
58
|
|
|
58
|
-
// 3. Anti XSS
|
|
59
59
|
app.use(xssProtection);
|
|
60
60
|
console.log(chalk.green(' ✓ ') + 'Anti XSS');
|
|
61
61
|
|
|
62
|
-
// 4. Anti Bot
|
|
63
62
|
app.use(curlBotProtection);
|
|
64
63
|
console.log(chalk.green(' ✓ ') + 'Anti Bot/Curl');
|
|
65
64
|
|
|
66
|
-
// 5. Anti Headers
|
|
67
65
|
app.use(headerProtection);
|
|
68
66
|
console.log(chalk.green(' ✓ ') + 'Anti Malicious Headers');
|
|
69
67
|
|
|
70
|
-
// 6. Anti Brute Force
|
|
71
68
|
app.use(bruteforceProtection);
|
|
72
69
|
console.log(chalk.green(' ✓ ') + 'Anti Brute Force');
|
|
73
70
|
|
|
74
|
-
// 7. Rate Limiter
|
|
75
71
|
app.use(rateLimitProtection({ windowMs: 60000, maxRequests: 100 }));
|
|
76
72
|
console.log(chalk.green(' ✓ ') + 'Rate Limiter');
|
|
77
73
|
|
|
78
|
-
// 8. Anti Malware
|
|
79
74
|
app.use(malwareProtection);
|
|
80
75
|
console.log(chalk.green(' ✓ ') + 'Anti Malware');
|
|
81
76
|
|
|
82
|
-
// 9. Whitelist (opsional)
|
|
83
77
|
console.log(chalk.green(' ✓ ') + 'Whitelist Ready');
|
|
84
78
|
|
|
85
|
-
// 10. Advanced Protection
|
|
86
79
|
app.use(advancedProtection);
|
|
87
80
|
console.log(chalk.green(' ✓ ') + 'Advanced Protection');
|
|
88
81
|
|
|
89
|
-
// 11. Anti Spoofing
|
|
90
82
|
app.use(antiSpoofing);
|
|
91
83
|
console.log(chalk.green(' ✓ ') + 'Anti IP Spoofing');
|
|
92
84
|
|
|
93
|
-
// 12. Anti Timing Attack
|
|
94
85
|
app.use(antiTimingAttack);
|
|
95
86
|
console.log(chalk.green(' ✓ ') + 'Anti Timing Attack');
|
|
96
87
|
|
|
97
|
-
// Default route (optional, bisa ditimpa)
|
|
98
88
|
app.get('/', (req, res) => {
|
|
99
89
|
res.json({
|
|
100
90
|
status: 'Premium Security Active',
|
|
@@ -106,30 +96,33 @@ function Premium(app: Express) {
|
|
|
106
96
|
console.log(chalk.green('\n✨ PREMIUM 12 DEFENSES READY! ✨\n'));
|
|
107
97
|
}
|
|
108
98
|
|
|
109
|
-
// ==========
|
|
99
|
+
// ========== START FUNCTION ==========
|
|
110
100
|
async function start(port: number = 3000) {
|
|
111
101
|
showBanner();
|
|
112
102
|
|
|
113
103
|
const pass = await askPassword();
|
|
104
|
+
|
|
114
105
|
if (pass !== PREMIUM_PASSWORD) {
|
|
115
|
-
console.log(chalk.red('\n❌ PASSWORD SALAH!\n'));
|
|
106
|
+
console.log(chalk.red('\n❌ PASSWORD SALAH! Akses ditolak!\n'));
|
|
107
|
+
console.log(chalk.gray(' Password premium: Yongkykiyotaka (case sensitive)\n'));
|
|
116
108
|
process.exit(1);
|
|
117
109
|
}
|
|
118
110
|
|
|
119
|
-
console.log(chalk.green('\n✅ PREMIUM VERIFIED!\n'));
|
|
111
|
+
console.log(chalk.green('\n✅ PREMIUM VERIFIED! License valid!\n'));
|
|
120
112
|
|
|
121
113
|
const app = express();
|
|
122
114
|
Premium(app);
|
|
123
115
|
|
|
124
116
|
app.listen(port, () => {
|
|
125
|
-
console.log(chalk.green(`✅
|
|
126
|
-
console.log(chalk.yellow(`🛡️ 12 Defenses Active
|
|
117
|
+
console.log(chalk.green(`✅ Premium server running on http://localhost:${port}`));
|
|
118
|
+
console.log(chalk.yellow(`🛡️ 12 Defenses Active!`));
|
|
119
|
+
console.log(chalk.gray(`💎 Premium Security by YOGNKY\n`));
|
|
127
120
|
});
|
|
128
121
|
|
|
129
122
|
return app;
|
|
130
123
|
}
|
|
131
124
|
|
|
132
|
-
// ==========
|
|
125
|
+
// ========== USE FUNCTION ==========
|
|
133
126
|
function use(app: Express) {
|
|
134
127
|
return Premium(app);
|
|
135
128
|
}
|