aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2023-07-18 07:41:56 +0200
committerGitHub <noreply@github.com>2023-07-18 07:41:56 +0200
commit3edfad01a1bb22b33bd5bafa0ceeb13e27f03e67 (patch)
tree6236e68075678a76a402e37f0ff09e5e273faf13 /src/lib/protocols
parent09548bb7cf661f42cc496c412ccfd62a864f5029 (diff)
fuzz: extend fuzzing coverage (#2052)
Added/merged some traces. Improved Socks identification
Diffstat (limited to 'src/lib/protocols')
-rw-r--r--src/lib/protocols/socks45.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/protocols/socks45.c b/src/lib/protocols/socks45.c
index 6845ecaf2..6cdac93d1 100644
--- a/src/lib/protocols/socks45.c
+++ b/src/lib/protocols/socks45.c
@@ -90,7 +90,8 @@ static void ndpi_check_socks5(struct ndpi_detection_module_struct *ndpi_struct,
if(flow->socks5_stage == 0) {
NDPI_LOG_DBG2(ndpi_struct, "SOCKS5 stage 0: \n");
- if((payload_len == 3) && (packet->payload[0] == 0x05) && (packet->payload[1] == 0x01) && (packet->payload[2] == 0x00)) {
+ if(((payload_len == 3) && (packet->payload[0] == 0x05) && (packet->payload[1] == 0x01) && (packet->payload[2] == 0x00)) ||
+ ((payload_len == 4) && (packet->payload[0] == 0x05) && (packet->payload[1] == 0x02) && (packet->payload[2] == 0x00) && (packet->payload[3] == 0x01))) {
NDPI_LOG_DBG2(ndpi_struct, "Possible SOCKS5 request detected, we will look further for the response\n");
/* Encode the direction of the packet in the stage, so we will know when we need to look for the response packet. */