0% found this document useful (0 votes)
52 views4 pages

Hunty Zombie Security Script Code

The document outlines a security system for a game using Roblox's Lua scripting. It includes player authentication through heartbeat signals, key generation, and encryption methods to ensure secure communication. The system tracks player activity and can kick players for multiple failed attempts or suspicious behavior.

Uploaded by

rimwanted72
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views4 pages

Hunty Zombie Security Script Code

The document outlines a security system for a game using Roblox's Lua scripting. It includes player authentication through heartbeat signals, key generation, and encryption methods to ensure secure communication. The system tracks player activity and can kick players for multiple failed attempts or suspicious behavior.

Uploaded by

rimwanted72
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

local Players = game:GetService("Players")

local ReplicatedStorage = game:GetService("ReplicatedStorage")


local HttpService = game:GetService("HttpService")
local RunService = game:GetService("RunService")

local securityFolder = ReplicatedStorage:FindFirstChild("SecuritySystem")


if not securityFolder then
securityFolder = [Link]("Folder")
[Link] = "SecuritySystem"
[Link] = ReplicatedStorage
end

local heartbeatRemote = securityFolder:FindFirstChild("HeartbeatRemote")


if not heartbeatRemote then
heartbeatRemote = [Link]("RemoteEvent")
[Link] = "HeartbeatRemote"
[Link] = securityFolder
end

local keyExchangeRemote = securityFolder:FindFirstChild("KeyExchangeRemote")


if not keyExchangeRemote then
keyExchangeRemote = [Link]("RemoteFunction")
[Link] = "KeyExchangeRemote"
[Link] = securityFolder
end

local function simpleEncrypt(str, key)


local result = ""
for i = 1, #str do
local byte = [Link](str, i)
result = result .. [Link]([Link](byte, key))
end
return result
end

local guiData = [Link]("StringValue")


[Link] = "GuiCheckData"
local key = 42
local data = {
guiName = simpleEncrypt("CommandMenufly", key),
allowedChildren = {
simpleEncrypt("UICorner", key),
simpleEncrypt("MainFrame", key),
simpleEncrypt("DragBar", key)
}
}
[Link] = HttpService:JSONEncode(data)
[Link] = securityFolder

local playerSecurity = {}
local serverSecrets = {
baseKey = 7531,
saltKey = 9241,
rotationKey = 4687
}

local function generatePlayerKey(userId, timestamp)


local seed = (userId * [Link] + timestamp *
[Link]) % 999999
[Link](seed)

local dynamicKey = [Link](100000, 999999)


[Link](tick())

return dynamicKey
end

local function advancedEncrypt(userId, timestamp, playerKey)


local step1 = (userId + timestamp) * [Link]
local step2 = step1 + playerKey
local step3 = step2 % 1000000
local step4 = step3 + (userId % 100) * (timestamp % 100)

return step4 % 999999


end

local function getSecureTimestamp()


return [Link](tick() * 100) % 1000000
end

local function onPlayerAdded(player)


playerSecurity[[Link]] = {
playerKey = [Link](100000, 999999),
lastHeartbeat = tick(),
strikes = 0,
keyRotationTimer = 0,
validTimestamps = {},
failedAttempts = 0
}

wait(5)

if not [Link] then return end

spawn(function()
while [Link] and playerSecurity[[Link]] do
wait(6)

local security = playerSecurity[[Link]]


if not security then break end

[Link] = [Link] + 6
if [Link] >= 30 then
[Link] = [Link](100000, 999999)
[Link] = 0
end

local timeSinceLastHeartbeat = tick() - [Link]

if timeSinceLastHeartbeat > 5 then


[Link] = [Link] + 1
print("no hell no")

if [Link] >= 2 then


warn("❌ ‫ " طرد‬.. [Link] .. " - ‫)"انقطاع االتصال‬
player:Kick("nouza heart not loaded")
break
end
end
end
end)
end

local function onPlayerRemoving(player)


playerSecurity[[Link]] = nil
print("Good bye didy i'll miss u" .. [Link])
end

[Link] = function(player)
local security = playerSecurity[[Link]]
if not security then return nil end

local timestamp = getSecureTimestamp()


local tempKey = generatePlayerKey([Link], timestamp)

local encryptedResponse = {
key = tempKey,
timestamp = timestamp,
hash = (tempKey + timestamp + [Link]) % 100000
}

return encryptedResponse
end

[Link]:Connect(function(player, encryptedData,
clientTimestamp)
local security = playerSecurity[[Link]]
if not security then
warn("⚠️ heartbeat 😱: " .. [Link])
return
end

local warnCount = [Link] or 0

if not clientTimestamp or type(clientTimestamp) ~= "number" then


[Link] = [Link] + 1
warn("⚠️ timestamp not true lil kid " .. [Link])
warnCount = warnCount + 1
[Link] = warnCount
if warnCount >= 4 then
player:Kick("4 warnings detected - Access terminated")
end
return
end

for _, oldTimestamp in pairs([Link]) do


if clientTimestamp == oldTimestamp then
[Link] = [Link] + 2
warn("⚠️ " .. [Link])
warnCount = warnCount + 1
[Link] = warnCount
if warnCount >= 4 then
player:Kick("4 warnings detected - Access terminated")
end
if [Link] >= 5 then
player:Kick("Multiple failed attempts")
end
return
end
end

local playerKey = generatePlayerKey([Link], clientTimestamp)


local expectedValue = advancedEncrypt([Link], clientTimestamp,
playerKey)

if encryptedData == expectedValue then


[Link] = tick()
[Link] = [Link](0, [Link] - 1)
[Link] = [Link](0, [Link] - 1)

[Link]([Link], clientTimestamp)
if #[Link] > 5 then
[Link]([Link], 1)
end

print("💓 nouza heartbeat sended " .. [Link])

[Link] = 0
else
[Link] = [Link] + 2
[Link] = [Link] + 1

warn("😱theres no heartbeat 😱 im dead " .. [Link] .. " (nice try


didy: " .. [Link] .. ")")
warnCount = warnCount + 1
[Link] = warnCount
if warnCount >= 4 then
player:Kick("4 warnings detected - Access terminated")
end

if [Link] >= 5 or [Link] >= 6 then


warn("trys to bypass " .. [Link] .. " - nice try supper
didy")
player:Kick("Multiple failed attempts or bypass detected")
end
end
end)

[Link]:Connect(onPlayerAdded)
[Link]:Connect(onPlayerRemoving)

Common questions

Powered by AI

The script implements incremental warnings and punitive measures based on player activity and responses. Each suspicious activity adds to a `warnCount`, and players receive incremental penalties for repeated offenses, such as strikes and warning levels, which ensure that actions taken are proportional to the severity and frequency of detected anomalies .

Potential vulnerabilities in heartbeat monitoring could include manipulation or spoofing of heartbeat signals to feign player activity. If attackers could replicate valid heartbeats, it would bypass inactivity checks. However, the system mitigates these risks by cross-verifying timestamps, limiting valid timestamps to a buffer, and enforcing strict disciplinary actions on anomalies, reducing but not eliminating this risk .

Communication security between players and the server utilizes algorithms based on cryptographic principles involving XOR encryption for basic data obfuscation and a multi-step encryption process incorporating dynamic keys for complex data validation. By using player-specific keys and synchronizing timestamps, the script secures data exchanges, ensuring both confidentiality of the content and integrity of the transmission .

The system uses player-specific keys and timestamps for security measures. Each player is assigned a `playerKey` which is periodically rotated. Heartbeats are monitored, and players are warned or kicked if invalid timestamps or repeated failed attempts are detected. Warnings are issued at two failed attempts, and players are kicked after four warnings or if multiple failed attempts occur .

The system handles unauthorized script injections by generating encrypted data specific to each player and requiring the encrypted response to match expected results in terms of client timestamp and data. Any discrepancies or multiple failed decryption attempts trigger warnings and potential removal of the player through kicks, ensuring consistent verification against tampering .

The security system uses a combination of simple and advanced encryption techniques. A function, `simpleEncrypt`, is used to encrypt strings using a basic XOR operation with a key, while `advancedEncrypt` applies a multi-step process using user ID, timestamps, player's dynamic key, and a rotation key for complex encryption .

The `heartbeatRemote` is a RemoteEvent that monitors player connectivity and validates that encrypted data and timestamps from clients match expected values. It updates player data, rotates keys, and checks for missed heartbeats, issuing warnings or disconnections as necessary to maintain security and prevent tampering .

Key rotation effectively maintains security by frequently updating each player's `playerKey`, preventing prolonged use of a single key which could be compromised. Rotation occurs every 30 seconds, reducing the window for potential attacks. This approach is crucial for dynamic environments like gaming where interactions are frequent, providing a constantly shifting target for potential attackers .

To protect against replay attacks, the script maintains a list of `validTimestamps` for each player and checks incoming timestamps against this list. Re-used timestamps increase `failedAttempts` and trigger warnings. Timestamps are freshly generated using `getSecureTimestamp`, and repeated use of timestamps within player data triggers an increase in strikes and ultimately can lead to disconnection .

Player-specific keys are generated using a combination of static server secrets and dynamic values such as user ID and a secure timestamp. The `generatePlayerKey` function derives a key using a seed formula involving the server's `baseKey` and `saltKey` with current timestamps. The `advancedEncrypt` function further incorporates user ID and player key into a multi-step transformation using the `rotationKey`, resulting in a unique player-specific key .

You might also like