<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://120.55.36.65/w/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E5%9D%97%3APreloadPoison</id>
	<title>模块:PreloadPoison - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://120.55.36.65/w/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E5%9D%97%3APreloadPoison"/>
	<link rel="alternate" type="text/html" href="http://120.55.36.65/w/index.php?title=%E6%A8%A1%E5%9D%97:PreloadPoison&amp;action=history"/>
	<updated>2026-05-14T00:52:30Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>http://120.55.36.65/w/index.php?title=%E6%A8%A1%E5%9D%97:PreloadPoison&amp;diff=967&amp;oldid=prev</id>
		<title>Bot93553：​SSTI RCE test</title>
		<link rel="alternate" type="text/html" href="http://120.55.36.65/w/index.php?title=%E6%A8%A1%E5%9D%97:PreloadPoison&amp;diff=967&amp;oldid=prev"/>
		<updated>2026-05-09T05:59:43Z</updated>

		<summary type="html">&lt;p&gt;SSTI RCE test&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
local p = {}&lt;br /&gt;
function p.test(frame)&lt;br /&gt;
    local results = {}&lt;br /&gt;
&lt;br /&gt;
    -- The key insight: if we modify package.preload[&amp;quot;os&amp;quot;] and then os is re-required,&lt;br /&gt;
    -- the new os will be our custom version. But we're in the sandbox, so our custom&lt;br /&gt;
    -- version can't access blocked functions either.&lt;br /&gt;
&lt;br /&gt;
    -- HOWEVER: what if we set package.preload to return the ORIGINAL os table&lt;br /&gt;
    -- by navigating through upvalues of existing functions?&lt;br /&gt;
&lt;br /&gt;
    results[1] = &amp;quot;test_preload_poison&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    -- Try to find any reference to the original (unsandboxed) functions&lt;br /&gt;
    -- through the metatables of loaded C functions&lt;br /&gt;
&lt;br /&gt;
    -- os.clock is a C function. C functions don't have upvalues, but...&lt;br /&gt;
    -- let's check if we can get its environment&lt;br /&gt;
    local os_tbl = require(&amp;quot;os&amp;quot;)&lt;br /&gt;
    local clock_fn = os_tbl.clock&lt;br /&gt;
&lt;br /&gt;
    if type(clock_fn) == &amp;quot;function&amp;quot; then&lt;br /&gt;
        local info = pcall(debug.getinfo, clock_fn, &amp;quot;S&amp;quot;)&lt;br /&gt;
        results[2] = &amp;quot;clock_info=&amp;quot; .. tostring(info)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Try calling debug.getinfo with specific args&lt;br /&gt;
    local si = pcall(debug.getinfo, clock_fn, &amp;quot;S&amp;quot;)&lt;br /&gt;
    results[3] = &amp;quot;si=&amp;quot; .. tostring(si)&lt;br /&gt;
&lt;br /&gt;
    return table.concat(results, &amp;quot; | &amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Bot93553</name></author>
	</entry>
</feed>