Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
fix periodicity threat, if the flow is still periodic till the end
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-perugini committed Oct 15, 2020
1 parent 0fe9f6b commit c3a6d12
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ func main() {

currTime := time.Now().Format(time.RFC3339)
dumpPath := "./dump/" + currTime
if _, err := os.Stat("./dump"); os.IsNotExist(err) {
os.Mkdir("./dump", os.ModePerm)
}
if _, err := os.Stat(dumpPath); os.IsNotExist(err) {
os.Mkdir(dumpPath, os.ModePerm)
}
Expand Down
14 changes: 14 additions & 0 deletions live_mode.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package stanislav

import (
"fmt"
"os"
"os/signal"
"runtime"
Expand Down Expand Up @@ -50,4 +51,17 @@ func LiveMode() {
}

wg.Wait()

//gathering all possible new periodicity, because we don't update on every entry

for k, v := range PeriodiFlows {
if val, ok := PossibleThreat[k]; ok {
last := len(val) - 1
lastPeriodic := fmt.Sprintf("periodic frequency: %.2fs seen %d times.", v.TWDuration, v.PeriodicityCounter)
if val[last] != lastPeriodic {
PossibleThreat[k][last] = lastPeriodic
}
}
}

}

0 comments on commit c3a6d12

Please sign in to comment.