diff options
author | Luca Deri <deri@ntop.org> | 2019-10-20 21:49:45 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2019-10-20 21:49:45 +0200 |
commit | 1a5c7daaf67b316ad9cdcf5bba911db1a7e58f12 (patch) | |
tree | 3a7e797f3ac1979bcdbea70a755b7148a042117c /src/lib/ndpi_utils.c | |
parent | c1ba4764b54be167459e5647efe1c8d57310f151 (diff) |
Implemented FTP user/pwd extraction
Diffstat (limited to 'src/lib/ndpi_utils.c')
-rw-r--r-- | src/lib/ndpi_utils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c index bda7f15ad..4d98aa6d2 100644 --- a/src/lib/ndpi_utils.c +++ b/src/lib/ndpi_utils.c @@ -881,6 +881,13 @@ int ndpi_flow2json(struct ndpi_detection_module_struct *ndpi_struct, ndpi_serialize_end_of_block(serializer); break; + case NDPI_PROTOCOL_FTP_CONTROL: + ndpi_serialize_start_of_block(serializer, "ftp"); + ndpi_serialize_string_string(serializer, "user", flow->protos.ftp.username); + ndpi_serialize_string_string(serializer, "password", flow->protos.ftp.password); + ndpi_serialize_end_of_block(serializer); + break; + case NDPI_PROTOCOL_SSH: ndpi_serialize_start_of_block(serializer, "ssh"); ndpi_serialize_string_string(serializer, "client_signature", flow->protos.ssh.client_signature); @@ -909,10 +916,12 @@ int ndpi_flow2json(struct ndpi_detection_module_struct *ndpi_struct, ndpi_serialize_string_string(serializer, "client_cert", flow->protos.stun_ssl.ssl.client_certificate); ndpi_serialize_string_string(serializer, "server_cert", flow->protos.stun_ssl.ssl.server_certificate); ndpi_serialize_string_string(serializer, "issuer", flow->protos.stun_ssl.ssl.server_organization); + if(before) { strftime(notBefore, sizeof(notBefore), "%F %T", before); ndpi_serialize_string_string(serializer, "notbefore", notBefore); } + if(after) { strftime(notAfter, sizeof(notAfter), "%F %T", after); ndpi_serialize_string_string(serializer, "notafter", notAfter); |