From 7fa8d882d83577334c7c91843eb40c2ebae8bf74 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Mon, 4 Jul 2022 22:52:54 +0200 Subject: Exported username in flow information --- src/lib/protocols/telnet.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lib/protocols/telnet.c') diff --git a/src/lib/protocols/telnet.c b/src/lib/protocols/telnet.c index 43badd08c..d3ec02958 100644 --- a/src/lib/protocols/telnet.c +++ b/src/lib/protocols/telnet.c @@ -90,10 +90,16 @@ static int search_telnet_again(struct ndpi_detection_module_struct *ndpi_struct, } if(packet->payload[0] == '\r') { + char buf[64]; + flow->protos.telnet.username_detected = 1; - ndpi_set_risk(ndpi_struct, flow, NDPI_CLEAR_TEXT_CREDENTIALS, "Found username"); flow->protos.telnet.username[flow->protos.telnet.character_id] = '\0'; flow->protos.telnet.character_id = 0; + + snprintf(buf, sizeof(buf), "Found Telnet username (%s)", + flow->protos.telnet.username); + ndpi_set_risk(ndpi_struct, flow, NDPI_CLEAR_TEXT_CREDENTIALS, buf); + return(1); } -- cgit v1.2.3