Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- -> Task Killer Program | Written By : Tanmay
- Email : tanmay4035266@gmail.com
- Automate Process killer script | :)
- """
- import os
- import sys
- import time
- from colorama import Fore
- banner = """
- \tTaskkill Script | For Linux
- \tWritten By: Tanmay Upadhyay
- \tEmail : tanmay4035266@gmail.com
- \n
- \tSimple AutoMate Process Killer
- """;
- print banner;
- class taskkiller(object):
- def __init__(self):
- filename = raw_input('[*] Tasklist : ');
- sec = raw_input('[*] Time To Kill : ');
- self.filename = filename;
- self.sec = sec;
- if(filename == "" or sec == ""):
- print "\n";
- print "\n\t[!] Error : Empty Input Detected.";
- print "\n";
- raw_input('Press Enter To Exit.');
- sys.exit(1);
- def __readfile__(self,filename,time_wait):
- f = open(filename,'r');
- data = f.readlines();
- if(len(data) == 0):
- print "\n\t[-] Error : list cannot be empty.";
- raw_input();
- sys.exit(1);
- else:
- while True:
- for process in data:
- process = process.replace("\n","").strip();
- try:
- if(os.system('pkill %s'%process) == 0):
- print(Fore.GREEN+"[SUCCESS] Process { %s } Killed."%process+Fore.RESET);
- else:
- print(Fore.RED+"[ERROR] Process { %s } Not Killed."%process+Fore.RESET);
- except:
- print "[-] Error : Unable to Start Auto-Killer [ Unknown - Error ]";
- time.sleep(2);
- sys.exit(1);
- time.sleep(int(time_wait));
- try:
- start = taskkiller();
- start.__readfile__(start.filename,start.sec);
- except KeyboardInterrupt:
- print "\n\n\t[+] Operation Aborted by User.";
- time.sleep(1);
- sys.exit(1);
- except IOError:
- print "\n\n\t[-] Error : Unable to open processlist file : ",start.filename
- print "\n";
- time.sleep(5);
- sys.exit(1);
- #!IndID3m0n_AutoMation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement