This commit is contained in:
Luca Deri
2019-05-20 22:02:21 +02:00
parent 53e64df8e2
commit 0d2f8f4498
6 changed files with 104 additions and 21 deletions
+26 -8
View File
@@ -749,6 +749,22 @@ char* intoaV4(u_int32_t addr, char* buf, u_int16_t bufLen) {
/* ********************************** */
static char* print_cipher(u_int8_t c) {
switch(c) {
case NDPI_CIPHER_INSECURE:
return(" (INSECURE)");
break;
case NDPI_CIPHER_WEAK:
return(" (WEAK)");
break;
default:
return("");
}
}
/* ********************************** */
/**
* @brief Print the flow
*/
@@ -800,14 +816,16 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
flow->dst2src_packets, (long long unsigned int) flow->dst2src_bytes);
if(flow->host_server_name[0] != '\0') fprintf(out, "[Host: %s]", flow->host_server_name);
if(flow->info[0] != '\0') fprintf(out, "[%s]", flow->info);
if(flow->ssh_ssl.ja3_client[0] != '\0') fprintf(out, "[JA3C: %s]", flow->ssh_ssl.ja3_client);
if(flow->ssh_ssl.ja3_client[0] != '\0') fprintf(out, "[JA3C: %s%s]", flow->ssh_ssl.ja3_client,
print_cipher(flow->ssh_ssl.client_unsafe_cipher));
if(flow->ssh_ssl.server_info[0] != '\0') fprintf(out, "[server: %s]", flow->ssh_ssl.server_info);
if(flow->ssh_ssl.ja3_server[0] != '\0') fprintf(out, "[JA3S: %s]", flow->ssh_ssl.ja3_server);
if(flow->ssh_ssl.ja3_server[0] != '\0') fprintf(out, "[JA3S: %s%s]", flow->ssh_ssl.ja3_server,
print_cipher(flow->ssh_ssl.server_unsafe_cipher));
if(flow->ssh_ssl.server_organization[0] != '\0') fprintf(out, "[organization: %s]", flow->ssh_ssl.server_organization);
if(flow->bittorent_hash[0] != '\0') fprintf(out, "[BT Hash: %s]", flow->bittorent_hash);
@@ -856,13 +874,13 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
if(flow->ssh_ssl.ja3_server[0] != '\0')
json_object_object_add(jObj,"ja3s",json_object_new_string(flow->ssh_ssl.ja3_server));
if(flow->ssh_ssl.ja3_client[0] != '\0')
json_object_object_add(jObj,"ja3c",json_object_new_string(flow->ssh_ssl.ja3_client));
if(flow->ja3_server[0] != '\0')
json_object_object_add(jObj,"host.server.ja3",json_object_new_string(flow->ja3_server));
if(flow->ssh_ssl.client_info[0] != '\0')
json_object_object_add(sjObj, "client", json_object_new_string(flow->ssh_ssl.client_info));