RegistryAnalysisRoutine analyse registry persistence keys every 15 seconds
(pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, pInfiniteLoop bool, rules *yara.Rules)
| 19 | |
| 20 | // RegistryAnalysisRoutine analyse registry persistence keys every 15 seconds |
| 21 | func RegistryAnalysisRoutine(pQuarantine string, pKill bool, pNotifications bool, pVerbose bool, pInfiniteLoop bool, rules *yara.Rules) { |
| 22 | for { |
| 23 | values, errors := EnumRegistryPeristence() |
| 24 | |
| 25 | if pVerbose { |
| 26 | for _, err := range errors { |
| 27 | logMessage(LOG_ERROR, "[ERROR]", err) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | for _, k := range values { |
| 32 | paths := FormatPathFromComplexString(k.value) |
| 33 | for _, p := range paths { |
| 34 | FileAnalysis(p, pQuarantine, pKill, pNotifications, pVerbose, rules, "REGISTRY") |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | if !pInfiniteLoop { |
| 39 | wg.Done() |
| 40 | break |
| 41 | } else { |
| 42 | time.Sleep(15 * time.Second) |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | // EnumRegistryPeristence get all the potential registry values used for persistence |
| 48 | func EnumRegistryPeristence() (values []RegistryValue, errors []error) { |
no test coverage detected