MCPcopy Index your code
hub / github.com/codeyourweb/irma / TaskSchedulerAnalysisRoutine

Function TaskSchedulerAnalysisRoutine

windowstaskscheduler.go:38–61  ·  view source on GitHub ↗

TaskSchedulerAnalysisRoutine analyse Windows Task Scheduler executable every 15 seconds

(pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, pInfiniteLoop bool, rules *yara.Rules)

Source from the content-addressed store, hash-verified

36
37// TaskSchedulerAnalysisRoutine analyse Windows Task Scheduler executable every 15 seconds
38func 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
64func InitTaskScheduler() error {

Callers 1

mainFunction · 0.85

Calls 4

GetTasksFunction · 0.85
logMessageFunction · 0.85
FileAnalysisFunction · 0.85

Tested by

no test coverage detected