Ujsjjw73hbw

Untitled

Mar 5th, 2025
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.74 KB | None | 0 0
  1. local uilib = loadstring(game:HttpGet("https://raw.githubusercontent.com/knockzoo/HTTP-Spy/main/ui.lua"))()
  2.  
  3. local executor, version = identifyexecutor()
  4. local functions = { request, http_request, (http and http.request) or nil }
  5.  
  6. local band
  7. local bxor
  8. local bnot
  9. local lshift
  10. local rshift1
  11. local rshift
  12. local random = {}
  13.  
  14. local sub = string.sub
  15. local floor = math.floor
  16.  
  17. do -- https://gist.github.com/lukespragg/d3d939ec534db920eab8
  18.     local MOD = 2 ^ 32
  19.     local MODM = MOD - 1
  20.     local function memoize(f)
  21.         local mt = {}
  22.         local t = setmetatable({}, mt)
  23.         function mt:__index(k)
  24.             local v = f(k)
  25.             t[k] = v
  26.             return v
  27.         end
  28.  
  29.         return t
  30.     end
  31.     local function make_bitop_uncached(t, m)
  32.         local function bitop(a, b)
  33.             local res, p = 0, 1
  34.             while a ~= 0 and b ~= 0 do
  35.                 local am, bm = a % m, b % m
  36.                 res = res + t[am][bm] * p
  37.                 a = (a - am) / m
  38.                 b = (b - bm) / m
  39.                 p = p * m
  40.             end
  41.             res = res + (a + b) * p
  42.             return res
  43.         end
  44.         return bitop
  45.     end
  46.     local function make_bitop(t)
  47.         local op1 = make_bitop_uncached(t, 2 ^ 1)
  48.         local op2 =
  49.             memoize(
  50.                 function(a)
  51.                     return memoize(
  52.                         function(b)
  53.                             return op1(a, b)
  54.                         end
  55.                     )
  56.                 end
  57.             )
  58.         return make_bitop_uncached(op2, 2 ^ (t.n or 1))
  59.     end
  60.  
  61.     local bxor1 = make_bitop({ [0] = { [0] = 0, [1] = 1 }, [1] = { [0] = 1, [1] = 0 }, n = 4 })
  62.     bxor = function(a, b, c, ...)
  63.         local z = nil
  64.         if b then
  65.             a = a % MOD
  66.             b = b % MOD
  67.             z = bxor1(a, b)
  68.             if c then
  69.                 z = bxor(z, c, ...)
  70.             end
  71.             return z
  72.         elseif a then
  73.             return a % MOD
  74.         else
  75.             return 0
  76.         end
  77.     end
  78.  
  79.     band = function(a, b, c, ...)
  80.         local z
  81.         if b then
  82.             a = a % MOD
  83.             b = b % MOD
  84.             z = ((a + b) - bxor1(a, b)) / 2
  85.             return z
  86.         elseif a then
  87.             return a % MOD
  88.         else
  89.             return MODM
  90.         end
  91.     end
  92.  
  93.     bnot = function(x)
  94.         return (-1 - x) % MOD
  95.     end
  96.  
  97.     rshift1 = function(a, disp)
  98.         if disp < 0 then
  99.             return lshift(a, -disp)
  100.         end
  101.         return floor(a % 2 ^ 32 / 2 ^ disp)
  102.     end
  103.  
  104.     rshift = function(x, disp)
  105.         if disp > 31 or disp < -31 then
  106.             return 0
  107.         end
  108.         return rshift1(x % MOD, disp)
  109.     end
  110.  
  111.     lshift = function(a, disp)
  112.         if disp < 0 then
  113.             return rshift(a, -disp)
  114.         end
  115.         return (a * 2 ^ disp) % 2 ^ 32
  116.     end
  117.  
  118.     local function seedgen()
  119.         return os.clock() + tick() ^ 2
  120.     end
  121.  
  122.     local original = seedgen
  123.  
  124.     local rng = function(seed)
  125.         local a = 1103515245
  126.         local c = 12345
  127.         seed = (a * seed + c) % (2 ^ 31)
  128.         local d = seed / (2 ^ 31)
  129.  
  130.         return function(min, max)
  131.             min = min or 0
  132.             max = max or 1
  133.             if min > max then
  134.                 min, max = max, min
  135.             end
  136.             return d * (max - min) + min
  137.         end
  138.     end
  139.  
  140.     local calls = 0
  141.     local gen = rng(seedgen())
  142.     function random.int(min, max)
  143.         gen = rng(seedgen())
  144.         return floor(gen(min, max))
  145.     end
  146.  
  147.     function random.string(len)
  148.         local chars = "abcdefghijklmnopqrstuvxwyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
  149.         local r = ''
  150.         for i = 1, len do
  151.             local n = random.int(1, #chars)
  152.             r = r .. sub(chars, n, n)
  153.         end
  154.         return r
  155.     end
  156.  
  157.     function random.setseed(seed)
  158.         if seed then
  159.             seedgen = function() return seed end
  160.         else
  161.             seedgen = original
  162.         end
  163.     end
  164. end
  165.  
  166. local function generatehwid()
  167.     local template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
  168.     return string.gsub(template, '[xy]', function(c)
  169.         local v = (c == 'x') and random.int(0, 15) or random.int(8, 11)
  170.         return string.format('%x', v)
  171.     end):upper()
  172. end
  173.  
  174. local function generateip() -- couldnt be bothered, thanks chatgpt
  175.     local startipdec = 0
  176.     local endipdec = 4294967295
  177.  
  178.     local randomipdec = random.int(startipdec, endipdec)
  179.  
  180.     local a = rshift(band(randomipdec, 0xFF000000), 24)
  181.     local b = rshift(band(randomipdec, 0x00FF0000), 16)
  182.     local c = rshift(band(randomipdec, 0x0000FF00), 8)
  183.     local d = band(randomipdec, 0x000000FF)
  184.  
  185.     return string.format("%d.%d.%d.%d", a, b, c, d)
  186. end
  187.  
  188. local fakehwid, fakeip = generatehwid(), generateip()
  189. local actualhwid, actualip = game:GetService("RbxAnalyticsService"):GetClientId(), game:HttpGet("https://api.ipify.org/")
  190.  
  191. local function sanitize(s)
  192.     s = s:gsub(actualhwid, fakehwid, 1000)
  193.     s = s:gsub(actualip, fakeip, 1000)
  194.  
  195.     return s
  196. end
  197.  
  198. local function search(s)
  199.     local news = s
  200.     local lowered = news:lower()
  201.     local flagged = false
  202.     if lowered:match(actualip) or lowered:match(fakeip) then -- ip info
  203.         flagged = true
  204.     end
  205.  
  206.     if lowered:match(actualhwid) or lowered:match(fakehwid) then -- hwid info
  207.         flagged = true
  208.     end
  209.  
  210.     if lowered:match("webhook") or lowered:match("ip") or lowered:match("httpbin") then -- logging / extra info
  211.         flagged = true
  212.     end
  213.  
  214.     return flagged
  215. end
  216.  
  217. local serializer
  218. do
  219.     local sub = string.sub
  220.     local find = string.find
  221.     local format = string.format
  222.     local gsub = string.gsub
  223.     local dump = string.dump
  224.     local byte = string.byte
  225.     local rep = string.rep
  226.     local concat = table.concat
  227.     local insert = table.insert
  228.     local type = type
  229.     local tostring = tostring
  230.     local pairs = pairs
  231.     local huge = math.huge
  232.     local nhuge = -huge
  233.    
  234.     local newline = '\n'
  235.     local newline2 = '\\n'
  236.    
  237.     local tab = '\t'
  238.     local tab2 = '\\t'
  239.    
  240.     local function mutate(str, q)
  241.         local mutated = {}
  242.         local length = #str
  243.         local i = 0
  244.         while i < length do
  245.             i = i + 1
  246.    
  247.             local c = sub(str, i, i)
  248.             if c == newline then
  249.                 c = newline2
  250.             elseif c == tab then
  251.                 c = tab2
  252.             else
  253.                 if (q == 1 or q == 3) and c == "'" then
  254.                     c = "\\'"
  255.                 end
  256.    
  257.                 if (q == 2 or q == 3) and c == '"' then
  258.                     c = '\\"'
  259.                 end
  260.             end
  261.    
  262.             insert(mutated, c)
  263.         end
  264.    
  265.         return concat(mutated)
  266.     end
  267.    
  268.     local function quotes(str)
  269.         local dq = find(str, '"')
  270.         local sq = find(str, "'")
  271.    
  272.         local c = 0
  273.         if dq then c = c + 2 end
  274.         if sq then c = c + 1 end
  275.    
  276.         return format('"%s"', mutate(str, c))
  277.     end
  278.    
  279.     local function serializedata(data)
  280.         if not data then
  281.             return 'nil'
  282.         end
  283.    
  284.         local typeof = type(data)
  285.    
  286.         if typeof == 'string' then
  287.             return quotes(data)
  288.         elseif typeof == 'boolean' then
  289.             return (data and 'true' or 'false')
  290.         end
  291.    
  292.         local ts = tostring(data)
  293.    
  294.         if typeof == 'number' then
  295.             if data == huge then
  296.                 return 'math.huge'
  297.             elseif data == nhuge then
  298.                 return '-math.huge'
  299.             end
  300.    
  301.             if settings.PrioritizeCompression then
  302.                 local h = format('0x%x', data)
  303.                 if #h < #ts then
  304.                     return (h)
  305.                 end
  306.             end
  307.         elseif typeof == 'function' then
  308.             if settings.PrioritizeCompression then
  309.                 return format('--[[%s]]', ts)
  310.             else
  311.                 return format("function(...) return loadstring(\"%s\")(...); end", gsub(dump(data), ".", function(k) return "\\" .. byte(k); end)) -- thanks leopard, very neat
  312.             end
  313.         elseif typeof == 'table' then
  314.             return nil
  315.         end
  316.    
  317.         return (ts)
  318.     end
  319.    
  320.     serializer = function(tbl, level, checked)
  321.         checked = checked or {}
  322.         level = level or 1
  323.    
  324.         if checked[tbl] then
  325.             return 'tbl'
  326.         end
  327.    
  328.         checked[tbl] = true
  329.    
  330.         local result = { '{\n' }
  331.         for i, v in pairs(tbl) do
  332.             local sd = serializedata(v)
  333.             if sd ~= nil then
  334.                 insert(result, format('%s[%s] = %s,\n', rep("\t", level), serializedata(i) or '', sd))
  335.             else
  336.                 insert(result, format('%s[%s] = %s,\n', rep("\t", level), serializedata(i), serializer(v, level + 1, checked)))
  337.             end
  338.         end
  339.    
  340.         result = concat(result)
  341.         result = format("%s\n%s}", sub(result, 0, #result - 2), rep('\t', level - 1))
  342.         return result
  343.     end
  344. end
  345.  
  346. local hook = function(args, old)
  347.     local newargs = args
  348.  
  349.     if getmetatable(newargs) then
  350.         if not pcall(setmetatable(newargs, { __pairs = function(self) return next, self, nil end })) then
  351.             uilib.notif("Error", "The anti HTTP spy used has anti-dump methods preventing secure logging from being possible.")
  352.             return old(newargs)
  353.         end
  354.     end
  355.  
  356.     newargs.Method = newargs.Method or "GET"
  357.  
  358.     if newargs.Url then
  359.         newargs.Url = sanitize(newargs.Url)
  360.     end
  361.  
  362.     if newargs.Body then
  363.         if type(newargs.Body) == 'string' then
  364.             newargs.Body = sanitize(newargs.Body)
  365.         end
  366.     end
  367.  
  368.     local sent = serializer(newargs)
  369.     local result = old(newargs)
  370.  
  371.     if result.Body then
  372.         result.Body = sanitize(result.Body)
  373.     end
  374.  
  375.     local flagged = search(newargs.Url or "") or search(newargs.Body or "") or search(result.Body or "")
  376.  
  377.     local received = {}
  378.     local s, decoded = pcall(function() return game.HttpService.JSONDecode(result.Body) end)
  379.  
  380.     if s and type(decoded) == 'table' then
  381.         received = serializer({ Headers = result.Headers, Body = decoded })
  382.     else
  383.         received = serializer({ Headers = result.Headers, Body = result.Body })
  384.     end
  385.  
  386.     uilib.createlog(newargs.Url, tostring(newargs.Method), tostring(flagged), received, sent)
  387.  
  388.     return result
  389. end
  390.  
  391. for i, v in pairs(functions) do
  392.     local old = v
  393.     old = hookfunction(v, newcclosure(function(args)
  394.         return hook(args, old)
  395.     end))
  396.  
  397.     if executor == 'Valyse' or executor == 'Electron' or executor == 'Krampus' then
  398.         break
  399.     end
  400. end
  401.  
  402. print("HTTP Spy [Lite] loaded in")
  403.  
  404. request({Url = "https://lucycat.pics", Method="GET"})
Advertisement
Add Comment
Please, Sign In to add comment