Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This will remove a nasty virus from the computer and put it back in shape.
- -- URL to virus: http://www.computercraft.info/forums2/index.php?/topic/1102-a-decent-evalquine-resident-virus/
- -- Pastebin: A51AN5xC
- -- Run the following code on the infected machine:
- -- ' /rom/programs/http/pastebin.lua run hnF94pw2 '
- local infectedFiles = 0
- local cleanFiles = 0
- if (fs.exists("SafeDisk.lua")) then
- fs.delete("SafeDisk.lua")
- end
- local FileList = fs.list("") -- Table with all the files and directories available
- for _, file in ipairs(FileList) do
- local reader = fs.open(file, "r") -- Try to open the file, errors if directory
- if reader then -- Is a file
- local content = reader.readAll() -- Read contents from file
- local isInfected = string.find(content, "xpayload" ) -- Checks if the file is infected
- reader.close()
- if isInfected then
- fs.delete(file)
- infectedFiles = infectedFiles + 1
- else
- cleanFiles = cleanFiles + 1
- end
- end
- end
- settings.set("shell.allow_disk_startup", false)
- settings.save(".settings")
- if (fs.exists("SafeDisk.lua")) then
- fs.delete("SafeDisk.lua")
- end
- local h = fs.open("SafeDisk.lua", "w")
- h.write('local filePath = "/disk/startup"\n')
- h.write('if not fs.exists(filePath) then filePath = "/disk/startup.lua" end\n')
- h.write('if fs.exists(filePath) then\n')
- h.write(' local reader = fs.open(filePath, "r") if not reader then return end -- Abort if it isnt a file\n')
- h.write(' local content = reader.readAll() if not content then return end -- Abort if no content\n')
- h.write(' local isInfected = string.find(content, "xpayload" ) -- Checks if the file is infected\n')
- h.write(' if isInfected then\n')
- h.write(' fs.delete(filePath)\n')
- h.write(' print("Attempted to clean infected disk!")\n')
- h.write(' else\n')
- h.write(' shell.run(filePath)\n')
- h.write(' end\n')
- h.write('end\n')
- h.close()
- if (fs.exists("startup")) then
- fs.delete("startup")
- end
- h = fs.open("startup", "w")
- -- Prints the log output at reboot
- h.write("print(\"Cleaned up '"..infectedFiles.."' files from the system!\")")
- h.write("print(\"A total of '"..cleanFiles.."' clean files where found!\")")
- h.write('print("Safe disk boot installed!")')
- -- Installs the SafeDisk software. Lets you reboot up safely.
- h.write('h = fs.open("startup", "w")')
- h.write("h.write('shell.run(\"SafeDisk.lua\") -- Runs disk IF it isnt this virus.')")
- h.write("h.close()")
- h.close()
- os.reboot() -- Takes a reboot real fast, as the virus will install itself after a second.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement