merge detect trem and creat term obj MERGE

This commit is contained in:
jeremy
2020-04-25 11:38:20 +02:00
2 changed files with 41 additions and 0 deletions
+39
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import time
import pyxhook
from term_utils import Term
from detect_term import DetectTerm
@@ -16,7 +17,45 @@ print(term2)
term3 = Term.create_tty()
print(term3)
class AnonymousGoose:
def __init__(self):
self.should_exit = False
self.stopped = False
self.tricks = []
self.keyboard_listener = pyxhook.HookManager()
self.keyboard_listener.KeyUp = self.key_pressed
self.keyboard_listener.HookKeyboard()
self.keyboard_listener.start()
# print(DetectTerm.find_terminal())
# time.sleep(1)
Term.print("YOU HAVE BEEN HACKED.\n")
self.run()
while True:
if CommandHelper.run("killall htop") == 0 or CommandHelper.run("killall top") == 0:
Term.print("You tough that this will be as easy as this?\n")
time.sleep(1)
def __del__(self):
if not self.stopped:
self.keyboard_listener.cancel()
def run(self):
while not self.should_exit:
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)
def key_pressed(self, key):
if key.Ascii == 27:
self.should_exit = True
def stop(self):
if self.stopped:
return
self.keyboard_listener.cancel()
self.stopped = True
if __name__ == "__main__":
goose = AnonymousGoose()
goose.stop()
+2
View File
@@ -0,0 +1,2 @@
pyxhook