aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/ssh.c
Commit message (Collapse)AuthorAge
* Classifications "by-port"/"by-ip" should never change (#2656)Ivan Nardi2025-01-06
| | | Add a new variable to keep track of internal partial classification
* Add the ability to enable/disable every specific flow risks (#2653)Ivan Nardi2025-01-06
|
* SSH: fix how the flow risk is set (#2652)Ivan Nardi2025-01-06
| | | We should use the existing helper
* fuzzing: improve coverage (#2495)Ivan Nardi2024-07-12
| | | | | | | | | | | | | | Fix detection of WebDAV and Gnutella (over HTTP) Fix detection of z3950 Add two fuzzers to test `ndpi_memmem()` and `ndpi_strnstr()` Remove some dead code: * RTP: the same exact check is performed at the very beginning of the function * MQTT: use a better helper to exclude the protocol * Colletd: `ndpi_hostname_sni_set()` never fails Update pl7m code (fix a Use-of-uninitialized-value error)
* Disable `-Wno-unused-parameter -Wno-unused-function`. (#2358)Toni2024-04-03
| | | | | * unused parameters and functions pollute the code and decrease readability Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Have a clear distinction between public and private/internal API (#2137)Ivan Nardi2023-11-09
| | | | | | 1) Public API/headers in `src/include/` [as it has always been] 2) Private API/headers in `src/lib/` Try to keep the "ndpi_" prefix only for the public functions
* Minor warning fixesLuca Deri2023-09-05
|
* Add protocol disabling feature (#1808)Ivan Nardi2022-12-18
| | | | | | | | | | | | | | | | | | | | | | The application may enable only some protocols. Disabling a protocol means: *) don't register/use the protocol dissector code (if any) *) disable classification by-port for such a protocol *) disable string matchings for domains/certificates involving this protocol *) disable subprotocol registration (if any) This feature can be tested with `ndpiReader -B list_of_protocols_to_disable`. Custom protocols are always enabled. Technically speaking, this commit doesn't introduce any API/ABI incompatibility. However, calling `ndpi_set_protocol_detection_bitmask2()` is now mandatory, just after having called `ndpi_init_detection_module()`. Most of the diffs (and all the diffs in `/src/lib/protocols/`) are due to the removing of some function parameters. Fix the low level macro `NDPI_LOG`. This issue hasn't been detected sooner simply because almost all the code uses only the helpers `NDPI_LOG_*`
* Dissectors shouldn't update `flow->guessed_host_protocol_id`Nardi Ivan2022-09-14
| | | | | | | | | | | | | | | | The field `flow->guessed_host_protocol_id` is set at the beginning of the flow analysis and it represents the "classification by ip" of the flow itself. This field should never be changed. Dissectors which want to provide an "hint" about the classification, should update `flow->guessed_protocol_id` instead. Such "hint" is useless if the dissector set the "extra-dissection" data-path. Rename such field to `guessed_protocol_id_by_ip` to better describe its role. Preliminary work necessary for #1687
* Further simplification of `ndpi_process_extra_packet()` (#1698)Ivan Nardi2022-08-05
| | | | | | | | See 95e16872. After c0732eda, we can safely remove the protocol list from `ndpi_process_extra_packet()`. The field `flow->check_extra_packets` is redundant; remove it.
* Added RiskInfo stringLuca Deri2022-05-30
|
* Add a "confidence" field about the reliability of the classification. (#1395)Ivan Nardi2022-01-11
| | | | | | | | | | | | | As a general rule, the higher the confidence value, the higher the "reliability/precision" of the classification. In other words, this new field provides an hint about "how" the flow classification has been obtained. For example, the application may want to ignore classification "by-port" (they are not real DPI classifications, after all) or give a second glance at flows classified via LRU caches (because of false positives). Setting only one value for the confidence field is a bit tricky: more work is probably needed in the next future to tweak/fix/improve the logic.
* Update copyrightAlfredo Cardigliano2022-01-03
|
* Remove `struct ndpi_packet_struct` from `struct ndpi_flow_struct` (#1319)Ivan Nardi2021-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no real reasons to embed `struct ndpi_packet_struct` (i.e. "packet") in `struct ndpi_flow_struct` (i.e. "flow"). In other words, we can avoid saving dissection information of "current packet" into the "flow" state, i.e. in the flow management table. The nDPI detection module processes only one packet at the time, so it is safe to save packet dissection information in `struct ndpi_detection_module_struct`, reusing always the same "packet" instance and saving a huge amount of memory. Bottom line: we need only one copy of "packet" (for detection module), not one for each "flow". It is not clear how/why "packet" ended up in "flow" in the first place. It has been there since the beginning of the GIT history, but in the original OpenDPI code `struct ipoque_packet_struct` was embedded in `struct ipoque_detection_module_struct`, i.e. there was the same exact situation this commit wants to achieve. Most of the changes in this PR are some boilerplate to update something like "flow->packet" into something like "module->packet" throughout the code. Some attention has been paid to update `ndpi_init_packet()` since we need to reset some "packet" fields before starting to process another packet. There has been one important change, though, in ndpi_detection_giveup(). Nothing changed for the applications/users, but this function can't access "packet" anymore. The reason is that this function can be called "asynchronously" with respect to the data processing, i.e in context where there is no valid notion of "current packet"; for example ndpiReader calls it after having processed all the traffic, iterating the entire session table. Mining LRU stuff seems a bit odd (even before this patch): probably we need to rethink it, as a follow-up.
* Reworked flow risk implementationLuca Deri2021-07-23
|
* Improved DGA detection with trigrams. Disadvantage: slower startup timeLuca Deri2021-03-03
| | | | | Reworked Tor dissector embedded in TLS (fixes #1141) Removed false positive on HTTP User-Agent
* (C) UpdateLuca Deri2021-01-07
|
* Improved SSH protocol detection. (#1052)Toni2020-11-09
| | | Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* SSH code cleanupLuca Deri2020-07-25
|
* added other ssh implementations to checkMrRadix2020-07-24
|
* added cipher checkMrRadix2020-07-22
|
* Resolved conflicts on fetchMrRadix2020-07-22
|\
| * Added changes for handlign SSSH cipher detectionLuca Deri2020-07-22
| |
* | fixed bug inside set bit macro callMrRadix2020-07-22
| |
* | added sscanf error handlingMrRadix2020-07-22
| |
* | improved performance and legibilityMrRadix2020-07-22
| |
* | improved performance by removing linear scanMrRadix2020-07-22
| |
* | added ssh_analyse_signature_version and ssh_has_old_signature for check old ↵MrRadix2020-07-21
|/ | | | signature version of ssh
* Added skeleton for checking SSH signatureLuca Deri2020-07-20
|
* SSH boundary check reworkLuca Deri2020-04-30
|
* Minor cleanupLuca Deri2020-04-30
|
* Better fix for integer overflow in SSHPhilippe Antoine2020-04-30
| | | | Credits to GHSL
* ssh: fixing unsigned overflow leading to heap overflowPhilippe Antoine2020-04-02
| | | | cf GHSL-2020-051
* ssh: adds systematic bounds checks in concat_hash_stringPhilippe Antoine2020-04-02
| | | | cf GHSL-2020-052
* ssh: fix heap-overflow errorNardi Ivan2020-03-27
|
* Fixed invalid allocationLuca Deri2020-03-24
|
* Adds different checks against overflowsPhilippe Antoine2020-03-19
|
* Minor fixesLuca Deri2020-01-21
|
* Merge branch 'dev' of https://github.com/ntop/nDPI into devLuca Deri2020-01-05
|\
| * Removed disable_metadata_export preference that is no longer usefulLuca2019-12-29
| | | | | | | | since ndpi_process_extra_packet() can drive limited or full metadata export
* | Updated (C)Luca Deri2020-01-05
|/
* Fix invalid reads and add valgrind testemanuele-f2019-12-04
|
* SSH dissection improvementsLuca Deri2019-10-25
|
* SMTP and SSH dissection fixesLuca Deri2019-10-24
|
* Added STUN check to avoid false positivesLuca Deri2019-09-11
| | | | | Added fingerprint comments in SSH/TLS Added netflow test pcap
* SSH hash fixLuca Deri2019-08-26
|
* Add more length checks in HASSHemanuele-f2019-08-23
| | | | This to prevent possible crashes on invalid packets
* Implemented HASSH (https://github.com/salesforce/hassh)Luca Deri2019-08-22
|
* Major code cleanupLuca2018-07-21
| | | | Converted some not popular protocols to NDPI_PROTOCOL_GENERIC with category detection
* Added ndpi_set_detection_preferences() APi callLuca Deri2018-05-14
|