Advertisement
minimite

computercraft_test_malware

Jul 6th, 2015
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. --O Update Test Malware
  2. --By Atenefyr
  3. --This program is in no way malicious, it is instead intended for demonstration purposes.
  4. --This piece of malware only functions in O versions below 2.2.1.
  5.  
  6. --shut down malware if wrong version
  7. if O.getReleaseVersion then
  8.   local vn = O.getReleaseVersion():gsub("%.", "") --it's an awful, but effective and easy way of detecting it
  9.   if tonumber(vn) > 22 then
  10.     printError("This test malware is patched as of O 2.2.1.")
  11.     error()
  12.   end
  13. end
  14.  
  15. local txt1 = [[
  16. os.loadAPI("/systemO/odata/O")
  17. O.pushNotification("O Update Available!", colors.white, colors.gray, 2)
  18. os.unloadAPI("/systemO/odata/O")
  19. ]]
  20. local txt2 = [[
  21. print("Test Malware Payload")
  22. sleep(2)
  23. ]]
  24. local function inject(file, txt)
  25.   local open = fs.open(file, "r")
  26.   local all = open.readAll()
  27.   open.close()
  28.  
  29.   local open = fs.open(file, "w")
  30.   open.writeLine(txt)
  31.   open.write(all)
  32.   open.close()
  33. end
  34. inject("*systemO/launchpad", txt1) --fake update notification
  35. inject("*systemO/programs/update", txt2) --fake payload
  36. print("Test malware injected")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement