Implemented FTP user/pwd extraction
This commit is contained in:
@@ -1234,6 +1234,10 @@ struct ndpi_flow_struct {
|
||||
u_char nat_ip[24];
|
||||
} http;
|
||||
|
||||
struct {
|
||||
char username[16], password[16];
|
||||
} ftp;
|
||||
|
||||
struct {
|
||||
/* Bittorrent hash */
|
||||
u_char hash[20];
|
||||
|
||||
@@ -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);
|
||||
|
||||
+689
-620
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user