Commit graph

476 commits

Author SHA1 Message Date
Simone Mainardi
96cd1bebbd Fixes score decrements on flows 2021-04-09 20:12:42 +02:00
Alfredo Cardigliano
db6746e1a3 Enqueue host alert release status to avoid concurrency issues. Change SPSCQueue dequeue to behave similar to std lists. 2021-04-09 09:45:11 +02:00
Matteo Biscosi
8d2cf80f95 Added JA3 hash to flow alert
Implements #5159
2021-04-08 12:34:45 +02:00
Luca
a4047c5a1c Implements flow callbacks and alerts in C++
Scaffolding code of the host scripts

Scaffolding code for host alerts

Adds host_callbacks/ for .cpp files

Implements all classes for host callbacks

Removes pro/enterprise host callbacks

Adds typedefs with callback deltas

Compilation fix

Creates instances of host callbacks in loader

Link fix

Removes redundant/non-necessary host alerts

Merges Scan and Flood callbacks together

Removes outdated API files

Refactors alert keys into entity|id

Refactors all flow alert_{...} into flow_alert_{...}

Refactors C++ flow alert_{...} into flow_alert_{...}

Reworks alert ids to include an entity type

Cleanup and merge alertTypeRaw with getAlertType

Minor fix

Refactors alert definitions and keys into sub directories

Implement host alert callback execution and trigger/release logic

Update callbacks API

Adds base CallbacksLoader for {Host,Flow}CallbacksLoader

Implements load of host user scripts with periodicities

Implements runtime reload of host callbacks

Add logic for periodic callbacks

Add 'expired' flag to host alerts

Implements execution of host callbacks and SYN flood checks

Adds triggerAlertAsync calls to SYNFlood

Implements JSON host alert generation info

Handle callback getPeriod. Optimize callback lookup.

Implements host recipients in C++

Add callback status

Define destructor

Iterator fixes

Cleanup host Lua calls (now performed in C++)

Changes to show new host alerts in SQLite

Adds release/engage action on alert JSON

Move AlertableEntity to OtherAlertableEntity, inheriting from a new AlertableEntity. Add HostAlertableEntity.

Implements SYN Flood Attacker with params

Uses parametrized thresholds to trigger syn flood alerts

Implements build alert of both attacker and victim

Implement HostAlertableEntity

Implements SYN scan attacker/victim alerts

Implements flow flood attacker/victim alerts

Removes a debug flag

Add virtual allocStatus

Add HostAlert disableAutoRelease()

Add Ãexplicit releaseAlert()

Implements SYNFloodHostCallbackStatus

Implements SYNScanHostCallbackStatus

Implements FlowFloodHostCallbackStatus

Change trigger API to handle cli/src score

Implements {DNS,SMTP,NTP}ServerContactsAlert

Reworks ServerContacts host alerts

Implement exclusion bitmaps for host alerts

Implements {SMTP,DNS,NTP}ServerContactsAlert

Adds host_info to the generated alert JSON

Minor cleanup

Optimize access to callback status

Move RepliesRequestsRatio to pro

Rework triggerAlert on host to avoid multiple call and unneeded status data

Compilation fix

Reworked host alerts API (wip)

Cleanup unused host callbacks

Compilation fixes

Finishes backend implementation of host alerts exclusions

Rework host callbacks executor

Implements disable of host alerts

Port SYNFlood to the new api

Cleanup

Reduce duplicated code

Comments

Port ServerContacts to the new api

Clenaup

Adds parsing of configuration for host callbacks

Port SYNScanAlert to the new API

Port FlowFlood to the new API

Cleanup unused HostAlert getName

Reworks DNSRequestsErrorsRatioAlert

Adds JSON for DNSTrafficAlert

Adds FlowsAlert

Adds P2PTrafficAlert

Add RepliesRequestsRatioAlert

Adds ScoreAlert

Adds ThroughputAlert

Adds TrafficAlert

Fixes for scan/flood alerts

DNS ratio alert support

Add HTTP stats getters

Implements deltas for many host callbacks

Host score inc

Adds missing Alert params to host alerts

Release all host alerts on idle

Refactors score classes

Implements class Score to contain scores for hosts, flows, etc

Adds scores to VLANs, Networks, ASes and Countries

Host callbacks can trigger a single alert now

FlowFlood, SYNFloo, SYNScan now inherit from FlowHits

Move severity and score to constructor

Add else branch to hits callbacks

Alert definition update for flows_flood, syn_flood, syn_scan

Update field name

Engaged alert init

Adds score incs/decs for AS, VLAN, country, os and network

Restore network scripts

Restored other alert definitions for floods

Handle decreasing alert score

Removes include

Rename flows_flood to flow_flood for consistency

Restored alert_tcp_syn_flood_victim alert_tcp_syn_scan_victim definitions

Fixes for non-host engaged/release alerts

Cleanup LuaEngineFlow and LuaEngineHost classes

Fixes old calls to host lua during shutdown

Removes AlertCheckLuaEngine instance

Fixes purging of flows

Fixes alerts release upon shutdown causing wrong uses

Removes a debug flag

Fix getNumEngagedAlerts

Cleanup unnecessary host callbacks

Removes array of callback statuses inside host

Bitmap fixes

Refactors Bitmap into Bitmap128

Implements 16-bits bitmaps for host alerts

Adds class HostCallbacksStatus

Moves callback status p2p and DNS inside HostCallbacksStatus

Removes unused callbacks in typedefs

Minor cleanup

Adds trigger/release for DNS/p2p alerts

Reworks UI of hosts user scripts

Rename HostCallbackType to HostCallbackID, getType to getID, others
2021-04-03 09:53:15 +02:00
Simone Mainardi
da943e0dff Reduces the maximum cli/srv score per callback to 128 2021-03-23 14:54:32 +01:00
Simone Mainardi
537c151a62 Simplifies check of alerted flows 2021-03-23 13:31:08 +01:00
Simone Mainardi
8c31b70073 Fixes and simplifies counters for alerted flows 2021-03-23 13:23:09 +01:00
Simone Mainardi
c0815c4329 Fixes set of predominant alert severity 2021-03-23 12:46:42 +01:00
Simone Mainardi
d90535017a Allows severity to be passed to triggerAlert{Sync,Async} 2021-03-23 12:17:11 +01:00
Alfredo Cardigliano
d1c8d2c530 Check if the same alert has been already triggered and accounted in the score, unless this is a sync alert 2021-03-23 10:08:53 +01:00
Simone Mainardi
aea9138bfb Implements flow callbacks and alerts in C++ 2021-03-22 09:51:36 +01:00
Simone Mainardi
9050b210b5 Cleanup and simplif. old client/server heuristic code 2021-02-27 19:19:03 +01:00
Simone Mainardi
b7a2e0138c Additional changes and simplif. to the client/server heuristic 2021-02-27 19:10:55 +01:00
Simone Mainardi
9b6c9b7c60 User script changes for client/server heuristics 2021-02-26 19:29:36 +01:00
Simone Mainardi
3ae569b594 Reworks heuristic on client/server (#5058) 2021-02-26 16:29:32 +01:00
Matteo Biscosi
4e0bb51969 Implements client/server heuristic #5058 2021-02-25 10:01:53 +01:00
Alfredo Cardigliano
db9adb9060 Add support for Malicious JA3 signature using nDPI (#5045) 2021-02-23 18:35:19 +01:00
Alfredo Cardigliano
8c4408628a Show TLS info for protocols using TLS as transport (fix #5045) 2021-02-19 11:32:23 +01:00
Simone Mainardi
f4dff6f2e7 Implements risk-based filtering of flow alerts 2021-02-16 15:25:20 +01:00
Simone Mainardi
af2eeda9e5 Implements MAC access in user scripts
Implements #5015
2021-02-04 09:22:05 +01:00
Luca Deri
e22e7c6963 Implemented smart IPv4 fragment handling 2021-02-02 23:00:48 +01:00
Simone Mainardi
30fb35741f Fixes process of detected protocol for non-packet interfaces
Fixes #5000
2021-02-02 14:30:06 +01:00
Simone Mainardi
ce45bf0f9c Reworks throughput estimation for ZMQ interfaces 2021-01-25 17:27:13 +01:00
Alfredo Cardigliano
f2e64bb9ef Support 4-byte INPUT/OUTPUT SNMP 2021-01-22 10:24:56 +01:00
Luca Deri
440f6e5892 Added IEC flow info
Changed getFlowInfo() method signature
2021-01-21 22:10:48 +01:00
Matteo Biscosi
43fa8cf6e9 Implements OperatingSystem Hash
Implements #1599
2021-01-21 11:14:52 +01:00
Luca Deri
a1178a0791 Updated (C) 2021-01-02 12:08:23 +01:00
Luca Deri
62e76db122 Fixed TLS stats 2020-12-30 16:50:14 +01:00
Alfredo Cardigliano
764a9ba898 Rename Flow->dumpFlow to avoid confusion with NetworkInterface->dumoFlow 2020-12-11 14:43:19 +00:00
Luca Deri
599835c72f Reworked IEC104 implementation 2020-11-27 22:34:50 +01:00
Luca Deri
17266b71a6 Extended flow alert JSON 2020-11-17 17:04:11 +01:00
Luca Deri
83816cefae Zero window alert improvement 2020-11-07 00:41:02 +01:00
Luca
bac9ee8701 Optimized TCP window memory usage 2020-11-05 19:32:39 +01:00
Matteo Biscosi
e5a48cb5d2
TCP Zero Window alert from issue #3417 (#4684)
* Added no_if_activity alert to user script keys

* Added no_if_activity description alert

* Fixes #4648 trigger an alert when no flows are collected

* Changed the time past one call of the alert and an other

* Fixes #4648 reorganized files and cache management

* Added status flow check regarding issue #3417

* Removed debug code

Co-authored-by: matteo <biscosi@ntop.org>
Co-authored-by: Luca Deri <lucaderi@users.noreply.github.com>
2020-11-05 18:20:09 +01:00
Luca Deri
82fab91a2e
Merge pull request #4604 from Wallace4/retry_project
Retransmissions Plugin updated
2020-10-25 18:18:57 +01:00
Simone Mainardi
a2705a8bda Implements header and drilldown of flow status severities 2020-10-19 19:26:30 +02:00
Simone Mainardi
d7f1ce0d8c Reworks and optimizes flow alerted status 2020-10-19 16:50:22 +02:00
Wallace4
ca88369ef3 New version of retransmission plugin, fixed and tested 2020-10-19 16:40:22 +02:00
Simone Mainardi
d3dda0bb82 Unifies misbehaving with alerted flows
Implements #4596
2020-10-16 18:58:20 +02:00
Simone Mainardi
adfec81477 Simplifies idling of flows for views 2020-10-15 09:03:01 +02:00
Alfredo Cardigliano
3aae425731 Print device ID in flow details (when available) 2020-10-13 17:17:17 +02:00
Simone Mainardi
7320c8266c Adds throughput estimation via ZMQ
Implements #3508
2020-10-06 19:28:11 +02:00
Simone Mainardi
891e52c1ef Adds comments for flow status / alerted status 2020-10-02 17:03:47 +02:00
Simone Mainardi
fdf0f15140 Fixes races in view interfaces and cli/srv scores
Fixes #4513
Fixes #4512
2020-10-02 16:34:28 +02:00
Simone Mainardi
0db456c0cf Reworks flow user scripts execution in C++ 2020-09-30 18:41:36 +02:00
Simone Mainardi
90a5a57b36 Implements user script queues (avoids 5-sec HT walk) 2020-09-28 11:45:00 +02:00
Simone Mainardi
6e0c369fa9 Handles flow dump queues in view interfaces - and fixes races 2020-09-25 14:10:06 +02:00
Simone Mainardi
7f2a9b1420 Decouples flow dump from user scripts execution
Addresses #3545
2020-09-24 19:29:00 +02:00
Simone Mainardi
814ee67cf9 Reworks nDPI Risks flow plugins to handle all risks and scores
Fixes #4432
2020-09-23 17:58:51 +02:00
Luca Deri
55d8e299fa Cleanued up code for flow score 2020-09-23 10:51:36 +02:00