TaskSchedulerAnalysisRoutine analyse Windows Task Scheduler executable every 15 seconds
(pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, pInfiniteLoop bool, rules *yara.Rules)
| 36 | |
| 37 | // TaskSchedulerAnalysisRoutine analyse Windows Task Scheduler executable every 15 seconds |
| 38 | func TaskSchedulerAnalysisRoutine(pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, pInfiniteLoop bool, rules *yara.Rules) { |
| 39 | for { |
| 40 | tasks, err := GetTasks() |
| 41 | if err != nil && pVerbose { |
| 42 | logMessage(LOG_ERROR, "[ERROR]", err) |
| 43 | } |
| 44 | |
| 45 | for _, t := range tasks { |
| 46 | for _, e := range t.ActionList { |
| 47 | paths := FormatPathFromComplexString(e.Path) |
| 48 | for _, p := range paths { |
| 49 | FileAnalysis(p, pQuarantine, pKill, pNotifications, pVerbose, rules, "TASKS") |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | if !pInfiniteLoop { |
| 55 | wg.Done() |
| 56 | break |
| 57 | } else { |
| 58 | time.Sleep(15 * time.Second) |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // InitTaskScheduler Initialize COM API & Task scheduler connect |
| 64 | func InitTaskScheduler() error { |
no test coverage detected