This commit is contained in:
lx
2026-07-06 14:01:11 -04:00
commit c4f97d729d
16468 changed files with 935321 additions and 0 deletions
@@ -0,0 +1,15 @@
-- heuristic to detect clients that don't send certain remote events
return function()
local players = game:GetService("Players")
local robloxReplicatedStorage = game:GetService("RobloxReplicatedStorage")
spawn(function()
local setPlayerBlockList = robloxReplicatedStorage:WaitForChild("SetPlayerBlockList", 60)
if not setPlayerBlockList then
return
end
setPlayerBlockList.OnServerEvent:Connect(function(player)
player:ProveRealPlayer(1)
players:SetRealPlace()
end)
end)
end
@@ -0,0 +1,87 @@
-- chat bot info heuristic (assume simple checksum is good enough)
return function()
local rbxAnalyticsService = game:GetService("RbxAnalyticsService")
local JOIN_TIME_IDX = 1
local CHAT_TIME_IDX = 2
local CHAT_MSG_IDX = 3
local info = {}
local players = game:GetService("Players")
local replicatedStorage = game:GetService("ReplicatedStorage")
-- init
players.PlayerAdded:Connect(function (player)
pcall(function()
info[tostring(player.UserId)] = {os.time(), -1, ""}
end)
end)
-- send influx
players.PlayerRemoving:Connect(function (player)
if info == nil then
return
end
local userid = tostring(player.UserId)
local record = info[userid]
if record == nil then
return
end
local botReport = settings():GetFFlag("JumpScaresP2")
local permyriad = game:GetFastInt("RedPermyriad")
if botReport == false and permyriad <= 0 then
return
end
local now = os.time()
local duration = now - record[JOIN_TIME_IDX]
if record[CHAT_TIME_IDX] == -1 or duration > 60 then
return
end
if (botReport == true) then
player:SetBotStatus(1)
end
if (permyriad > 0) then
pcall(function()
info[userid] = nil
if (permyriad > 0 and rbxAnalyticsService) then
local points = {
chsrId = player.UserId,
duration = duration,
chat = (now - record[CHAT_TIME_IDX]),
msg = tostring(record[CHAT_MSG_IDX])
}
rbxAnalyticsService:ReportInfluxSeries("ChatBot", points, permyriad)
end
end)
end
end)
-- record
spawn(function ()
local chatEvents = replicatedStorage:WaitForChild("DefaultChatSystemChatEvents", 60)
if not chatEvents then
return
end
local sayMessageRequest = chatEvents:WaitForChild("SayMessageRequest", 1)
if not sayMessageRequest then
return
end
local connection = sayMessageRequest.OnServerEvent:Connect(function(player, message)
xpcall(function()
if typeof(message) == "string" and #message > 60 then
local userid = tostring(player.UserId)
local record = info[userid]
if record == nil or record[CHAT_TIME_IDX] ~= -1 then
return
end
record[CHAT_TIME_IDX] = os.time()
local tmpStr = string.sub(message, 1, 256)
local strEnd = #tmpStr
local acc = 0
for i = 1,strEnd do
acc = acc + tmpStr:byte(i)
end
record[CHAT_MSG_IDX] = acc
info[userid] = record
end
end, function() end)
end)
end)
end
@@ -0,0 +1,139 @@
local kUInt32Max = 4294967295
local kInt32Max = 2147483647
local function makeRandomChallenge(seed)
local lotto = seed % 128
local rng = Random.new(seed)
local code = {}
--local function append(s) code[#code+1] = s .. "\n" end
local function append(s, ...) code[#code+1] = string.format(s, ...) end
local function appraw(s) code[#code+1] = s end
local function randSel(t) return t[rng:NextInteger(1,#t)] end
local function rand(n) return rng:NextInteger(1,n) end
local function registerCode(t,f) t[#t+1] = f end
local leafOp = {}
registerCode(leafOp, function(a,b,c) return string.format("((%s + (%s + %s)))", a, b, c) end)
registerCode(leafOp, function(a,b,c) return string.format("((%s + (%s - %s)))", a, b, c) end)
registerCode(leafOp, function(a,b,c) return string.format("((%s - (%s + %s)))", a, b, c) end)
registerCode(leafOp, function(a,b,c) return string.format("((%s - (%s - %s)))", a, b, c) end)
local numLeaf = 8
local numUp = 4
local numMt = 4
local numInner = 4
-- x, y are the inputs to the generated function
append("xv, yv = ...")
append("local x = {v=xv}")
append("local y = {v=yv}")
-- u and u1..un are two ways to reach globals
append("local u = {}")
for i = 1,numUp do
append("local u%d = %d", i, rng:NextInteger(1,kInt32Max))
append("u[%d] = u%d", i, i)
end
append("local rng = Random.new(xv+yv)")
for i = 1,numLeaf do
append("local function f%d(a,b)", i)
append(" local r = {v=u[%d]}", rand(numUp))
-- select random function
appraw(" r.v = bit32.bor(" .. randSel(leafOp)("r.v", "a.v", "b.v") .. ", 0)")
appraw(" u[1] = bit32.bor(" .. randSel(leafOp)("u[1]", "r.v", "rng:NextInteger(1,2147483647)") .. ", 0)")
local idx = rand(numUp)
local idy = rand(numUp)
local idz = rand(numUp)
append(" u[%d], u[%d] = u[%d], u[%d]", idx, idy, idy, idx)
append(" u[1], u[%d] = u[%d], u[1]", idz, idz)
-- select random metafunction
append(" setmetatable(r, getmetatable(%s))", (rand(2)==1) and "a" or "b")
append(" return r")
append("end")
end
-- make metatables
append("local mt = {}")
for i = 1,numMt do
append(" local mt%d = {__add = f%d, __sub = f%d}", i, rand(numLeaf), rand(numLeaf))
append(" mt[%d] = mt%d", i, i)
end
append("setmetatable(x, mt[%d])", rand(numMt))
append("setmetatable(y, mt[%d])", rand(numMt))
-- make functions
for i = 1, numInner do
append("local function n%d(a,b)", i)
append(" local r = {v=u[%d]}", rand(numUp))
append(" setmetatable(r, mt%d)", rand(numMt))
-- shuffle and update globals
local k = rand(numUp)
append(" u[%d] = bit32.bor(u[%d] + u[%d], 0)", k, k, rand(numUp))
-- select random function
appraw(" r =" .. randSel(leafOp)("r", "a", "b"))
append(" r = f%d(r, %s)", rand(numLeaf), (rand(2)==1) and "a" or "b")
appraw(" u[1] = " .. randSel(leafOp)("u[1]", "r.v", "rng:NextInteger(1,2147483647)"))
append(" return r")
append("end")
end
-- order functions
append("local acc = 0")
append("local funcs = {")
for i = 1, numInner do
append(" n%d%s", i, (i==numInner) and "}" or ",")
end
append("for i = #funcs,2,-1 do")
append(" local j = rng:NextInteger(1,i)")
append(" funcs[i], funcs[j] = funcs[j], funcs[i]")
append("end")
-- accumulate
append("acc = x+y")
for i = 1,numInner do
append("acc = funcs[%d](acc, %s)", i, (i%2 == 1) and "x" or "y")
end
append("acc = acc.v")
append("for i = 1,%d do", numUp)
append( "acc = bit32.bor(acc + u[i], 0)")
append("end")
-- probe
append("local ji = game.JobId")
append("for i=1,#ji do acc = acc + ji:byte(i) end")
-- Roblox has UserSettings, vanilla gives different error
append("local tmpstr")
append("xpcall(function() tmpstr = tostring(UserSettings()) end, function() tmpstr = \"nope\" end)")
append("for i=1,#tmpstr do acc = acc + tmpstr:byte(i) end")
-- Roblox has 3 arg xpcall, vanilla errors
append("local tmpstr2")
append("xpcall(function(...) tmpstr2 = tostring(UserSettings()) .. ... end, function() tmpstr2 = \"nope\" end, \"yep\")")
append("for i=1,#tmpstr2 do acc = acc + tmpstr2:byte(i) end")
-- Roblox does not have os.exit, vanilla exits
append("xpcall(function() os.exit() end, function() acc = acc + 9001 end)")
-- studio, client/server, and vanilla all behave differently.
append("xpcall(function() acc = game:GetService(\"RunService\"):IsStudio() and (acc+256) or (acc+1024) end, function() acc = acc + 512 end)")
-- namecall test
append("xpcall(function() local obj = newproxy(true) getmetatable(obj).__namecall = function(self, arg) return 42 + arg end acc = acc + obj:Foo(10) end, function() acc = acc + 2000 end)")
-- done
append("return acc")
return table.concat(code,"\n")
end
local seed = ...
if seed == nil then
seed = Random.new():NextInteger(0, kUInt32Max)
end
local code = makeRandomChallenge(seed)
local rs = game:GetService("RunService")
if rs:IsServer() and not rs:IsClient() then
game:GetService("NetworkServer"):RegisterDynLuaChallenge(code, seed)
end
return code
@@ -0,0 +1,151 @@
local kUInt32Max = 4294967295
local kInt32Max = 2147483647
local alphabet = "\nbcdghjklmnpqrtvwyz23456789BCDGHJKLMNPQRTVWYZ"
local options = {
polynomials = {0xEDB88320, 0x82F63B78, 0xEB31D82E, 0x992C1A4C},
gui = {"TextButton", "TextBox", "TextLabel"},
--gui = {"Frame"},
ha = {"Enum.HorizontalAlignment.Right", "Enum.HorizontalAlignment.Left", "Enum.HorizontalAlignment.Center"},
va = {"Enum.VerticalAlignment.Top", "Enum.VerticalAlignment.Bottom", "Enum.VerticalAlignment.Center"},
fillDirection = {"Enum.FillDirection.Horizontal", "Enum.FillDirection.Vertical"},
borderMode = {"Enum.BorderMode.Outline", "Enum.BorderMode.Middle", "Enum.BorderMode.Inset" },
boolean = {"true","false"}
}
local function makeRandomChallenge(seed)
local rng = Random.new(seed)
local code = {"-- hi"}
local function replace(ctx) return function(s, o)
if s == "rand" then return string.sub(rng:NextNumber(),1,5) end
if s == "text" then
local str = ""
for i=1,rng:NextInteger(1,10) do
local idx = rng:NextInteger(0,#alphabet)
str = str .. alphabet:sub(idx,idx):gsub("\n","\\n")
end
return str
end
if tonumber(s) then return ctx[tonumber(s)] end
local list = options[s]
return list[rng:NextInteger(1, #list)]
end end
local function append(s,...) code[#code+1] = s:gsub("%$%{([a-z0-9][a-zA-Z]*)%}", replace({...})) end
append("local xv, yv = ...")
append([==[
local result = {};
local r = Random.new(xv+yv)
local function rand() return r:NextInteger(0,0x400)/0x400 end
local b = Instance.new("Frame")
b.Name = "Base"
local elements = {b}
local function crc32(s,crc)
crc = crc and bit32.bnot(crc) or 0xFFFFFFFF
for i=1,#s do
local l = bit32.rshift(crc,8)
crc = bit32.bxor(bit32.band(crc, 0xFF), s:byte(i))
crc = (bit32.band(crc,1) == 1) and bit32.bxor(bit32.rshift(crc,1), ${polynomials}) or bit32.rshift(crc,1)
crc = (bit32.band(crc,1) == 1) and bit32.bxor(bit32.rshift(crc,1), ${polynomials}) or bit32.rshift(crc,1)
crc = (bit32.band(crc,1) == 1) and bit32.bxor(bit32.rshift(crc,1), ${polynomials}) or bit32.rshift(crc,1)
crc = (bit32.band(crc,1) == 1) and bit32.bxor(bit32.rshift(crc,1), ${polynomials}) or bit32.rshift(crc,1)
crc = (bit32.band(crc,1) == 1) and bit32.bxor(bit32.rshift(crc,1), ${polynomials}) or bit32.rshift(crc,1)
crc = (bit32.band(crc,1) == 1) and bit32.bxor(bit32.rshift(crc,1), ${polynomials}) or bit32.rshift(crc,1)
crc = (bit32.band(crc,1) == 1) and bit32.bxor(bit32.rshift(crc,1), ${polynomials}) or bit32.rshift(crc,1)
crc = (bit32.band(crc,1) == 1) and bit32.bxor(bit32.rshift(crc,1), ${polynomials}) or bit32.rshift(crc,1)
crc = bit32.bxor(l, crc)
end
return bit32.bnot(crc)
end
local result = 0
local function a(...)
local str = string.format(...)
result = crc32(str, result)
--print(str)
end
local e = nil
]==])
for i=1,rng:NextInteger(10,15) do
append([==[
e = Instance.new("${gui}")
e.BorderSizePixel = r:NextInteger(1,10)
e.AnchorPoint = Vector2.new(4*rand()*${rand}, rand())
e.Rotation = r:NextInteger(0,360)
e.Position = UDim2.new(2*rand(), r:NextInteger(1,100), 2*rand(), r:NextInteger(1,100))
e.Size = UDim2.new(2*rand(), r:NextInteger(1,100), 2*rand(), r:NextInteger(1,100))
e.BackgroundColor3 = Color3.new(rand(), rand(), rand())
--e.BorderMode = ${borderMode}
e.Parent = elements[#elements]
e.Name = "${text}"
elements[#elements+1] = e
]==])
if rng:NextInteger(0,2) == 0 then
append([==[
e = Instance.new("UIScale")
e.Scale = 4 * ${rand} * rand()
e.Name = "Modifier-${text}"
e.Parent = elements[#elements]
]==])
end
if rng:NextInteger(0,2) == 0 then
append([==[
e = Instance.new("UIPadding")
e.PaddingTop = UDim.new(4*rand()*${rand}, r:NextInteger(1,100)*${rand})
e.PaddingLeft = UDim.new(4*rand()*${rand}, r:NextInteger(1,100)*${rand})
e.PaddingBottom = UDim.new(4*rand()*${rand}, r:NextInteger(1,100)*${rand})
e.PaddingRight = UDim.new(4*rand()*${rand}, r:NextInteger(1,100)*${rand})
e.Name = "Modifier-${text}"
e.Parent = elements[#elements]
]==])
end
if rng:NextInteger(0,2) == 0 then
append([==[
e = Instance.new("UIListLayout")
e.Name = "Modifier-${text}"
e.HorizontalAlignment = ${ha}
e.VerticalAlignment = ${va}
e.FillDirection = ${fillDirection}
e.Parent = elements[#elements]
]==])
end
end
append("a(game.JobId)")
append([==[
for k,v in ipairs(elements) do
a("%d) %d,%d %dx%d %d %s", k,
v.AbsolutePosition.X, v.AbsolutePosition.Y,
v.AbsoluteSize.X, v.AbsoluteSize.Y,
v.Rotation, BrickColor.new(v.BackgroundColor3).Name
)
end
--b.Parent = script.Parent
]==])
append("return result")
return table.concat(code,"\n")
end
local seed = ...
if seed == nil then
seed = Random.new():NextInteger(0, kUInt32Max)
end
local code = makeRandomChallenge(seed)
local rs = game:GetService("RunService")
if rs:IsServer() and not rs:IsClient() then
game:GetService("NetworkServer"):RegisterDynLuaChallenge(code, seed)
end
return code