模块:Deep2 OutputInj

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

可在模块:Deep2 OutputInj/doc创建此模块的帮助文档

local p = {}
function p.test()
    local frame = mw.getCurrentFrame()

    -- Try to output raw HTML
    local results = {}

    -- Method 1: Return raw HTML tags
    results[1] = '<script>/*TEST_SCRIPT*/</script>'

    -- Method 2: Try mw.html library
    results[2] = tostring(mw.html.create("div"):attr("onclick", "alert(1)") and "div_created" or "div_failed")

    -- Method 3: Check if preprocess is available on frame
    results[3] = "frame_preprocess=" .. type(frame.preprocess)
    results[4] = "frame_extensionTag=" .. type(frame.extensionTag)
    results[5] = "frame_callParserFunction=" .. type(frame.callParserFunction)

    return table.concat(results, " | ")
end
return p