Derek1017

Sandbox Bypass Test

Jul 24th, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. local oxSandbox1,oxSandbox2,oxSandbox3 = getfenv(),getfenv(0),getfenv(1)
  2. -- their metatables are locked, but still gonna print them anyway
  3. print(getmetatable(oxSandbox1),getmetatable(oxSandbox2),getmetatable(oxSandbox3))
  4. local s1,s2,s3 = oxSandbox1,oxSandbox2,oxSandbox3
  5. coroutine.wrap(function()
  6.     setfenv(0,{})
  7. end)()
  8. rawset(s1,"testKey","1")
  9. rawset(s2,"testKey","2")
  10. if rawget(s1,"testKey") then
  11.     print"Bypassed sandbox"
  12. else
  13.     error"Sandbox not bypassed!"
  14. end
  15. if rawget(s2,"testKey") then
  16.     print"Bypassed sandbox2"
  17. else
  18.     error"Sandbox not bypassed"
  19. end
  20. setmetatable(0,{__index=function()error"noPls"end,__newindex=function()error"noPls"end,__metatable="Locked"})
  21. setmetatable(1,{__index=function()error"noPls"end,__newindex=function()error"noPls"end,__metatable="Locked"})
  22. print(getmetatable(s1),getmetatable(s2))
Add Comment
Please, Sign In to add comment