-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
1365 lines (1196 loc) · 44.7 KB
/
server.js
File metadata and controls
1365 lines (1196 loc) · 44.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
const express = require('express');
const cors = require('cors');
const axios = require('axios');
const fs = require('fs');
const crypto = require('crypto');
const app = express();
// ============================================
// SECURITY: Rate Limiting Manual
// ============================================
const rateLimitStore = {};
const blockedIPs = {};
const RATE_LIMIT_WINDOW = 60 * 1000; // 1 menit
const RATE_LIMIT_MAX_REQUESTS = 30;
const BLOCK_DURATION = 5 * 60 * 1000; // 5 menit block
function getRealIP(req) {
return req.headers['x-forwarded-for']?.split(',')[0]?.trim() ||
req.headers['x-real-ip'] ||
req.connection?.remoteAddress ||
req.ip ||
'unknown';
}
function rateLimiter(req, res, next) {
const ip = getRealIP(req);
const now = Date.now();
// Cek apakah IP diblokir
if (blockedIPs[ip] && blockedIPs[ip] > now) {
const remainingTime = Math.ceil((blockedIPs[ip] - now) / 1000);
return res.status(429).json({
error: "Too many requests",
blocked: true,
retryAfter: remainingTime
});
} else if (blockedIPs[ip]) {
delete blockedIPs[ip];
}
// Inisialisasi atau reset window
if (!rateLimitStore[ip] || rateLimitStore[ip].resetTime < now) {
rateLimitStore[ip] = {
count: 1,
resetTime: now + RATE_LIMIT_WINDOW
};
} else {
rateLimitStore[ip].count++;
}
// Cek limit
if (rateLimitStore[ip].count > RATE_LIMIT_MAX_REQUESTS) {
blockedIPs[ip] = now + BLOCK_DURATION;
console.log(`[BLOCKED] IP ${ip} - Too many requests`);
return res.status(429).json({
error: "Rate limit exceeded",
blocked: true,
retryAfter: Math.ceil(BLOCK_DURATION / 1000)
});
}
next();
}
// ============================================
// SECURITY: CORS Configuration
// ============================================
const corsOptions = {
origin: '*',
methods: ['GET', 'POST'],
allowedHeaders: ['Content-Type', 'UH-Executor', 'UH-Version', 'X-Executor', 'Authorization'],
maxAge: 86400
};
app.use(cors(corsOptions));
app.use(express.json({ limit: '10kb' })); // Limit body size
app.use(rateLimiter);
// ============================================
// SECURITY: Security Headers Middleware
// ============================================
app.use((req, res, next) => {
res.setHeader('X-Content-Type-Options', 'nosniff');
res.setHeader('X-Frame-Options', 'DENY');
res.setHeader('X-XSS-Protection', '1; mode=block');
res.setHeader('Referrer-Policy', 'no-referrer');
res.removeHeader('X-Powered-By');
next();
});
// ============================================
// DATABASE: Persistent File-Based
// ============================================
const DB_FILE = './keyDatabase.json';
const ADMIN_SECRET = process.env.ADMIN_SECRET || crypto.randomBytes(32).toString('hex');
let keyDatabase = {};
function loadDatabase() {
try {
if (fs.existsSync(DB_FILE)) {
const data = fs.readFileSync(DB_FILE, 'utf8');
keyDatabase = JSON.parse(data);
console.log(`[DB] Loaded ${Object.keys(keyDatabase).length} keys`);
}
} catch (error) {
console.error('[DB] Error loading database:', error.message);
keyDatabase = {};
}
}
function saveDatabase() {
try {
fs.writeFileSync(DB_FILE, JSON.stringify(keyDatabase, null, 2));
} catch (error) {
console.error('[DB] Error saving database:', error.message);
}
}
// Auto-save setiap 5 menit
setInterval(saveDatabase, 5 * 60 * 1000);
// Load database saat startup
loadDatabase();
// Save saat shutdown
process.on('SIGINT', () => {
console.log('[DB] Saving database before shutdown...');
saveDatabase();
process.exit(0);
});
process.on('SIGTERM', () => {
console.log('[DB] Saving database before shutdown...');
saveDatabase();
process.exit(0);
});
// Work.ink API
const WORKINK_API = "https://work.ink/_api/v2/token/isValid/";
// ============================================
// SECURITY: Input Validation & Sanitization
// ============================================
function sanitizeString(str, maxLength = 100) {
if (typeof str !== 'string') return '';
return str.replace(/[<>\"'&]/g, '').substring(0, maxLength).trim();
}
function validateKey(key) {
if (!key || typeof key !== 'string') return false;
if (key.length < 5 || key.length > 100) return false;
// Hanya izinkan alphanumeric dan beberapa karakter khusus
return /^[a-zA-Z0-9\-_]+$/.test(key);
}
function validateHWID(hwid) {
if (!hwid || typeof hwid !== 'string') return false;
if (hwid.length < 5 || hwid.length > 200) return false;
return true;
}
function hashKey(key) {
return crypto.createHash('sha256').update(key).digest('hex').substring(0, 16);
}
// ============================================
// HTML PAGE: Not Authorized (Premium Style)
// Width: 163.7mm, No shadow on ⛔ icon
// ============================================
const NOT_AUTHORIZED_HTML = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Not Authorized</title>
<style>
* {
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
html {
background: #000000;
min-height: 100%;
}
body {
margin: 0;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: radial-gradient(circle at top, #141414 0%, #080808 45%, #000000 100%);
color: #ffffff;
overflow-x: hidden;
}
body::before {
content: "";
position: fixed;
inset: 0;
background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.04), transparent 70%);
animation: sweep 9s linear infinite;
pointer-events: none;
}
body::after {
content: "";
position: fixed;
inset: 0;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
pointer-events: none;
}
@keyframes sweep {
from { transform: translateX(-100%); }
to { transform: translateX(100%); }
}
.container {
position: relative;
text-align: center;
padding: 30px 24px;
width: 163.7mm;
max-width: 163.7mm;
}
.title {
font-size: 26px;
font-weight: 600;
margin-bottom: 18px;
color: #ff4b4b;
}
.title .icon {
margin: 0 6px;
text-shadow: none;
}
.title .text {
text-shadow: 0 6px 24px rgba(255,0,0,0.35);
}
.message {
font-size: 22px;
font-weight: 600;
line-height: 1.45;
margin-bottom: 14px;
text-shadow: 0 6px 26px rgba(0,0,0,0.75);
}
.sub {
font-size: 15px;
color: rgba(255,255,255,0.72);
letter-spacing: 0.2px;
}
</style>
<script>
document.addEventListener('contextmenu', e => e.preventDefault());
document.addEventListener('keydown', function(e) {
if (e.ctrlKey && (e.key === 'u' || e.key === 's' || e.key === 'p')) e.preventDefault();
if (e.key === 'F12') e.preventDefault();
});
// Anti-devtools
(function() {
const threshold = 160;
setInterval(function() {
if (window.outerWidth - window.innerWidth > threshold ||
window.outerHeight - window.innerHeight > threshold) {
document.body.innerHTML = '';
}
}, 1000);
})();
</script>
</head>
<body>
<div class="container">
<div class="title"><span class="icon">⛔</span><span class="text">Not Authorized</span><span class="icon">⛔</span></div>
<div class="message">You are not allowed to view these files.</div>
<div class="sub">Close this page & proceed.</div>
</div>
</body>
</html>`;
// ============================================
// SCRIPT LUA (Protected) - WITH CUSTOM HEADER
// ============================================
const PROTECTED_LOADER_SCRIPT = `
if getgenv().UHLoaded then
pcall(function() getgenv().UH:Destroy() end)
pcall(function() game:GetService("CoreGui"):FindFirstChild("UltimateHubKeySystem"):Destroy() end)
pcall(function() game:GetService("CoreGui"):FindFirstChild("Rayfield"):Destroy() end)
getgenv().UH, getgenv().UHCore, getgenv().UHLoaded = nil, nil, nil
task.wait(0.3)
end
getgenv().UHLoaded = true
local CFG = {
RailwayURL = "https://lua-protector-production.up.railway.app",
ValidationURL = "https://lua-protector-production.up.railway.app/api/validate",
CheckKeyURL = "https://lua-protector-production.up.railway.app/api/check",
BindKeyURL = "https://lua-protector-production.up.railway.app/api/bind",
GetKeyLink = "https://work.ink/29pu/key-sistem-3",
CU = "https://raw.githubusercontent.com/trianaq765-cmd/lootlabs-keysystem-/refs/heads/main/Protected_2260249086296060.lua%20(1).txt",
SV = true,
KF = "UltimateHubKey.txt",
UF = "UltimateHubUser.txt",
MA = 5,
CT = 60,
OneKeyOneUser = true
}
local CA, LAT = 0, 0
local HS = game:GetService("HttpService")
local TS = game:GetService("TweenService")
local PL = game:GetService("Players")
local CG = game:GetService("CoreGui")
local SG = game:GetService("StarterGui")
local LP = PL.LocalPlayer
local function SF(f, c)
if writefile then
pcall(writefile, f, c)
end
end
local function RF(f)
if isfile and readfile then
local s, r = pcall(function()
if isfile(f) then
return readfile(f)
end
return nil
end)
if s then
return r
end
end
return nil
end
local function DF(f)
if isfile and delfile then
pcall(function()
if isfile(f) then
delfile(f)
end
end)
end
end
local function SC(t)
if setclipboard then
pcall(setclipboard, t)
end
end
local function GetUserIdentifier()
local hwid
local hwidFuncs = {
function() return gethwid and gethwid() end,
function() return getexecutorhwid and getexecutorhwid() end,
function() return syn and syn.cache_hwid and syn.cache_hwid() end,
function() return fluxus and fluxus.get_hwid and fluxus.get_hwid() end,
function() return get_hwid and get_hwid() end,
function() return HWID and HWID() end,
function() return getexecutorname and getexecutorname() .. "_" .. LP.UserId end
}
for _, func in ipairs(hwidFuncs) do
local s, r = pcall(func)
if s and r and r ~= "" then
hwid = tostring(r)
break
end
end
if hwid then
return hwid .. "_" .. LP.UserId
else
return "NOHWID_" .. LP.UserId .. "_" .. LP.Name
end
end
local function IsServerConfigured()
return CFG.RailwayURL ~= "" and CFG.RailwayURL ~= nil
end
local function DoRequest(url, method, headers, body)
headers = headers or {}
headers["UH-Executor"] = "true"
headers["UH-Version"] = "9.2"
local rf = (syn and syn.request) or request or http_request or (fluxus and fluxus.request) or (delta and delta.request)
if rf then
local s, r = pcall(function()
return rf({Url = url, Method = method or "GET", Headers = headers, Body = body})
end)
if s and r then
return r
end
end
if method == "GET" or not method then
local s, r = pcall(function()
return game:HttpGet(url)
end)
if s then
return {Body = r, StatusCode = 200}
end
end
return nil
end
local function CheckKeyBinding(key, uid)
if not IsServerConfigured() then
return true, "no_server", nil
end
local r = DoRequest(CFG.CheckKeyURL, "POST", {
["Content-Type"] = "application/json"
}, HS:JSONEncode({
key = key,
hwid = uid,
userId = LP.UserId,
userName = LP.Name
}))
if r and r.Body then
local s, data = pcall(function()
return HS:JSONDecode(r.Body)
end)
if s and data then
if data.status == "verified" then
return true, "verified", data
elseif data.status == "bound_other" then
return false, "bound_other", data
elseif data.status == "new" then
return true, "new", nil
end
end
end
return true, "no_server", nil
end
local function BindKeyToUser(key, uid)
if not IsServerConfigured() then
return true
end
local r = DoRequest(CFG.BindKeyURL, "POST", {
["Content-Type"] = "application/json"
}, HS:JSONEncode({
key = key,
hwid = uid,
userId = LP.UserId,
userName = LP.Name,
boundAt = os.time(),
boundDate = os.date("%Y-%m-%d %H:%M:%S")
}))
return r and (r.StatusCode == 200 or r.StatusCode == 201)
end
local function OU(u)
if not u or u == "" then
return false
end
local urlFuncs = {"openurl", "OpenURL", "open_url", "browseurl", "BrowseURL", "browse_url"}
for _, n in ipairs(urlFuncs) do
local f = getgenv()[n] or getfenv()[n] or _G[n]
if f and type(f) == "function" and pcall(f, u) then
return true
end
end
pcall(function()
if syn and syn.open_browser then
syn.open_browser(u)
end
end)
pcall(function()
if fluxus and fluxus.open_browser then
fluxus.open_browser(u)
end
end)
return false
end
local function SN(t, x, d)
pcall(function()
SG:SetCore("SendNotification", {Title = t or "Ultimate Hub", Text = x or "", Duration = d or 5})
end)
end
local KeyCache = {}
local function VK(k)
if not k or k == "" then
return false, "Please enter a key!"
end
k = k:gsub("^%s*(.-)%s*$", "%1")
if #k < 5 then
return false, "Key too short!"
end
if KeyCache[k] and (os.time() - KeyCache[k].time) < 300 then
return KeyCache[k].valid, KeyCache[k].msg
end
local uid = GetUserIdentifier()
local s, r = pcall(function()
local response = DoRequest(CFG.ValidationURL, "POST", {
["Content-Type"] = "application/json"
}, HS:JSONEncode({
key = k,
hwid = uid,
userId = LP.UserId,
userName = LP.Name
}))
if response and response.Body then
return HS:JSONDecode(response.Body)
end
return nil
end)
if s and r then
if r.valid == true or r.success == true then
if r.bound_to_other then
local boundName = r.bound_user or "Unknown"
KeyCache[k] = {valid = false, msg = "Key bound to: " .. boundName, time = os.time()}
return false, "Key bound to: " .. boundName
end
local msg = r.message or "Key Valid!"
if r.new_binding then
msg = "Key Registered!"
elseif r.returning_user then
msg = "Welcome back!"
end
KeyCache[k] = {valid = true, msg = msg, time = os.time()}
return true, msg
else
local errMsg = r.message or "Invalid key!"
KeyCache[k] = {valid = false, msg = errMsg, time = os.time()}
return false, errMsg
end
end
local fallbackValid = false
s, r = pcall(function()
return HS:JSONDecode(game:HttpGet("https://work.ink/_api/v2/token/isValid/" .. k))
end)
if s and r and r.valid == true then
fallbackValid = true
end
if fallbackValid then
if CFG.OneKeyOneUser then
local canUse, status, bindData = CheckKeyBinding(k, uid)
if status == "bound_other" then
local boundName = "Unknown"
if bindData and bindData.userName then
boundName = bindData.userName
end
KeyCache[k] = {valid = false, msg = "Key bound to: " .. boundName, time = os.time()}
return false, "Key bound to: " .. boundName
elseif status == "new" then
BindKeyToUser(k, uid)
end
end
KeyCache[k] = {valid = true, msg = "Key Valid!", time = os.time()}
return true, "Key Valid!"
end
KeyCache[k] = {valid = false, msg = "Invalid key or server error!", time = os.time()}
return false, "Invalid key!"
end
local function CKS()
pcall(function()
if getgenv().UH then
getgenv().UH:Destroy()
end
end)
pcall(function()
local k = CG:FindFirstChild("UltimateHubKeySystem")
if k then
k:Destroy()
end
end)
getgenv().UH = nil
task.wait(0.1)
if CFG.SV then
local sk = RF(CFG.KF)
local su = RF(CFG.UF)
local cu = GetUserIdentifier()
if sk and sk ~= "" then
if CFG.OneKeyOneUser and su and su ~= cu then
DF(CFG.KF)
DF(CFG.UF)
SN("Ultimate Hub", "Key reset: Different device", 3)
else
SN("Ultimate Hub", "Checking saved key...", 2)
local v = VK(sk)
if v then
SF(CFG.UF, cu)
SN("Ultimate Hub", "Key valid! Loading...", 2)
return true
end
DF(CFG.KF)
DF(CFG.UF)
end
end
end
local SGui = Instance.new("ScreenGui")
SGui.Name = "UltimateHubKeySystem"
SGui.ResetOnSpawn = false
SGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
local parentSuccess = pcall(function()
SGui.Parent = CG
end)
if not parentSuccess then
pcall(function()
SGui.Parent = LP:WaitForChild("PlayerGui")
end)
end
local BG = Instance.new("Frame")
BG.Size = UDim2.new(1, 0, 1, 0)
BG.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
BG.BackgroundTransparency = 0.5
BG.BorderSizePixel = 0
BG.Parent = SGui
local MF = Instance.new("Frame")
MF.Size = UDim2.new(0, 360, 0, 220)
MF.BackgroundColor3 = Color3.fromRGB(25, 25, 35)
MF.BorderSizePixel = 0
MF.AnchorPoint = Vector2.new(0.5, 0.5)
MF.Position = UDim2.new(0.5, 0, 0.5, 0)
MF.Parent = SGui
local MFCorner = Instance.new("UICorner", MF)
MFCorner.CornerRadius = UDim.new(0, 12)
local MS = Instance.new("UIStroke", MF)
MS.Color = Color3.fromRGB(100, 100, 255)
MS.Thickness = 2
local TB = Instance.new("Frame")
TB.Size = UDim2.new(1, 0, 0, 45)
TB.BackgroundColor3 = Color3.fromRGB(30, 30, 45)
TB.BorderSizePixel = 0
TB.Parent = MF
local TBCorner = Instance.new("UICorner", TB)
TBCorner.CornerRadius = UDim.new(0, 12)
local TBF = Instance.new("Frame")
TBF.Size = UDim2.new(1, 0, 0, 15)
TBF.Position = UDim2.new(0, 0, 1, -15)
TBF.BackgroundColor3 = Color3.fromRGB(30, 30, 45)
TBF.BorderSizePixel = 0
TBF.Parent = TB
local TL = Instance.new("TextLabel")
TL.Size = UDim2.new(1, -20, 0, 25)
TL.Position = UDim2.new(0, 10, 0, 5)
TL.BackgroundTransparency = 1
TL.Text = "🔐 Ultimate Hub V9.2"
TL.TextColor3 = Color3.fromRGB(255, 255, 255)
TL.TextSize = 18
TL.Font = Enum.Font.GothamBold
TL.TextXAlignment = Enum.TextXAlignment.Center
TL.Parent = TB
local bs, sc
if IsServerConfigured() then
bs = "🔒 Railway Server (Active)"
sc = Color3.fromRGB(100, 255, 100)
else
bs = "⚠️ Server Not Configured"
sc = Color3.fromRGB(255, 200, 100)
end
local ST = Instance.new("TextLabel")
ST.Size = UDim2.new(1, -20, 0, 15)
ST.Position = UDim2.new(0, 10, 0, 28)
ST.BackgroundTransparency = 1
ST.Text = bs
ST.TextColor3 = sc
ST.TextSize = 10
ST.Font = Enum.Font.Gotham
ST.TextXAlignment = Enum.TextXAlignment.Center
ST.Parent = TB
local UI = Instance.new("TextLabel")
UI.Size = UDim2.new(1, 0, 0, 15)
UI.Position = UDim2.new(0, 0, 0, 50)
UI.BackgroundTransparency = 1
UI.Text = "👤 " .. LP.Name .. " (ID: " .. LP.UserId .. ")"
UI.TextColor3 = Color3.fromRGB(120, 120, 140)
UI.TextSize = 10
UI.Font = Enum.Font.Gotham
UI.Parent = MF
local IC = Instance.new("Frame")
IC.Size = UDim2.new(0, 320, 0, 40)
IC.Position = UDim2.new(0.5, -160, 0, 70)
IC.BackgroundColor3 = Color3.fromRGB(35, 35, 45)
IC.BorderSizePixel = 0
IC.Parent = MF
local ICCorner = Instance.new("UICorner", IC)
ICCorner.CornerRadius = UDim.new(0, 8)
local IS = Instance.new("UIStroke", IC)
IS.Color = Color3.fromRGB(60, 60, 80)
IS.Thickness = 1
local KI = Instance.new("TextBox")
KI.Size = UDim2.new(1, -16, 1, 0)
KI.Position = UDim2.new(0, 8, 0, 0)
KI.BackgroundTransparency = 1
KI.Text = ""
KI.PlaceholderText = "Paste your key here..."
KI.PlaceholderColor3 = Color3.fromRGB(100, 100, 100)
KI.TextColor3 = Color3.fromRGB(255, 255, 255)
KI.TextSize = 13
KI.Font = Enum.Font.Gotham
KI.ClearTextOnFocus = false
KI.Parent = IC
local STL = Instance.new("TextLabel")
STL.Size = UDim2.new(1, -40, 0, 25)
STL.Position = UDim2.new(0, 20, 0, 115)
STL.BackgroundTransparency = 1
STL.Text = ""
STL.TextColor3 = Color3.fromRGB(255, 100, 100)
STL.TextSize = 11
STL.Font = Enum.Font.Gotham
STL.TextXAlignment = Enum.TextXAlignment.Center
STL.TextWrapped = true
STL.Parent = MF
local SB = Instance.new("TextButton")
SB.Size = UDim2.new(0, 155, 0, 36)
SB.Position = UDim2.new(0.5, -160, 0, 145)
SB.BackgroundColor3 = Color3.fromRGB(80, 120, 255)
SB.BorderSizePixel = 0
SB.Text = "✓ Validate Key"
SB.TextColor3 = Color3.fromRGB(255, 255, 255)
SB.TextSize = 13
SB.Font = Enum.Font.GothamBold
SB.Parent = MF
local SBCorner = Instance.new("UICorner", SB)
SBCorner.CornerRadius = UDim.new(0, 8)
local GK = Instance.new("TextButton")
GK.Size = UDim2.new(0, 155, 0, 36)
GK.Position = UDim2.new(0.5, 5, 0, 145)
GK.BackgroundColor3 = Color3.fromRGB(88, 101, 242)
GK.BorderSizePixel = 0
GK.Text = "🔑 Get Key"
GK.TextColor3 = Color3.fromRGB(255, 255, 255)
GK.TextSize = 13
GK.Font = Enum.Font.GothamBold
GK.Parent = MF
local GKCorner = Instance.new("UICorner", GK)
GKCorner.CornerRadius = UDim.new(0, 8)
local BIC = Instance.new("Frame")
BIC.Size = UDim2.new(1, -20, 0, 20)
BIC.Position = UDim2.new(0, 10, 1, -25)
BIC.BackgroundTransparency = 1
BIC.Parent = MF
local AL = Instance.new("TextLabel")
AL.Size = UDim2.new(0.5, 0, 1, 0)
AL.BackgroundTransparency = 1
AL.Text = "Attempts: 0/" .. CFG.MA
AL.TextColor3 = Color3.fromRGB(100, 100, 100)
AL.TextSize = 10
AL.Font = Enum.Font.Gotham
AL.TextXAlignment = Enum.TextXAlignment.Left
AL.Parent = BIC
local CRL = Instance.new("TextLabel")
CRL.Size = UDim2.new(0.5, 0, 1, 0)
CRL.Position = UDim2.new(0.5, 0, 0, 0)
CRL.BackgroundTransparency = 1
CRL.Text = "by ToingDC"
CRL.TextColor3 = Color3.fromRGB(70, 70, 80)
CRL.TextSize = 10
CRL.Font = Enum.Font.Gotham
CRL.TextXAlignment = Enum.TextXAlignment.Right
CRL.Parent = BIC
MF.Size = UDim2.new(0, 0, 0, 0)
TS:Create(MF, TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Size = UDim2.new(0, 360, 0, 220)}):Play()
local kv = false
local vc = Instance.new("BindableEvent")
local ip = false
local function CloseGUI()
TS:Create(MF, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.In), {Size = UDim2.new(0, 0, 0, 0)}):Play()
TS:Create(BG, TweenInfo.new(0.25), {BackgroundTransparency = 1}):Play()
task.wait(0.25)
SGui:Destroy()
end
local function SK()
if ip then
return
end
ip = true
local ik = KI.Text:gsub("^%s*(.-)%s*$", "%1")
if ik == "" then
STL.Text = "⚠️ Please enter a key!"
STL.TextColor3 = Color3.fromRGB(255, 200, 100)
ip = false
return
end
if CA >= CFG.MA then
local tl = CFG.CT - (os.time() - LAT)
if tl > 0 then
STL.Text = "⏳ Wait " .. tl .. " seconds..."
STL.TextColor3 = Color3.fromRGB(255, 100, 100)
ip = false
return
else
CA = 0
end
end
STL.Text = "🔄 Connecting to server..."
STL.TextColor3 = Color3.fromRGB(255, 255, 100)
SB.Text = "..."
SB.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
task.spawn(function()
task.wait(0.3)
local v, m = VK(ik)
if v then
STL.Text = "✅ " .. m
STL.TextColor3 = Color3.fromRGB(100, 255, 100)
SB.Text = "✓ Success!"
SB.BackgroundColor3 = Color3.fromRGB(80, 200, 80)
if CFG.SV then
SF(CFG.KF, ik)
SF(CFG.UF, GetUserIdentifier())
end
task.wait(1.2)
CloseGUI()
kv = true
vc:Fire()
else
CA = CA + 1
LAT = os.time()
STL.Text = "❌ " .. m
STL.TextColor3 = Color3.fromRGB(255, 100, 100)
SB.Text = "✓ Validate Key"
SB.BackgroundColor3 = Color3.fromRGB(80, 120, 255)
AL.Text = "Attempts: " .. CA .. "/" .. CFG.MA
local op = IC.Position
for i = 1, 4 do
if i % 2 == 0 then
IC.Position = op + UDim2.new(0, 6, 0, 0)
else
IC.Position = op + UDim2.new(0, -6, 0, 0)
end
task.wait(0.04)
end
IC.Position = op
IS.Color = Color3.fromRGB(255, 80, 80)
task.wait(0.5)
IS.Color = Color3.fromRGB(60, 60, 80)
ip = false
end
end)
end
SB.MouseEnter:Connect(function()
TS:Create(SB, TweenInfo.new(0.15), {BackgroundColor3 = Color3.fromRGB(100, 140, 255)}):Play()
end)
SB.MouseLeave:Connect(function()
TS:Create(SB, TweenInfo.new(0.15), {BackgroundColor3 = Color3.fromRGB(80, 120, 255)}):Play()
end)
GK.MouseEnter:Connect(function()
TS:Create(GK, TweenInfo.new(0.15), {BackgroundColor3 = Color3.fromRGB(108, 121, 255)}):Play()
end)
GK.MouseLeave:Connect(function()
TS:Create(GK, TweenInfo.new(0.15), {BackgroundColor3 = Color3.fromRGB(88, 101, 242)}):Play()
end)
SB.MouseButton1Click:Connect(SK)
KI.FocusLost:Connect(function(e)
if e then
SK()
end
end)
GK.MouseButton1Click:Connect(function()
if OU(CFG.GetKeyLink) then
STL.Text = "🌐 Browser opened!"
STL.TextColor3 = Color3.fromRGB(100, 255, 100)
else
SC(CFG.GetKeyLink)
STL.Text = "📋 Link copied!"
STL.TextColor3 = Color3.fromRGB(100, 200, 255)
end
end)
vc.Event:Wait()
vc:Destroy()
return kv
end
local function LH()
local C = getgenv().UHCore
if not C then
pcall(function()
loadstring(game:HttpGet(CFG.CU))()
end)
task.wait(0.5)
C = getgenv().UHCore
if not C then
return
end
end
pcall(function()
CG:FindFirstChild("UltimateHubKeySystem"):Destroy()
end)
task.wait(0.2)
local S = C.S
local R
local loadSuccess = pcall(function()
R = loadstring(game:HttpGet("https://sirius.menu/rayfield"))()
end)
if not loadSuccess or not R then
return
end
R.Notify = function() end
local W = R:CreateWindow({
Name = "Ultimate Hub V9.2 | ToingDC",
LoadingTitle = "Ultimate Hub",
LoadingSubtitle = "by ToingDC",
ConfigurationSaving = {Enabled = false},
KeySystem = false
})
getgenv().UH = W
local E = W:CreateTab("ESP", 4483362458)
E:CreateSection("Player ESP")
E:CreateToggle({Name = "Killer ESP", CurrentValue = false, Callback = function(v) if v then C.StartKillerESP() else C.StopKillerESP() end end})
E:CreateToggle({Name = "Survivor ESP", CurrentValue = false, Callback = function(v) if v then C.StartSurvivorESP() else C.StopSurvivorESP() end end})
E:CreateSection("Object ESP")
E:CreateToggle({Name = "Generator ESP", CurrentValue = false, Callback = function(v) if v then C.StartGenESP() else C.StopGenESP() end end})
E:CreateToggle({Name = "Pallet ESP", CurrentValue = false, Callback = function(v) if v then C.StartPalletESP() else C.StopPalletESP() end end})
local SV = W:CreateTab("Survivor", 4483362458)
SV:CreateSection("Environment")
SV:CreateToggle({Name = "No Fog", CurrentValue = false, Callback = function(v) if v then C.StartNoFog() else C.StopNoFog() end end})
SV:CreateToggle({Name = "Fullbright", CurrentValue = false, Callback = function(v) C.SetFullbright(v) end})
SV:CreateSection("Auto Scripts")
SV:CreateButton({Name = "Load Auto Generator", Callback = function() C.LoadScript("https://raw.githubusercontent.com/trianaq765-cmd/VD/refs/heads/main/gene") end})
SV:CreateButton({Name = "Load Auto Heal", Callback = function() C.LoadScript("https://raw.githubusercontent.com/trianaq765-cmd/VD/refs/heads/main/auto%20heal") end})
SV:CreateSection("Performance")
SV:CreateToggle({Name = "Anti-Lag Mode", CurrentValue = false, Callback = function(v) if v then C.StartAntiLag() else C.StopAntiLag() end end})
local K = W:CreateTab("Killer", 4483362458)
K:CreateSection("Auto Attack")
K:CreateToggle({Name = "Enable Auto Attack", CurrentValue = false, Callback = function(v) if v then C.StartAutoAttack() else C.StopAutoAttack() end end})
K:CreateSlider({Name = "Attack Distance", Range = {5, 30}, Increment = 1, CurrentValue = 15, Callback = function(v) S.Kil.AD = v end})
K:CreateSection("Protection")
K:CreateToggle({Name = "Anti-Blind", CurrentValue = false, Callback = function(v) if v then C.StartAntiBlind() else C.StopAntiBlind() end end})
K:CreateSection("Camera Mode")
K:CreateDropdown({Name = "Camera View", Options = {"Default", "FirstPerson", "ThirdPerson"}, CurrentOption = {"Default"}, Callback = function(o) if o and #o > 0 then C.SetCameraMode(o[1]) end end})
local P = W:CreateTab("Player", 4483362458)
P:CreateSection("Speed Boost")
local SPL = P:CreateLabel("Speed: " .. S.Plr.SP)
P:CreateButton({Name = "Speed -1", Callback = function() S.Plr.SP = math.max(16, S.Plr.SP - 1) SPL:Set("Speed: " .. S.Plr.SP) if S.Plr.SO then C.ApplySpeed() end end})
P:CreateButton({Name = "Speed +1", Callback = function() S.Plr.SP = math.min(200, S.Plr.SP + 1) SPL:Set("Speed: " .. S.Plr.SP) if S.Plr.SO then C.ApplySpeed() end end})
P:CreateToggle({Name = "Enable Speed", CurrentValue = false, Callback = function(v) if v then C.StartSpeed() else C.StopSpeed() end end})
P:CreateSection("Teleport")
local SP = nil
local PD = P:CreateDropdown({Name = "Select Player", Options = C.GetPlayerList(), Callback = function(o) if o and #o > 0 then SP = o[1] end end})