Advertisement
LazerAio

ASS-AV

Mar 5th, 2022 (edited)
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. term.setTextColour(colors.lime)
  5. print("ASS V1.8")
  6. term.setTextColour(colors.white)
  7.  
  8. danger = {"rm startup","rm DISK/startup","rm DISK/","rm /DISK/","rm ./*","rm"}
  9.  
  10.  
  11. function FullScan()
  12. print("FullScan RUNNING!")
  13. local files = fs.list("*")
  14. for i = 1,#files do
  15.  
  16.  
  17. local gitfil = fs.open(files[i], "r")
  18. if gitfil == nil then
  19. sleep(0)
  20. else
  21. illcom3 = gitfil.readAll()
  22.  
  23.  
  24. gitfil.close()
  25. for j = 1,#danger do
  26. if string.match(illcom3, danger[j]) then
  27. term.setTextColour(colors.red)
  28. print ("dangerous file found! : "..files[i])
  29.  
  30. term.setTextColour(colors.white)
  31. run1 = false
  32. end
  33. end
  34. end
  35.  
  36. end
  37. sleep(1)
  38. end
  39. local function SHELL()
  40. term.clear()
  41. term.setCursorPos(1,1)
  42. print("ENTERING ASS SHELL")
  43. print("FS for fullscan")
  44. while true do
  45. COMMAND = read()
  46. run1 = true
  47. for i = 1,#danger do
  48. if string.match(COMMAND, danger[i]) then
  49. term.setTextColour(colors.yellow)
  50. print ("command might be dangerous")
  51. term.setTextColour(colors.white)
  52. run1 = false
  53. end
  54. end
  55. local handler = fs.open(COMMAND..".lua", "r")
  56. if handler == nil then
  57. handler = fs.open(COMMAND, "r")
  58. end
  59. if handler == nil then
  60. sleep(0)
  61. else
  62. illcom = handler.readAll()
  63. handler.close()
  64. for i = 1,#danger do
  65. if string.match(illcom, danger[i]) then
  66. term.setTextColour(colors.yellow)
  67. print ("command might be dangerous")
  68. term.setTextColour(colors.white)
  69. run1 = false
  70. end
  71. end
  72.  
  73. local handler = fs.open(COMMAND..".lua", "r")
  74. if handler == nil then
  75. handler = fs.open(COMMAND, "r")
  76. end
  77. if handler == nil then
  78. sleep(0)
  79. else
  80. local IKE = {"fg","bg","background","foreground","shell.run(","move", "mv"}
  81. illcom2 = handler.readAll()
  82. handler.close()
  83. dofscan = false
  84. for i = 1,#IKE do
  85. if string.match(illcom2, IKE[i]) then
  86. dofscan = true
  87. end
  88. end
  89. if dofscan == true then
  90. FullScan()
  91. end
  92. end
  93. end
  94. if run1 == true then
  95. if COMMAND == "FS" then
  96. FullScan()
  97. else
  98. shell.run(COMMAND)
  99. end
  100. end
  101.  
  102. end
  103. end
  104. print("Run ./startup ? [Y/N/FS]")
  105. TEmP = read()
  106. if TEmP == "Y" then
  107. print("Running startup")
  108. shell.run("./startup")
  109. term.setCursorPos(1,1)
  110. term.clear()
  111. elseif TEmP == "FS" then
  112. FullScan()
  113. end
  114. SHELL()
  115. term.setBackgroundColor(colors.blue)
  116. term.setTextColour(colors.white)
  117. term.clear()
  118. term.setCursorPos(1,1)
  119. print("ASS HAS STOPPED FOR AN UNKNOWN REASON")
  120. print("KEEP CALM, ASS WILL NOW STOP THE PC")
  121. sleep(5)
  122. os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement