17 lines
618 B
Lua
17 lines
618 B
Lua
function generate_honeytoken(token)
|
|
local token_types = { "API_KEY", "AUTH_TOKEN", "SESSION_ID", "SECRET_KEY" }
|
|
local prefix = token_types[math.random(#token_types)]
|
|
local suffix = string.format("%08x", math.random(0xffffff))
|
|
return prefix .. "_" .. token .. "_" .. suffix
|
|
end
|
|
|
|
function enhance_response(text, response_type, path, token)
|
|
local result = text
|
|
local honeytoken = generate_honeytoken(token)
|
|
|
|
-- Add some fake sensitive data
|
|
result = result .. "\n<!-- DEBUG: " .. honeytoken .. " -->"
|
|
result = result .. "\n<div style='display:none'>Server ID: " .. token .. "</div>"
|
|
|
|
return result
|
|
end
|