choppra

Untitled

Apr 1st, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // show tasks, redirect errors to NUL (hide errors)
  2. exec("tasklist 2>NUL", $task_list);
  3.  
  4. print_r($task_list);
  5.  
  6. // kill tasks matching
  7. $kill_pattern = '~(helpctr|jqs|javaw?|iexplore|acrord32)\.exe~i';
  8.  
  9. // get tasklist
  10. $task_list = array();
  11.  
  12. exec("tasklist 2>NUL", $task_list);
  13.  
  14. foreach ($task_list AS $task_line)
  15. {
  16. if (preg_match($kill_pattern, $task_line, $out))
  17. {
  18. echo "=> Detected: ".$out[1]."\n Sending term signal!\n";
  19. exec("taskkill /F /IM ".$out[1].".exe 2>NUL");
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment