Advertisement
SuperRavenSn1per

Raven Inc. Anti-Virus

Mar 23rd, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. tArgs = {...}
  2.  
  3. chance = 0
  4.    
  5. if tArgs[1] == nil then
  6.   print("Proper Syntax: scan <filename>")
  7.   return
  8. end
  9.  
  10. if not fs.exists(tArgs[1]) then
  11.   print("File does not exist.")
  12.   return
  13. end
  14.    
  15. file = fs.open(tArgs[1], "r")
  16. contents = file.readAll()
  17.  
  18. if string.match(contents, "fs.delete") then
  19.   del = true
  20.   chance = chance+1
  21. end
  22. if string.match(contents, "startup") then
  23.   start = true
  24.   chance = chance+1
  25. end
  26. if string.match(contents, "infect") then
  27.   inf = true
  28.   chance = chance+4
  29. end
  30. if string.match(contents, "fs.copy") then
  31.   cop = true
  32.   chance = chance+1
  33. end
  34. if string.match(contents, "pastebin") then
  35.   paste = true
  36.   chance = chance+1
  37. end
  38.  
  39. print("Scan Summary:")
  40.  
  41. if del == true then
  42.   print("Contains 'fs.delete'")
  43. end
  44. if start == true then
  45.   print("Contains 'startup'")
  46. end
  47. if inf == true then
  48.   print("Containts 'infect'")
  49. end
  50. if cop == true then
  51.   print("Contains 'fs.copy'")
  52. end
  53. if paste == true then
  54.   print("Contains 'pastebin'")
  55. end
  56.  
  57. if chance == 0 then
  58.   term.setTextColor(colors.white)
  59.   print("File is most likely safe!")
  60.   term.setTextColor(colors.white)
  61. elseif chance == 1 then
  62.   term.setTextColor(colors.yellow)
  63.   print("File could be malicious!")
  64.   term.setTextColor(colors.white)
  65. elseif chance == 2 then
  66.   term.setTextColor(colors.yellow)
  67.   print("File could be malicious!")
  68.   term.setTextColor(colors.white)
  69. elseif chance == 3 then
  70.   term.setTextColor(colors.orange)
  71.   print("File has a good chance of being malicious!")
  72.   term.setTextColor(colors.white)
  73. elseif chance >= 4 then
  74.   term.setTextColor(colors.red)
  75.   print("File is most likely malicious!")
  76.   term.setTextColor(colors.white)
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement