summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAge
* Added additional (minimalistic) detection information to flow updates.Toni Uhlig2022-02-04
| | | | | | | | | | | | | This will only affect flows with the state `FT_FINISHED' (detection done). * nDPIsrvd.py: force use of JSON schema Draft 7 validator * flow-dash.py: gather/use total processed layer4 payload size * flow-info.py: added additional event filter * flow-info.py: prettified flow events printing whose detection is in progress * py-semantic-validation.py: added validation checks for FT_FINISHED * updated flow event JSON schema Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd: Fixed memory leak caused be not clearing buffer cache after a ↵Toni Uhlig2022-01-26
| | | | | | | | client disconnected. * README.md: Fixed a typ0 and added a meh image from examples/py-flow-dashboard/flow-dash.py Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* py-flow-dashboard: added tab layout and event pie chartToni Uhlig2022-01-26
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Improved Plotly/Dash example. It is now somehow informative.Toni Uhlig2022-01-25
| | | | | | | * TCP timeout after FIN/RST: switched back to the value from a35fc1d5ea8570609cc0c8cf6edadc81f8f5bb76 * py-flow-info: reset 'guessed' flag after detection/detection-update received Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Major nDPId extension. Sorry for the huge commit.Toni Uhlig2022-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - nDPId: fixed invalid IP4/IP6 tuple compare - nDPIsrvd: fixed caching issue (finally) - added tiny c example (can be used to check flow manager sanity) - c-captured: use flow_last_seen timestamp from `struct nDPIsrvd_flow` - README.md update: added example JSON sequence - nDPId: added new flow event `update` necessary for correct timeout handling (and other future use-cases) - nDPIsrvd.h and nDPIsrvd.py: switched to an instance (consists of an alias/source tuple) based flow manager - every flow related event **must** now serialize `alias`, `source`, `flow_id`, `flow_last_seen` and `flow_idle_time` to make the timeout handling and verification process work correctly - nDPIsrvd.h: ability to profile any dynamic memory (de-)allocation - nDPIsrvd.py: removed PcapPacket class (unused) - py-flow-dashboard and py-flow-multiprocess: fixed race condition - py-flow-info: print statusbar with probably useful information - nDPId/nDPIsrvd.h: switched from packet-flow only timestamps (`pkt_*sec`) to a generic flow event timestamp `ts_msec` - nDPId-test: added additional checks - nDPId: increased ICMP flow timeout - nDPId: using event based i/o if capturing packets from a device - nDPIsrvd: fixed memory leak on shutdown if remote descriptors were still connected Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Removed py-flow-undetected-to-pcap and py-risky-flow-to-pcap. Done by ↵Toni Uhlig2021-11-21
| | | | | | c-captured anyway. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* go-dashboard renaming, ignore go-mod and it's file structureToni Uhlig2021-11-21
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added timestamp validation test.Toni Uhlig2021-11-02
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Additional semantic validation tests.Toni Uhlig2021-11-02
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* c-captured: Improved format string in nDPIsrvd_write_flow_info_cb.Toni Uhlig2021-10-08
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed compile error due to missing stdint.h include before ndpi_typedefs.hToni Uhlig2021-10-08
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added support/debug function to write flow(-user) related info.Toni Uhlig2021-10-08
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* bump libnDPI to 6b7e5fa8d251f11c1bae16ea892a43a92b098480Toni Uhlig2021-08-03
| | | | | | | | * fixed linking issue by using CMake to check if explicit link against libm required * make nDPIsrvd collectd exit if parent pid changed, meaning that collectd died somehow * nDPId-test restores SIGPIPE to the default handler (termination), so abnormal connection drop's do now have consequences Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Build JSMN with support for parent links.Toni Uhlig2021-07-13
| | | | | | | * nDPIsrvd.h: iterate over subtokens * nDPIsrvd-captured: select/ unselect risky flows to capture Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Unified IO buffer mgmt.Toni Uhlig2021-06-07
| | | | | | | * c-collectd gives the user control over collectd-exec instance name * added missing collectd type `flow_l4_icmp_count` Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* flow-dash: Simplified and extended bar graph.Toni Uhlig2021-05-28
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* flow-dash: Added live bars visualising midstream/risky flow count.Toni Uhlig2021-05-28
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added realtime web based graph example using Plotly/Dash.Toni Uhlig2021-05-27
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added simple Python Multiprocess example.Toni Uhlig2021-05-26
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd-captured: skip empty flows based on flow total payload lengthToni Uhlig2021-05-20
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Reworked layer 4 flow length naming/calculation.Toni Uhlig2021-05-20
| | | | | | | * nDPIsrvd services usually do not care about layer4 data length, payload length is quite more essential for further processing Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed CMake global CFLAGS misuse which can cause xcompile errors.Toni Uhlig2021-05-19
| | | | | | | | | | nDPIsrvd-captured supports skipping flows w/o any layer 4 payload. * libndpi update * run_tests does not generate any *.out files for fuzz-*.pcap anymore and does not fail if nDPId-test exits with value 1 (most likely caused by a libpcap failure) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* py-flow-info: Support for --ipwhois, --new and --detection.Toni Uhlig2021-04-30
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added JA3 blacklist downloader/checker from abuse.chToni Uhlig2021-04-17
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added python example to check JA3 hashes against known hashes via JA3er.comToni Uhlig2021-04-16
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added nDPId semantic validation test.Toni Uhlig2021-04-14
| | | | | | | | | | | * fixed inconsistent processing of remaining flows during nDPId shutdown phase * fixed multiple `detected' flow events (instead only `detection-update' flow events can occur after a `detected' flow event) * fixed nDPIsrvd.py invalid message buffer handling * improved run_tests.sh so only valid pcap capture files are getting processed (and some more cosmetics + logging) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed nDPIsrvd.h flow end bug (flow end callback could never be called and ↵Toni Uhlig2021-04-11
| | | | | | caused some memory troubles). Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added IPv6 support for -I / -E.Toni Uhlig2021-04-11
| | | | | | | * added another Python search path and try-catch ModuleNotFoundError again * run_tests.sh checks for OpenBSD netcat (required for -q) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added JSON schema validation to run_tests.shToni Uhlig2021-04-09
| | | | | | | * Python3 scripts are now compatible with versions <3.6 * improved and prettified run_tests.sh Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPId-test: added JSON distribution + JSON parsing (Multithreaded design ↵Toni Uhlig2021-04-09
| | | | | | | | | | | | | | re-using most of nDPId/nDPIsrvd core) * improved Makefile.old install targets * splitted nDPIsrvd_parse into nDPIsrvd_parse_line and nDPIsrvd_parse_all for the sake of readability * minor Python script improvments (check for nDPIsrvd.py on multiple locations, may be superseeded by setuptools in the future) * some paths needs to be absolute (chdir() during daemonize) and therefor additional checks introduced * test run script checks and fails if certain files are are missing (PCAP file <=> result output file) * removed not very useful "internal format error" JSON serialization if a BUG for same exists * fixed invalid l4 type statistics counters for nDPIsrvd-collectd Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Updated README.mdToni Uhlig2021-03-24
| | | | | | * added examples/README.md and schema/README.md Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Switched to CMake build system.Toni Uhlig2021-03-17
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd collectd-exec overhaul.Toni Uhlig2021-03-15
| | | | | | | * Install targets updated. * Removed nDPIsrvd.h token validation function (done automatically by token_get). Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed collectd-exec issues.Toni Uhlig2021-03-12
| | | | | | * Added collectd example config and types.db Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added basic collectd-exec example.Toni Uhlig2021-03-10
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed possible NULL pointer deref in dependencies/nDPIsrvd.h and ↵Toni Uhlig2021-02-28
| | | | | | | | | | examples/c-captured/c-captured.c * `make install` C examples * examples/py-flow-info/flow-info.py supports filtering * added breed to examples/py-flow-info/flow-info.py Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added JA3 / SSL SHA1 fingerprint blacklists.Toni Uhlig2021-02-27
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Finalized examples/c-captured to dump packet bytes to PCAP for further analysis.Toni Uhlig2021-02-24
| | | | | | * Fixed memory holes in nDPId structs. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Extended nDPIsrvd.h with address parsing.Toni Uhlig2021-02-23
| | | | | | | | | * nDPId supports looading of custom nDPI protocol/category files * extended JSON schemas according to nDPI / nDPId JSON serializing * removed memory holes in nDPId * extended examples/c-captured Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* C-Api uses similiar flow key hash calculation as Python-Api.Toni Uhlig2021-02-19
| | | | | | * Make use of flow id / alias / source which is required for future use cases where multiple nDPId instances (same / different machines) feed one nDPIsrvd. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added JSON schema files and a Python schema validator.Toni Uhlig2021-02-17
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Aligned nDPIsrvd.py to nDPIsrvd.h for consistency.Toni Uhlig2021-02-16
| | | | | | | | | * Simplified Python interface as well. * c-captured and flow-undetected-to-pcap.py produce similiar results * Removed overloaded nDPIsrvd.py event structures. * flow-info.py prints (with a color-hash) additional information e.g. alias/source and midstream Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Removed superfluous nDPI (header) dependency for examples/c-captured. Use ↵Toni Uhlig2021-02-06
| | | | | | header definitions from libc instead. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* nDPIsrvd C API overhaul and massive simplification.Toni Uhlig2021-02-06
| | | | | | | | * nDPIsrvd.h does flow mgmt out of the box * dissect received JSON strings via callback * added new JSON key/values for packet-flows (usecTimestamp/L3/L4 info) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Fixed braindead failure - Increase of NETWORK_BUFFER_MAX_SIZE > 9999 means ↵Toni Uhlig2021-01-27
| | | | | | | | | to also increase NETWORK_BUFFER_LENGTH_DIGITS to 5. * Fixed ARM32 xcompile warnings; Other GCC versions, other uint64_t's.. * Replaced ridiculous nDPIsrvd_JSON_BYTES with NETWORK_BUFFER_LENGTH_DIGITS. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Increased JSON buffer size to 12288 (libnDPI serializes more and more ↵Toni Uhlig2021-01-27
| | | | | | | | | | | information). * Making Compare&Fetch mandatory. * Added some more Compare&Fetch to prevent TSAN complaining about data races. Fixed possible but more ore less harmless data races during shutdown process. * Shrink SIGNAL handler to a minimum. SYSV Signal handling and MT-safety is awkward. Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* All colors are beautiful for py-flow-info.Toni Uhlig2021-01-26
| | | | | | * instance alias is now mandatory (will be required for future use-cases) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Finished (mostly) C guessed/undetected flow dumper.Toni Uhlig2021-01-26
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Added simple python json out example used for comparing JSON output.Toni Uhlig2021-01-20
| | | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Declared nDPI id and flow structs in nDPId flow info struct.Toni Uhlig2020-12-30
| | | | | | | | Two reasons: * reduce heap memory allocations * nDPId flow info struct may be inflated in the future (more bytes to compress) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>