wireshark: lua: export some metadata
Export some metadata (for the moment, SNI and TLS fingerprints) to Wireshark/tshark via extcap. Note that: * metadata are exported only once per flow * metadata are exported (all together) when nDPI stopped processing the flow Still room for a lot of improvements! In particular: * we need to add some boundary checks (if we are going to export other attributes) * we should try to have a variable length trailer
This commit is contained in:
@@ -126,9 +126,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
|
||||
if(packet_checked) {
|
||||
ndpi_risk flow_risk;
|
||||
struct ndpi_flow_info *flow = NULL; /* unused */
|
||||
|
||||
memcpy(packet_checked, pkt, header->caplen);
|
||||
ndpi_workflow_process_packet(workflow, header, packet_checked, &flow_risk);
|
||||
ndpi_workflow_process_packet(workflow, header, packet_checked, &flow_risk, &flow);
|
||||
free(packet_checked);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
ndpi_serialization_format serialization_format;
|
||||
NDPI_PROTOCOL_BITMASK enabled_bitmask;
|
||||
ndpi_risk flow_risk;
|
||||
struct ndpi_flow_info *flow = NULL; /* unused */
|
||||
const u_char *pkt;
|
||||
struct pcap_pkthdr *header;
|
||||
int r, rc;
|
||||
@@ -95,7 +96,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
header = NULL;
|
||||
r = pcap_next_ex(pcap_handle, &header, &pkt);
|
||||
while (r > 0) {
|
||||
ndpi_workflow_process_packet(w, header, pkt, &flow_risk);
|
||||
ndpi_workflow_process_packet(w, header, pkt, &flow_risk, &flow);
|
||||
r = pcap_next_ex(pcap_handle, &header, &pkt);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user