Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --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
Add Comment
Please, Sign In to add comment