@yognky/premium-security 1.0.0 → 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.d.ts +6 -2
- package/dist/index.js +44 -39
- package/package.json +1 -1
- package/src/index.ts +52 -45
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { Express } from 'express';
|
|
2
|
+
declare function Premium(app: Express): void;
|
|
2
3
|
declare function start(port?: number): Promise<import("express-serve-static-core").Express>;
|
|
3
|
-
|
|
4
|
+
declare function use(app: Express): void;
|
|
5
|
+
export { start, use, Premium };
|
|
4
6
|
declare const _default: {
|
|
5
7
|
start: typeof start;
|
|
8
|
+
use: typeof use;
|
|
9
|
+
Premium: typeof Premium;
|
|
6
10
|
};
|
|
7
11
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -3,14 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PREMIUM_VERSION = void 0;
|
|
7
6
|
exports.start = start;
|
|
7
|
+
exports.use = use;
|
|
8
|
+
exports.Premium = Premium;
|
|
8
9
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
10
|
const readline_1 = __importDefault(require("readline"));
|
|
10
11
|
const express_1 = __importDefault(require("express"));
|
|
11
|
-
const PREMIUM_VERSION = '1.0.0';
|
|
12
|
-
exports.PREMIUM_VERSION = PREMIUM_VERSION;
|
|
13
|
-
const PREMIUM_PASSWORD = 'Yongkykiyotaka';
|
|
14
12
|
const ddos_1 = require("./defenses/ddos");
|
|
15
13
|
const sqlInjection_1 = require("./defenses/sqlInjection");
|
|
16
14
|
const xss_1 = require("./defenses/xss");
|
|
@@ -22,16 +20,14 @@ const malware_1 = require("./defenses/malware");
|
|
|
22
20
|
const advanced_1 = require("./defenses/advanced");
|
|
23
21
|
const spoofing_1 = require("./defenses/spoofing");
|
|
24
22
|
const timingAttack_1 = require("./defenses/timingAttack");
|
|
25
|
-
|
|
23
|
+
const PREMIUM_PASSWORD = 'Yongkykiyotaka';
|
|
24
|
+
const VERSION = '1.0.1';
|
|
25
|
+
function showBanner() {
|
|
26
26
|
console.log('\n');
|
|
27
|
-
console.log(chalk_1.default.yellow('
|
|
28
|
-
console.log(chalk_1.default.yellow('║
|
|
29
|
-
console.log(chalk_1.default.green
|
|
30
|
-
console.log(chalk_1.default.
|
|
31
|
-
console.log(chalk_1.default.white(`\n 👑 Creator : ${chalk_1.default.green('YOGNKY')}`));
|
|
32
|
-
console.log(chalk_1.default.white(` 💎 Version : ${chalk_1.default.green(PREMIUM_VERSION)}`));
|
|
33
|
-
console.log(chalk_1.default.white(` 🔐 Security : ${chalk_1.default.green('PASSWORD PROTECTED')}`));
|
|
34
|
-
console.log(chalk_1.default.red('\n╚════════════════════════════════════════════════════════════════╝\n'));
|
|
27
|
+
console.log(chalk_1.default.yellow('╔══════════════════════════════════════════════════════════╗'));
|
|
28
|
+
console.log(chalk_1.default.yellow('║ 💎 PREMIUM SECURITY 💎 ║'));
|
|
29
|
+
console.log(chalk_1.default.green(`║ 12 DEFENSES ACTIVE | v${VERSION} ║`));
|
|
30
|
+
console.log(chalk_1.default.yellow('╚══════════════════════════════════════════════════════════╝\n'));
|
|
35
31
|
}
|
|
36
32
|
function askPassword() {
|
|
37
33
|
const rl = readline_1.default.createInterface({
|
|
@@ -39,60 +35,69 @@ function askPassword() {
|
|
|
39
35
|
output: process.stdout
|
|
40
36
|
});
|
|
41
37
|
return new Promise((resolve) => {
|
|
42
|
-
|
|
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) => {
|
|
43
41
|
rl.close();
|
|
44
42
|
resolve(answer);
|
|
45
43
|
});
|
|
46
44
|
});
|
|
47
45
|
}
|
|
48
|
-
function
|
|
49
|
-
console.log(chalk_1.default.cyan('⚙️
|
|
46
|
+
function Premium(app) {
|
|
47
|
+
console.log(chalk_1.default.cyan('\n⚙️ Memasang 12 Defense Premium...\n'));
|
|
50
48
|
app.use(express_1.default.json());
|
|
51
49
|
app.use(express_1.default.urlencoded({ extended: true }));
|
|
52
50
|
app.use((0, ddos_1.ddosProtection)({ maxPerMinute: 100, blockDuration: 60 }));
|
|
53
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
51
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Anti DDoS');
|
|
54
52
|
app.use(sqlInjection_1.sqlInjectionProtection);
|
|
55
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
53
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Anti SQL Injection');
|
|
56
54
|
app.use(xss_1.xssProtection);
|
|
57
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
55
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Anti XSS');
|
|
58
56
|
app.use(curlBot_1.curlBotProtection);
|
|
59
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
57
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Anti Bot/Curl');
|
|
60
58
|
app.use(headers_1.headerProtection);
|
|
61
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
59
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Anti Malicious Headers');
|
|
62
60
|
app.use(bruteforce_1.bruteforceProtection);
|
|
63
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
61
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Anti Brute Force');
|
|
64
62
|
app.use((0, rateLimit_1.rateLimitProtection)({ windowMs: 60000, maxRequests: 100 }));
|
|
65
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
63
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Rate Limiter');
|
|
66
64
|
app.use(malware_1.malwareProtection);
|
|
67
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
65
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Anti Malware');
|
|
66
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Whitelist Ready');
|
|
68
67
|
app.use(advanced_1.advancedProtection);
|
|
69
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
68
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Advanced Protection');
|
|
70
69
|
app.use(spoofing_1.antiSpoofing);
|
|
71
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
70
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Anti IP Spoofing');
|
|
72
71
|
app.use(timingAttack_1.antiTimingAttack);
|
|
73
|
-
console.log(chalk_1.default.green(' ✓ ') +
|
|
72
|
+
console.log(chalk_1.default.green(' ✓ ') + 'Anti Timing Attack');
|
|
74
73
|
app.get('/', (req, res) => {
|
|
75
74
|
res.json({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
status: 'Premium Security Active',
|
|
76
|
+
defenses: '12 Layers',
|
|
77
|
+
version: VERSION
|
|
79
78
|
});
|
|
80
79
|
});
|
|
81
|
-
console.log(chalk_1.default.
|
|
80
|
+
console.log(chalk_1.default.green('\n✨ PREMIUM 12 DEFENSES READY! ✨\n'));
|
|
82
81
|
}
|
|
83
82
|
async function start(port = 3000) {
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
console.log(chalk_1.default.red('\n❌
|
|
83
|
+
showBanner();
|
|
84
|
+
const pass = await askPassword();
|
|
85
|
+
if (pass !== PREMIUM_PASSWORD) {
|
|
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'));
|
|
88
88
|
process.exit(1);
|
|
89
89
|
}
|
|
90
|
-
console.log(chalk_1.default.green('\n✅ PREMIUM
|
|
90
|
+
console.log(chalk_1.default.green('\n✅ PREMIUM VERIFIED! License valid!\n'));
|
|
91
91
|
const app = (0, express_1.default)();
|
|
92
|
-
|
|
92
|
+
Premium(app);
|
|
93
93
|
app.listen(port, () => {
|
|
94
|
-
console.log(chalk_1.default.green(`✅ Premium server running on http://localhost:${port}
|
|
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`));
|
|
95
97
|
});
|
|
96
98
|
return app;
|
|
97
99
|
}
|
|
98
|
-
|
|
100
|
+
function use(app) {
|
|
101
|
+
return Premium(app);
|
|
102
|
+
}
|
|
103
|
+
exports.default = { start, use, Premium };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { Express, Request, Response, NextFunction } from 'express';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import figlet from 'figlet';
|
|
4
|
-
import gradient from 'gradient-string';
|
|
5
3
|
import readline from 'readline';
|
|
6
|
-
import express from 'express';
|
|
4
|
+
import express from 'express';
|
|
7
5
|
|
|
8
|
-
// ========== PREMIUM
|
|
9
|
-
const PREMIUM_VERSION = '1.0.0';
|
|
10
|
-
const PREMIUM_PASSWORD = 'Yongkykiyotaka';
|
|
11
|
-
|
|
12
|
-
// ========== PREMIUM DEFENSES ==========
|
|
6
|
+
// ========== 12 DEFENSES PREMIUM ==========
|
|
13
7
|
import { ddosProtection } from './defenses/ddos';
|
|
14
8
|
import { sqlInjectionProtection } from './defenses/sqlInjection';
|
|
15
9
|
import { xssProtection } from './defenses/xss';
|
|
@@ -23,16 +17,15 @@ import { advancedProtection } from './defenses/advanced';
|
|
|
23
17
|
import { antiSpoofing } from './defenses/spoofing';
|
|
24
18
|
import { antiTimingAttack } from './defenses/timingAttack';
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
const PREMIUM_PASSWORD = 'Yongkykiyotaka';
|
|
21
|
+
const VERSION = '1.0.1';
|
|
22
|
+
|
|
23
|
+
function showBanner() {
|
|
27
24
|
console.log('\n');
|
|
28
|
-
console.log(chalk.yellow('
|
|
29
|
-
console.log(chalk.yellow('║
|
|
30
|
-
console.log(chalk.green
|
|
31
|
-
console.log(chalk.
|
|
32
|
-
console.log(chalk.white(`\n 👑 Creator : ${chalk.green('YOGNKY')}`));
|
|
33
|
-
console.log(chalk.white(` 💎 Version : ${chalk.green(PREMIUM_VERSION)}`));
|
|
34
|
-
console.log(chalk.white(` 🔐 Security : ${chalk.green('PASSWORD PROTECTED')}`));
|
|
35
|
-
console.log(chalk.red('\n╚════════════════════════════════════════════════════════════════╝\n'));
|
|
25
|
+
console.log(chalk.yellow('╔══════════════════════════════════════════════════════════╗'));
|
|
26
|
+
console.log(chalk.yellow('║ 💎 PREMIUM SECURITY 💎 ║'));
|
|
27
|
+
console.log(chalk.green(`║ 12 DEFENSES ACTIVE | v${VERSION} ║`));
|
|
28
|
+
console.log(chalk.yellow('╚══════════════════════════════════════════════════════════╝\n'));
|
|
36
29
|
}
|
|
37
30
|
|
|
38
31
|
function askPassword(): Promise<string> {
|
|
@@ -42,84 +35,98 @@ function askPassword(): Promise<string> {
|
|
|
42
35
|
});
|
|
43
36
|
|
|
44
37
|
return new Promise((resolve) => {
|
|
45
|
-
|
|
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) => {
|
|
46
41
|
rl.close();
|
|
47
42
|
resolve(answer);
|
|
48
43
|
});
|
|
49
44
|
});
|
|
50
45
|
}
|
|
51
46
|
|
|
52
|
-
function
|
|
53
|
-
console.log(chalk.cyan('⚙️
|
|
47
|
+
function Premium(app: Express) {
|
|
48
|
+
console.log(chalk.cyan('\n⚙️ Memasang 12 Defense Premium...\n'));
|
|
54
49
|
|
|
55
50
|
app.use(express.json());
|
|
56
51
|
app.use(express.urlencoded({ extended: true }));
|
|
57
52
|
|
|
58
53
|
app.use(ddosProtection({ maxPerMinute: 100, blockDuration: 60 }));
|
|
59
|
-
console.log(chalk.green(' ✓ ') +
|
|
54
|
+
console.log(chalk.green(' ✓ ') + 'Anti DDoS');
|
|
60
55
|
|
|
61
56
|
app.use(sqlInjectionProtection);
|
|
62
|
-
console.log(chalk.green(' ✓ ') +
|
|
57
|
+
console.log(chalk.green(' ✓ ') + 'Anti SQL Injection');
|
|
63
58
|
|
|
64
59
|
app.use(xssProtection);
|
|
65
|
-
console.log(chalk.green(' ✓ ') +
|
|
60
|
+
console.log(chalk.green(' ✓ ') + 'Anti XSS');
|
|
66
61
|
|
|
67
62
|
app.use(curlBotProtection);
|
|
68
|
-
console.log(chalk.green(' ✓ ') +
|
|
63
|
+
console.log(chalk.green(' ✓ ') + 'Anti Bot/Curl');
|
|
69
64
|
|
|
70
65
|
app.use(headerProtection);
|
|
71
|
-
console.log(chalk.green(' ✓ ') +
|
|
66
|
+
console.log(chalk.green(' ✓ ') + 'Anti Malicious Headers');
|
|
72
67
|
|
|
73
68
|
app.use(bruteforceProtection);
|
|
74
|
-
console.log(chalk.green(' ✓ ') +
|
|
69
|
+
console.log(chalk.green(' ✓ ') + 'Anti Brute Force');
|
|
75
70
|
|
|
76
71
|
app.use(rateLimitProtection({ windowMs: 60000, maxRequests: 100 }));
|
|
77
|
-
console.log(chalk.green(' ✓ ') +
|
|
72
|
+
console.log(chalk.green(' ✓ ') + 'Rate Limiter');
|
|
78
73
|
|
|
79
74
|
app.use(malwareProtection);
|
|
80
|
-
console.log(chalk.green(' ✓ ') +
|
|
75
|
+
console.log(chalk.green(' ✓ ') + 'Anti Malware');
|
|
76
|
+
|
|
77
|
+
console.log(chalk.green(' ✓ ') + 'Whitelist Ready');
|
|
81
78
|
|
|
82
79
|
app.use(advancedProtection);
|
|
83
|
-
console.log(chalk.green(' ✓ ') +
|
|
80
|
+
console.log(chalk.green(' ✓ ') + 'Advanced Protection');
|
|
84
81
|
|
|
85
82
|
app.use(antiSpoofing);
|
|
86
|
-
console.log(chalk.green(' ✓ ') +
|
|
83
|
+
console.log(chalk.green(' ✓ ') + 'Anti IP Spoofing');
|
|
87
84
|
|
|
88
85
|
app.use(antiTimingAttack);
|
|
89
|
-
console.log(chalk.green(' ✓ ') +
|
|
86
|
+
console.log(chalk.green(' ✓ ') + 'Anti Timing Attack');
|
|
90
87
|
|
|
91
|
-
app.get('/', (req
|
|
88
|
+
app.get('/', (req, res) => {
|
|
92
89
|
res.json({
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
status: 'Premium Security Active',
|
|
91
|
+
defenses: '12 Layers',
|
|
92
|
+
version: VERSION
|
|
96
93
|
});
|
|
97
94
|
});
|
|
98
95
|
|
|
99
|
-
console.log(chalk.
|
|
96
|
+
console.log(chalk.green('\n✨ PREMIUM 12 DEFENSES READY! ✨\n'));
|
|
100
97
|
}
|
|
101
98
|
|
|
99
|
+
// ========== START FUNCTION ==========
|
|
102
100
|
async function start(port: number = 3000) {
|
|
103
|
-
|
|
101
|
+
showBanner();
|
|
104
102
|
|
|
105
|
-
const
|
|
103
|
+
const pass = await askPassword();
|
|
106
104
|
|
|
107
|
-
if (
|
|
108
|
-
console.log(chalk.red('\n❌
|
|
105
|
+
if (pass !== PREMIUM_PASSWORD) {
|
|
106
|
+
console.log(chalk.red('\n❌ PASSWORD SALAH! Akses ditolak!\n'));
|
|
107
|
+
console.log(chalk.gray(' Password premium: Yongkykiyotaka (case sensitive)\n'));
|
|
109
108
|
process.exit(1);
|
|
110
109
|
}
|
|
111
110
|
|
|
112
|
-
console.log(chalk.green('\n✅ PREMIUM
|
|
111
|
+
console.log(chalk.green('\n✅ PREMIUM VERIFIED! License valid!\n'));
|
|
113
112
|
|
|
114
113
|
const app = express();
|
|
115
|
-
|
|
114
|
+
Premium(app);
|
|
116
115
|
|
|
117
116
|
app.listen(port, () => {
|
|
118
|
-
console.log(chalk.green(`✅ Premium server running on http://localhost:${port}
|
|
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`));
|
|
119
120
|
});
|
|
120
121
|
|
|
121
122
|
return app;
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
// ========== USE FUNCTION ==========
|
|
126
|
+
function use(app: Express) {
|
|
127
|
+
return Premium(app);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// ========== EXPORT ==========
|
|
131
|
+
export { start, use, Premium };
|
|
132
|
+
export default { start, use, Premium };
|