Add bitcoing protocol dissector. (#1992)
* Add bitcoing protocol dissector. * remove bitcoin protcol detection from mining.c * add a new bitcoin deissector. * add a new category: Cryptocurrency. Signed-off-by: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com> * Remove useless checks and add missing windows and docs file. Signed-off-by: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com> * update affected tests. Signed-off-by: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com> * add a brief version. Add notes on the difference between normal bitcoin protocol and the mining protocol. Signed-off-by: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com> * update enable_payload_stat test after dev rebasing. Signed-off-by: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com> --------- Signed-off-by: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com>
This commit is contained in:
@@ -98,23 +98,6 @@ static void ndpi_search_mining_tcp(struct ndpi_detection_module_struct *ndpi_str
|
||||
|
||||
/* Check connection over TCP */
|
||||
if(packet->payload_packet_len > 10) {
|
||||
if(packet->tcp->source == htons(8333) ||
|
||||
packet->tcp->dest == htons(8333)) {
|
||||
/*
|
||||
Bitcoin
|
||||
|
||||
bitcoin.magic == 0xf9beb4d9 || bitcoin.magic == 0xfabfb5da
|
||||
*/
|
||||
u_int32_t magic = htonl(0xf9beb4d9), magic1 = htonl(0xfabfb5da), *to_match = (u_int32_t*)packet->payload;
|
||||
|
||||
if((*to_match == magic) || (*to_match == magic1)) {
|
||||
ndpi_snprintf(flow->flow_extra_info, sizeof(flow->flow_extra_info), "%s", "ETH");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
cacheMiningHostTwins(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if((packet->payload_packet_len > 300)
|
||||
&& (packet->payload_packet_len < 600)
|
||||
&& (packet->payload[2] == 0x04)) {
|
||||
|
||||
Reference in New Issue
Block a user