Posted 28 December 2017 - 08:41 PM
Well I'm pretty new to the Lua scripting language but I decided to make a somewhat useful bundle of programs
particularly aimed at getting around password-protected computers.
The first program is simple. os.pullEvent is there to prevent the computer from disabling the CTRL+T function to kill the current running program.
The second program scans the programs directory and the root directory. Then it compares its findings to a whitelist and finally returns the user-created programs to an array.
Finally, foreach item in this array, it will open the file and scan for quotations then returns that line with the quotes to another array.
The program then displays these lines from the array.
Requirements : Computer needs disk-drive attached
First Program :
Second Program :
particularly aimed at getting around password-protected computers.
The first program is simple. os.pullEvent is there to prevent the computer from disabling the CTRL+T function to kill the current running program.
The second program scans the programs directory and the root directory. Then it compares its findings to a whitelist and finally returns the user-created programs to an array.
Finally, foreach item in this array, it will open the file and scan for quotations then returns that line with the quotes to another array.
The program then displays these lines from the array.
Requirements : Computer needs disk-drive attached
First Program :
term.clear()
term.setCursorPos(1,1)
os.pullEvent = os.pullEvent
print("Bypass by Codex")
Second Program :
--functions
function valid(data, array)
local valid = {}
for i = 1, #array do
valid[array[i]] = true
end
if valid[data] then
return false
else
return true
end
end
function tablefind(tab, el)
for index, value in pairs(tab) do
if value == el then
return index
end
end
end
function lines(s)
if s:sub(-1)~="\n" then
s=s.."\n"
end
return s:gmatch("(.-)\n")
end
--functions
print("Checking Programs . . .")
local FileList = fs.list("/rom/programs")
local MainList = fs.list("/")
local Whitelist = {"advanced", "command", "fun", "http", "pocket", "rednet", "turtle", "adventure.lua", "alias.lua", "apis.lua", "bg.lua", "copy.lua", "clear.lua", "chat.lua", "cd.lua", "delete.lua", "dj.lua", "drive.lua", "edit.lua", "gps.lua", "fg.lua", "exit.lua", "eject.lua", "hello.lua", "help.lua", "id.lua", "label.lua", "monitor.lua", "mkdir.lua", "lua.lua", "list.lua", "move.lua", "multishell.lua", "paint.lua", "pastebin.lua", "redirection.lua", "reboot.lua", "programs.lua", "peripherals.lua", "redstone.lua", "rename.lua", "repeat.lua", "set.lua", "type.lua", "time.lua", "shutdown.lua", "shell.lua", "wget.lua", "worm.lua"}
FoundFiles = {}
-- RootFiles = {}
miscFiles = {}
for _, file in ipairs(FileList) do
table.insert(FoundFiles, file)
print("Found Item : "..file)
sleep(0.1)
end
print("Checking Root . . .")
for _, file in ipairs(MainList) do
table.insert(FoundFiles, file)
print("Found Item : "..file)
sleep(0.1)
end
table.sort(Whitelist)
table.sort(FoundFiles)
table.sort(MainList)
table.sort(FileList)
--table.sort(RootFiles)
print("Comparing Files . . .")
for _, foundfile in ipairs(FoundFiles) do
if not valid(foundfile, Whitelist) then
else
table.insert(miscFiles, foundfile)
print("Possible script : "..foundfile)
end
end
print("Finalizing Search . . .")
HackFiles = {}
table.sort(miscFiles)
for _, afile in ipairs(miscFiles) do
if afile == "rom" then
--return
elseif afile == "disk" then
--return
else
table.insert(HackFiles, afile)
end
end
print("Listing user-made programs . . .")
for _, bfile in ipairs(HackFiles) do
print("Found : "..bfile)
end
PPass = {}
for _, foundfile in ipairs(HackFiles) do
content = fs.open(foundfile, "r")
--print(content.readAll())
for line in lines(content.readAll()) do
if string.find(line, '"') then
table.insert(PPass, line)
end
end
end
print("DONE!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
print("Possible Passwords (in quotes)")
for _, pass in ipairs(PPass) do
print(pass)
end