local OrionLib = loadstring(game:HttpGet("https://raw.githubusercontent.com/jensonhirst/Orion/main/source"))() local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") local LocalPlayer = Players.LocalPlayer local genv = (getgenv and getgenv()) or _G -- Clipboard fallback with debug local setclipboard = setclipboard or genv.setclipboard or (syn and syn.set_clipboard) or (fluxus and fluxus.set_clipboard) or (krnl and krnl.set_clipboard) or function(text) warn("No clipboard function available – cannot copy: " .. tostring(text):sub(1, 50)) end -- [[ Configuration States ]] local isScanning = true local logAllTraffic = false local logHttpGet = true local blockWebhooks = false local blockAllTraffic = false -- [[ Data Logging Storage ]] local requestHistory = {} local lastCopiedCount = 0 local webhookDomains = { "discord%.com/api/webhooks", "discordapp%.com/api/webhooks", "hooks%.discord%.com", "ptb%.discord%.com/api/webhooks", "canary%.discord%.com/api/webhooks" } -- Flags for tests local kickHooked = false local wsConnectedHooked = false -- [[ Helper Functions ]] local function checkWebhook(url) if not url then return false end local lowerUrl = string.lower(tostring(url)) for _, pattern in ipairs(webhookDomains) do if string.find(lowerUrl, pattern) then return true end end return false end local function compileReport() if #requestHistory == 0 then return nil end local outputReport = "=== SynaptaHub WEBHOOK SPY TRAFFIC REPORT ===\n" outputReport = outputReport .. "Total Captured Packets: " .. tostring(#requestHistory) .. "\n\n" for index, data in ipairs(requestHistory) do outputReport = outputReport .. string.format( "[%d] [%s] %s\n• URL: %s\n• Method: %s\n• Headers: %s\n• Body: %s\n\n", index, data.Time, data.Type, data.Url, data.Method, data.Headers, data.Body ) end outputReport = outputReport .. "=== END OF REPORT ===" return outputReport end local function emergencyClipboardSave() local report = compileReport() if report then local ok, err = pcall(setclipboard, report) if not ok then warn("Failed to save logs to clipboard: " .. tostring(err)) end OrionLib:MakeNotification({ Name = "🔒 Logs Auto‑Saved", Content = "All captured traffic copied to clipboard before disconnection.", Time = 5 }) end end -- [[ Exit & Kick Protection ]] if hookfunction then local oldKick oldKick = hookfunction(LocalPlayer.Kick, newcclosure(function(self, ...) emergencyClipboardSave() OrionLib:MakeNotification({ Name = "🛡️ Kick Prevented", Content = "A script attempted to kick you. Logs saved to clipboard.", Time = 5 }) return oldKick(self, ...) end)) kickHooked = true end Players.PlayerRemoving:Connect(function(player) if player == LocalPlayer then emergencyClipboardSave() end end) -- ============================================================ -- LOG QUEUE – decouples logging from the hook to prevent freezing -- ============================================================ local logQueue = {} local queueProcessing = false local function enqueueLog(item) table.insert(logQueue, item) if not queueProcessing then queueProcessing = true task.spawn(function() while #logQueue > 0 do local current = table.remove(logQueue, 1) if current then table.insert(requestHistory, current) if current.Type == "DISCORD WEBHOOK" or string.find(string.lower(current.Url), "webhook") then print("\n=== [WEBHOOK] ===") print("Time:", current.Time) print("URL:", current.Url) print("Method:", current.Method) print("==================\n") end end task.wait(0.02) end queueProcessing = false end) end end local function processLog(url, method, headers, body, customType) if not isScanning then return false end local isWebhook = checkWebhook(url) local isHttpGetCall = (customType == "HTTP GET") or (customType == "DataModel_HttpGet") or (method == "HttpGet") if not (isWebhook or logAllTraffic or (isHttpGetCall and logHttpGet)) then return false end local logEntry = { Time = os.date("%X"), Type = customType or (isWebhook and "DISCORD WEBHOOK" or "STANDARD HTTP"), Url = tostring(url or "Unknown"), Method = tostring(method or "GET"), Headers = headers and (type(headers) == "table" and HttpService:JSONEncode(headers) or tostring(headers)) or "None", Body = body and tostring(body) or "None" } enqueueLog(logEntry) if isWebhook then OrionLib:MakeNotification({ Name = "⚠️ Webhook Intercepted!", Content = (blockAllTraffic or blockWebhooks) and "Blocked webhook request!" or "Logged webhook request.", Time = 2 }) elseif blockAllTraffic then OrionLib:MakeNotification({ Name = "🛑 Request Blocked", Content = "Blocked outgoing " .. logEntry.Method .. " to " .. logEntry.Url:sub(1, 30) .. "...", Time = 2 }) end return isWebhook end -- ============================================================ -- STEALTH INTERCEPTION: __namecall hook on the DataModel -- ============================================================ local gameMeta = getrawmetatable(game) if gameMeta then local oldNamecall = gameMeta.__namecall local function namecallHook(self, ...) local method = getnamecallmethod() if method and (method == "HttpGet" or method == "HttpPost" or method == "HttpPostAsync" or method == "HttpRequest") then local url = ... local isWebhook = checkWebhook(url) processLog(url, method, nil, nil, "DataModel_" .. method) if blockAllTraffic or (isWebhook and blockWebhooks) then if method == "HttpGet" then return "" else return { StatusCode = 403, Body = "Blocked by SynaptaHub", Success = false } end end end if oldNamecall then return oldNamecall(self, ...) elseif gameMeta.__index then local idx = gameMeta.__index(self, method) if type(idx) == "function" then return idx(self, ...) end end end local wasReadonly = false if isreadonly and setreadonly then wasReadonly = isreadonly(gameMeta) if wasReadonly then setreadonly(gameMeta, false) end end gameMeta.__namecall = newcclosure(namecallHook) if wasReadonly and setreadonly then setreadonly(gameMeta, true) end end -- [[ Hook global request functions ]] local hookedFuncs = {} local function hookHttpFunction(targetFunc) if not targetFunc or type(targetFunc) ~= "function" or hookedFuncs[targetFunc] then return end hookedFuncs[targetFunc] = true local oldFunc oldFunc = hookfunction(targetFunc, newcclosure(function(options) if type(options) == "string" then options = { Url = options, Method = "GET" } end if type(options) == "table" and options.Url then local isWebhook = processLog(options.Url, options.Method, options.Headers, options.Body, "REQUEST") if blockAllTraffic or (isWebhook and blockWebhooks) then return { StatusCode = 403, Body = "Blocked by SynaptaHub Webhook Spy", Success = false, StatusMessage = "Forbidden" } end end return oldFunc(options) end)) end local requestTargets = { request, http_request, genv.request, genv.http_request, (syn and syn.request), (fluxus and fluxus.request), (http and http.request), (krnl and krnl.request), (executor and executor.request) } for _, fn in ipairs(requestTargets) do hookHttpFunction(fn) end -- [[ Hook WebSocket.connect ]] local wsLib = WebSocket or genv.WebSocket or ws or genv.ws if wsLib and type(wsLib.connect) == "function" then local oldWSConnect oldWSConnect = hookfunction(wsLib.connect, newcclosure(function(url) processLog(url, "WS_CONNECT", nil, nil, "WEBSOCKET") if blockAllTraffic then error("WebSocket connection blocked by Webhook Spy") end return oldWSConnect(url) end)) wsConnectedHooked = true end -- ============================================================ -- UI INITIALIZATION -- ============================================================ local Window = OrionLib:MakeWindow({ Name = "SynaptaHub Webhook Spy", HidePremium = false, SaveConfig = true, ConfigFolder = "ProxyPro" }) local SpyTab = Window:MakeTab({Name = "Webhook Spy", Icon = "rbxassetid://4483345998", PremiumOnly = false}) SpyTab:AddParagraph("Advanced HTTP Interceptor", "Hooks request functions, HttpGet, and WebSockets for traffic inspection.") -- [[ Controls ]] SpyTab:AddToggle({ Name = "Enable Scanner (Continuous)", Default = isScanning, Callback = function(state) isScanning = state OrionLib:MakeNotification({ Name = "Scanner Status", Content = state and "Monitoring active..." or "Monitoring suspended.", Time = 3 }) end }) SpyTab:AddToggle({ Name = "Log ALL Non-Webhook HTTP Traffic", Default = logAllTraffic, Callback = function(state) logAllTraffic = state end }) SpyTab:AddToggle({ Name = "Log HttpGet Calls", Default = logHttpGet, Callback = function(state) logHttpGet = state end }) SpyTab:AddToggle({ Name = "Block Intercepted Webhooks", Default = blockWebhooks, Callback = function(state) blockWebhooks = state OrionLib:MakeNotification({ Name = "Webhook Protection", Content = state and "Discord webhooks will now be dropped." or "Webhook blocking disabled.", Time = 3 }) end }) SpyTab:AddToggle({ Name = "Block All Intercepted Traffic", Default = blockAllTraffic, Callback = function(state) blockAllTraffic = state OrionLib:MakeNotification({ Name = "Traffic Firewall", Content = state and "ALL outbound requests will be blocked!" or "Outbound requests allowed.", Time = 3 }) end }) -- [[ Data Control Actions ]] SpyTab:AddButton({ Name = "Copy All Logs to Clipboard", Callback = function() local report = compileReport() if not report then OrionLib:MakeNotification({ Name = "Clipboard Action", Content = "No logs captured yet!", Time = 3 }) return end local ok, err = pcall(setclipboard, report) if not ok then OrionLib:MakeNotification({ Name = "Clipboard Error", Content = "Failed to copy: " .. tostring(err), Time = 4 }) return end OrionLib:MakeNotification({ Name = "Success!", Content = tostring(#requestHistory) .. " logs compiled and copied to clipboard.", Time = 5 }) end }) SpyTab:AddButton({ Name = "Clear Interception History", Callback = function() requestHistory = {} lastCopiedCount = 0 OrionLib:MakeNotification({ Name = "History Status", Content = "Stored internal traffic data cleared.", Time = 3 }) end }) -- ============================================================ -- FIXED AUTO-COPY TOGGLE -- ============================================================ local autoCopyActive = false local autoCopyThread = nil SpyTab:AddToggle({ Name = "🔁 Auto-Copy Logs to Clipboard (every 1s)", Default = false, Callback = function(state) autoCopyActive = state if state then if autoCopyThread then task.cancel(autoCopyThread) end OrionLib:MakeNotification({ Name = "Auto-Copy Started", Content = "Logs will be copied to clipboard every second.", Time = 3 }) autoCopyThread = task.spawn(function() print("[Auto-Copy] Thread started") while autoCopyActive do local report = compileReport() if report and #requestHistory > lastCopiedCount then local ok, err = pcall(setclipboard, report) if ok then lastCopiedCount = #requestHistory print(string.format("[Auto-Copy] Copied %d logs at %s", lastCopiedCount, os.date("%X"))) OrionLib:MakeNotification({ Name = "📋 Auto-Copy", Content = string.format("Copied %d logs to clipboard", lastCopiedCount), Time = 1 }) else warn("[Auto-Copy] Failed to copy: " .. tostring(err)) end end task.wait(1) end print("[Auto-Copy] Thread stopped") end) else if autoCopyThread then task.cancel(autoCopyThread) autoCopyThread = nil end lastCopiedCount = 0 OrionLib:MakeNotification({ Name = "Auto-Copy Stopped", Content = "Auto-copy of logs disabled.", Time = 2 }) end end }) -- [[ Test suite & copy results ]] local testResultsOutput = "" SpyTab:AddButton({ Name = "⚡ Run Full Protection Test Suite", Callback = function() OrionLib:MakeNotification({ Name = "Test Environment", Content = "Running SynaptaHub Interception Tests...", Time = 3 }) task.spawn(function() local testResultLines = {} local function addResultLine(line) table.insert(testResultLines, line) print(line) end local passed, failed, skipped = 0, 0, 0 local startTime = tick() local function test(name, fn) local startTestTime = tick() local ok, result = pcall(fn) local duration = math.floor((tick() - startTestTime) * 1000) if ok and result ~= false then passed = passed + 1 addResultLine(string.format(" [✅ PASS] %-40s (%dms)", name, duration)) else failed = failed + 1 addResultLine(string.format(" [❌ FAIL] %-40s (%dms) -> %s", name, duration, tostring(result))) end end local function skip(name, reason) skipped = skipped + 1 addResultLine(string.format(" [⚠️ SKIP] %-40s -> %s", name, reason)) end addResultLine("\n============================================================") addResultLine(" SYNAPTAHUB – FULL PROTECTION TEST SUITE ") addResultLine("============================================================") -- Category 1: Stealth addResultLine("\n┌── [ CATEGORY: Stealth & Anti-Detection ] ────────────────┐") test("game.HttpGet is still a C closure", function() return iscclosure and iscclosure(game.HttpGet) == true end) test("game.HttpGet debug info shows 'C'", function() if not debug or not debug.getinfo then return false end local info = debug.getinfo(game.HttpGet) return info and info.what == "C" end) test("__namecall hook is installed correctly", function() local meta = getrawmetatable(game) return meta and meta.__namecall ~= nil end) test("Raw __index returns the same HttpGet function", function() local meta = getrawmetatable(game) if not meta or not meta.__index then return false end local rawHttpGet = meta.__index(game, "HttpGet") return rawHttpGet == game.HttpGet end) -- Category 2: Logging addResultLine("\n┌── [ CATEGORY: Logging & Interception ] ──────────────────┐") local function clearLogs() requestHistory = {} lastCopiedCount = 0 end clearLogs() test("Logging of non-webhook GET request (via game:HttpGet)", function() clearLogs() local _ = game:HttpGet("https://httpbin.org/get") task.wait(0.1) return #requestHistory >= 1 end) test("Logging of webhook request (via game:HttpGet)", function() clearLogs() local _ = game:HttpGet("https://discord.com/api/webhooks/123/abc") task.wait(0.1) return #requestHistory >= 1 end) test("Logging of request function (global)", function() clearLogs() local req = request or http_request or genv.request or genv.http_request if not req then return false end req({ Url = "https://httpbin.org/get", Method = "GET" }) task.wait(0.1) return #requestHistory >= 1 end) -- Category 3: Blocking addResultLine("\n┌── [ CATEGORY: Blocking & Firewall ] ─────────────────────┐") local savedBlockWebhooks = blockWebhooks local savedBlockAll = blockAllTraffic local savedLogAll = logAllTraffic logAllTraffic = true test("Webhook blocking (enabled)", function() blockWebhooks = true local req = request or http_request or genv.request or genv.http_request if not req then return false end local resp = req({ Url = "https://discord.com/api/webhooks/123/abc", Method = "POST", Body = "test" }) blockWebhooks = savedBlockWebhooks return resp and resp.StatusCode == 403 end) test("All-traffic blocking (enabled)", function() blockAllTraffic = true local req = request or http_request or genv.request or genv.http_request if not req then return false end local resp = req({ Url = "https://httpbin.org/get", Method = "GET" }) blockAllTraffic = savedBlockAll return resp and resp.StatusCode == 403 end) blockWebhooks = savedBlockWebhooks blockAllTraffic = savedBlockAll logAllTraffic = savedLogAll -- Category 4: Kick addResultLine("\n┌── [ CATEGORY: Anti-Kick & Auto-Save ] ───────────────────┐") test("LocalPlayer:Kick is hooked and protected", function() return kickHooked == true end) test("Kick triggers clipboard save (simulated)", function() local ok = pcall(emergencyClipboardSave) return ok end) -- Category 5: WebSocket addResultLine("\n┌── [ CATEGORY: WebSocket Protection ] ────────────────────┐") local wsConnect = wsLib and wsLib.connect if wsConnect then test("WebSocket.connect is hooked", function() return wsConnectedHooked == true end) test("WebSocket connection is logged (or blocked)", function() clearLogs() local ok, err = pcall(function() local wsInst = wsConnect("wss://echo.websocket.events") if wsInst and wsInst.Close then wsInst:Close() end end) task.wait(0.1) return #requestHistory >= 1 or (err and string.find(tostring(err), "blocked")) end) else skip("WebSocket.connect is available", "No WebSocket library found") end -- Category 6: Environment addResultLine("\n┌── [ CATEGORY: Environment & Global Safety ] ─────────────┐") test("No extraneous global variables injected", function() local ourNames = {"OrionLib", "HttpService", "requestHistory", "webhookDomains", "isScanning", "logAllTraffic", "blockWebhooks", "blockAllTraffic"} local g = getgenv and getgenv() or _G for _, name in ipairs(ourNames) do if g[name] ~= nil then return false end end return true end) -- Category 7: Performance addResultLine("\n┌── [ CATEGORY: Performance & Latency ] ───────────────────┐") test("Request latency within acceptable bounds (< 500ms)", function() local req = request or http_request or genv.request or genv.http_request if not req then return false end local start = tick() req({ Url = "https://httpbin.org/get", Method = "GET" }) local elapsed = (tick() - start) * 1000 return elapsed < 500 end) -- Summary local totalTime = string.format("%.2f", tick() - startTime) local totalTests = passed + failed + skipped local rate = totalTests > 0 and math.floor((passed / (passed + failed)) * 100) or 0 addResultLine("\n============================================================") addResultLine(string.format(" Protection Summary | Score: %d%% Pass Rate", rate)) addResultLine(string.format(" • Passed: %d", passed)) addResultLine(string.format(" • Failed: %d", failed)) addResultLine(string.format(" • Skipped: %d", skipped)) addResultLine(string.format(" • Execution Time: %ss", totalTime)) addResultLine("============================================================\n") testResultsOutput = table.concat(testResultLines, "\n") OrionLib:MakeNotification({ Name = "Test Suite Complete", Content = string.format("Passed: %d | Failed: %d | Skipped: %d (%d%% Pass Rate)", passed, failed, skipped, rate), Time = 5 }) end) end }) SpyTab:AddButton({ Name = "📋 Copy Test Results to Clipboard", Callback = function() if testResultsOutput == "" then OrionLib:MakeNotification({ Name = "No Test Results", Content = "Please run test suite first.", Time = 3 }) return end local ok, err = pcall(setclipboard, testResultsOutput) if not ok then OrionLib:MakeNotification({ Name = "Clipboard Error", Content = "Failed to copy: " .. tostring(err), Time = 4 }) return end OrionLib:MakeNotification({ Name = "Test Results Copied!", Content = "Full test report is now in your clipboard.", Time = 4 }) end }) OrionLib:Init()