From 16da0a1837306c0159a37b859c889a150238944a Mon Sep 17 00:00:00 2001 From: Bommels05 <69975756+Bommels05@users.noreply.github.com> Date: Mon, 20 Oct 2025 16:18:50 +0200 Subject: [PATCH] Add Befator Inc Security --- bios.lua | 22 +++++++++++++ installer.lua | 3 ++ security.lua | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 bios.lua create mode 100644 security.lua diff --git a/bios.lua b/bios.lua new file mode 100644 index 0000000..33f1b5e --- /dev/null +++ b/bios.lua @@ -0,0 +1,22 @@ +local function main() + print("Befator Inc Security: Starting Computer...") + if not fs.exists("security.lua") or not fs.exists("real_startup.lua") then + term.setTextColour(colors.red) + write("Befator Inc Security: System Integrity failure") + while true do + local i = 0 + while i < 3 do + write(".") + os.sleep(1) + i = i + 1 + end + write("\nReinstallation required") + os.sleep(1) + end + else + shell.execute("security.lua") + end +end + +pcall(main) +shell.execute("reboot") \ No newline at end of file diff --git a/installer.lua b/installer.lua index 66623cb..bebf0e6 100644 --- a/installer.lua +++ b/installer.lua @@ -219,6 +219,9 @@ local cor = coroutine.create( lStore.store("installer/packagenext.lua") lStore.store("installer/licensenextclicky.lua") + lStore.store("security.lua") + lStore.store("bios.lua") + local ok, err = pcall(function() lStore.run("Installer.sgui") end) if not ok then printError(err) diff --git a/security.lua b/security.lua new file mode 100644 index 0000000..badf281 --- /dev/null +++ b/security.lua @@ -0,0 +1,88 @@ +--Disable Shell +--multishell.setTitle = function() +-- error("Access Denied") +--end +--shell.execute = multishell.setTitle + +--Disable Store, Cloud +http.request = function() + return false, "Network Access Denied" +end +--http.post = http.get + +--Disable Lua +local originalWrite = _G.write +_G.write = function(text) + if text == "lua> " then + error("Befator Inc Security: Lua Interpreter Access Denied") + end + return originalWrite(text) +end + +--Protect self and disable rom +local function shouldProtect(path) + return fs.getName(path) == "security.lua" +end + +local originalOpen = fs.open +fs.open = function(path, mode) + if (shouldProtect(path) or path:find("^rom/programs") ~= nil) then + error("Befator Inc Security: Access Denied") + else + return originalOpen(path, mode) + end +end +local origininalDel = fs.delete +fs.delete = function(path) + if shouldProtect(path) then + error("Befator Inc Security: Access Denied") + else + return origininalDel(path) + end +end +local origininalMove = fs.move +fs.move = function(path, dest) + if shouldProtect(path) then + error("Befator Inc Security: Access Denied") + else + return origininalMove(path, dest) + end +end +local origininalCopy = fs.copy +fs.copy = function(path, dest) + if shouldProtect(path) then + error("Befator Inc Security: Access Denied") + else + return origininalCopy(path, dest) + end +end +local origininalExists = fs.exists +fs.exists = function(path) + if shouldProtect(path) then + return false + else + return origininalExists(path) + end +end +local origininalList = fs.list +fs.list = function(path) + local ls = origininalList(path) + for i=#ls,1,-1 do + if ls[i] == "security.lua" then + table.remove(ls, i) + end + end + return ls +end + +--OS Config +fs.delete("/User/Desktop/Cloud.llnk") +fs.delete("/User/Desktop/Store.llnk") +fs.delete("/LevelOS/Global_Login.lua") +fs.delete("/LevelOS/data/changelog.lconf") +--Force Login Screen +local f = fs.open("/LevelOS/data/account.txt", "w") +f.write("Befator's Sklave") +f.close() + +shell.execute("real_startup")