Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor Carroll committed Aug 21, 2024
1 parent 78d02ce commit 573e8f0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
Binary file modified build/chickadee.exe
Binary file not shown.
Binary file modified build/chickadee_installer_win-x64.exe
Binary file not shown.
8 changes: 2 additions & 6 deletions build/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,10 @@

webhook_url = ""

## SNMP (default v2c)
## SNMP Trap (default v2c)
enable_snmptrap = false

snmp_oid = ".1.3.6.1.4.1.207.1"
snmp_server = "localhost"
snmp_port = "162"
snmp_community = "public"

# Syslog

# SNMP Trap
snmp_community = "public"
8 changes: 2 additions & 6 deletions src/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,10 @@

webhook_url = ""

## SNMP (default v2c)
## SNMP Trap (default v2c)
enable_snmptrap = false

snmp_oid = ".1.3.6.1.4.1.207.1"
snmp_server = "localhost"
snmp_port = "162"
snmp_community = "public"

# Syslog

# SNMP Trap
snmp_community = "public"
8 changes: 7 additions & 1 deletion src/detector/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,20 @@ func DetectPortScan(ip string, port uint16, detectionOptions *models.DetectionOp
}

var newScans []models.PortScan
portExists := false
for _, scan := range scans[ip] {
if now.Sub(scan.Timestamp) <= time.Duration(detectionOptions.ThresholdTime)*time.Second {
newScans = append(newScans, scan)
if scan.Port == port {
portExists = true
}
}
}
scans[ip] = newScans

scans[ip] = append(scans[ip], models.PortScan{Port: port, Timestamp: now})
if !portExists {
scans[ip] = append(scans[ip], models.PortScan{Port: port, Timestamp: now})
}

if len(scans[ip]) > int(detectionOptions.ThresholdCount) {
if !IsIpExcluded(ip, detectionOptions) {
Expand Down

0 comments on commit 573e8f0

Please sign in to comment.