Exported username in flow information

This commit is contained in:
Luca Deri
2022-07-04 22:52:54 +02:00
parent 461589517e
commit 7fa8d882d8
11 changed files with 42 additions and 18 deletions
+6 -1
View File
@@ -50,10 +50,15 @@ static int ndpi_ftp_control_check_request(struct ndpi_detection_module_struct *n
#endif
if(ndpi_match_strprefix(payload, payload_len, "USER")) {
char buf[64];
ndpi_user_pwd_payload_copy((u_int8_t*)flow->l4.tcp.ftp_imap_pop_smtp.username,
sizeof(flow->l4.tcp.ftp_imap_pop_smtp.username), 5,
payload, payload_len);
ndpi_set_risk(ndpi_struct, flow, NDPI_CLEAR_TEXT_CREDENTIALS, "Found FTP username");
snprintf(buf, sizeof(buf), "Found FTP username (%s)",
flow->l4.tcp.ftp_imap_pop_smtp.username);
ndpi_set_risk(ndpi_struct, flow, NDPI_CLEAR_TEXT_CREDENTIALS, buf);
return 1;
}