Add WebDAV detection support (#2224)
* Add WebDAV detection support * Add pcap example * Update test results * Remove redundant checks * Add WebDAV related HTTP methods to fuzz/dictionary.dict * Add note about WebDAV
This commit is contained in:
+30
-1
@@ -2161,6 +2161,13 @@ const char* ndpi_http_method2str(ndpi_http_method m) {
|
||||
case NDPI_HTTP_METHOD_RPC_CONNECT: return("RPC_CONNECT");
|
||||
case NDPI_HTTP_METHOD_RPC_IN_DATA: return("RPC_IN_DATA");
|
||||
case NDPI_HTTP_METHOD_RPC_OUT_DATA: return("RPC_OUT_DATA");
|
||||
case NDPI_HTTP_METHOD_MKCOL: return("MKCOL");
|
||||
case NDPI_HTTP_METHOD_MOVE: return("MOVE");
|
||||
case NDPI_HTTP_METHOD_COPY: return("COPY");
|
||||
case NDPI_HTTP_METHOD_LOCK: return("LOCK");
|
||||
case NDPI_HTTP_METHOD_UNLOCK: return("UNLOCK");
|
||||
case NDPI_HTTP_METHOD_PROPFIND: return("PROPFIND");
|
||||
case NDPI_HTTP_METHOD_PROPPATCH: return("PROPPATCH");
|
||||
}
|
||||
|
||||
return("Unknown HTTP method");
|
||||
@@ -2176,18 +2183,38 @@ ndpi_http_method ndpi_http_str2method(const char* method, u_int16_t method_len)
|
||||
case 'O': return(NDPI_HTTP_METHOD_OPTIONS);
|
||||
case 'G': return(NDPI_HTTP_METHOD_GET);
|
||||
case 'H': return(NDPI_HTTP_METHOD_HEAD);
|
||||
case 'L': return(NDPI_HTTP_METHOD_LOCK);
|
||||
|
||||
case 'M':
|
||||
if (method[1] == 'O')
|
||||
return(NDPI_HTTP_METHOD_MOVE);
|
||||
else
|
||||
return(NDPI_HTTP_METHOD_MKCOL);
|
||||
break;
|
||||
|
||||
case 'P':
|
||||
switch(method[1]) {
|
||||
case 'A':return(NDPI_HTTP_METHOD_PATCH);
|
||||
case 'O':return(NDPI_HTTP_METHOD_POST);
|
||||
case 'U':return(NDPI_HTTP_METHOD_PUT);
|
||||
case 'R':
|
||||
if (method_len >= 5) {
|
||||
if (strncmp(method, "PROPF", 5) == 0)
|
||||
return(NDPI_HTTP_METHOD_PROPFIND);
|
||||
else if (strncmp(method, "PROPP", 5) == 0)
|
||||
return NDPI_HTTP_METHOD_PROPPATCH;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'D': return(NDPI_HTTP_METHOD_DELETE);
|
||||
case 'T': return(NDPI_HTTP_METHOD_TRACE);
|
||||
case 'C': return(NDPI_HTTP_METHOD_CONNECT);
|
||||
case 'C':
|
||||
if (method_len == 4)
|
||||
return(NDPI_HTTP_METHOD_COPY);
|
||||
else
|
||||
return(NDPI_HTTP_METHOD_CONNECT);
|
||||
|
||||
case 'R':
|
||||
if(method_len >= 11) {
|
||||
if(strncmp(method, "RPC_CONNECT", 11) == 0) {
|
||||
@@ -2199,6 +2226,8 @@ ndpi_http_method ndpi_http_str2method(const char* method, u_int16_t method_len)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'U': return(NDPI_HTTP_METHOD_UNLOCK);
|
||||
}
|
||||
|
||||
return(NDPI_HTTP_METHOD_UNKNOWN);
|
||||
|
||||
Reference in New Issue
Block a user