aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/ftp_control.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2021-09-10 22:00:04 +0200
committerLuca Deri <deri@ntop.org>2021-09-10 22:00:04 +0200
commit00857abf2c008b77f3e1d9eba9505b1b22239543 (patch)
treece6adc2088f29a1e10bccc98363e190982d77bc2 /src/lib/protocols/ftp_control.c
parent1fadf4754a1741e6fd690dbb65ae778fd1dc0313 (diff)
Added new risk for clear text credentials
Diffstat (limited to 'src/lib/protocols/ftp_control.c')
-rw-r--r--src/lib/protocols/ftp_control.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/protocols/ftp_control.c b/src/lib/protocols/ftp_control.c
index 7bf35e719..55ea192b0 100644
--- a/src/lib/protocols/ftp_control.c
+++ b/src/lib/protocols/ftp_control.c
@@ -41,7 +41,8 @@ static void ndpi_int_ftp_control_add_connection(struct ndpi_detection_module_str
/* *************************************************************** */
-static int ndpi_ftp_control_check_request(struct ndpi_flow_struct *flow,
+static int ndpi_ftp_control_check_request(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
const u_int8_t *payload,
size_t payload_len) {
#ifdef FTP_DEBUG
@@ -52,6 +53,7 @@ static int ndpi_ftp_control_check_request(struct ndpi_flow_struct *flow,
ndpi_user_pwd_payload_copy((u_int8_t*)flow->protos.ftp_imap_pop_smtp.username,
sizeof(flow->protos.ftp_imap_pop_smtp.username), 5,
payload, payload_len);
+ ndpi_set_risk(ndpi_struct, flow, NDPI_CLEAR_TEXT_CREDENTIALS);
return 1;
}
@@ -602,7 +604,8 @@ static void ndpi_check_ftp_control(struct ndpi_detection_module_struct *ndpi_str
if(flow->ftp_control_stage == 0) {
NDPI_LOG_DBG2(ndpi_struct, "FTP_CONTROL stage 0: \n");
- if((payload_len > 0) && ndpi_ftp_control_check_request(flow, packet->payload, payload_len)) {
+ if((payload_len > 0) && ndpi_ftp_control_check_request(ndpi_struct,
+ flow, packet->payload, payload_len)) {
NDPI_LOG_DBG2(ndpi_struct,
"Possible FTP_CONTROL request detected, we will look further for the response..\n");