Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.exists("secure") then
- shell.run("pastebin get r8AFFkbV secure")
- end
- if not secure then
- os.loadAPI("secure")
- end
- local mo = {}
- local ver = "1.0"
- local website = ""
- local function readf(file)
- local fl = fs.open(file, "r")
- local d = fl.readAll()
- fl.close()
- return d
- end
- for k,v in pairs(peripheral.getNames()) do
- if peripheral.getType(v) == "modem" and peripheral.call(v, "isWireless") == true then
- mo = peripheral.wrap(v)
- end
- end
- assert(mo ~= {}, "A wireless modem is needed!")
- mo.open(337) --Amethyst DNS channel
- parallel.waitForAll(function()
- secure.connectionHandler(mo)
- end, function()
- while true do
- local _, s, sen, rep, msg = os.pullEvent("modem_message")
- if msg == "DNSAMETHYST" then
- print("DNS ping from ID "..tostring(rep.." (this may be spoofed, no way of verifying!)"))
- mo.transmit(338, os.getComputerID(), "DNS::"..tostring(website))
- elseif msg:sub(1, 7) == "WHOIS::" then
- mo.transmit(338, os.getComputerID(), "IAM::"..tostring(website))
- end
- end
- end,
- function()
- while true do
- local _, id, cid, msg = os.pullEvent("secure_receive")
- msg = tostring(msg)
- sendTunnel(mo, cid, readf(msg))
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment