eris: move lua API to standalone module
Easier to work with now, yay.
This commit is contained in:
parent
a2fc2bf2bc
commit
54f858aee9
5 changed files with 297 additions and 127 deletions
17
resources/default_script.lua
Normal file
17
resources/default_script.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue