Go to the documentation of this file.
62 static int g_http_method_buffer_id = 0;
69 static bool DetectHttpMethodValidateCallback(
const Signature *s,
const char **sigerror);
72 const uint8_t _flow_flags,
void *txv,
const int list_id);
85 "content modifier to match only on the HTTP method-buffer";
115 "http request method");
118 DetectHttpMethodValidateCallback);
122 SCLogDebug(
"registering http_method rule option");
166 static bool DetectHttpMethodValidateCallback(
const Signature *s,
const char **sigerror)
172 for (; sm != NULL; sm = sm->
next) {
178 *sigerror =
"http_method pattern with trailing space";
181 }
else if (cd->
content[0] == 0x20) {
182 *sigerror =
"http_method pattern with leading space";
186 *sigerror =
"http_method pattern with trailing tab";
189 }
else if (cd->
content[0] == 0x09) {
190 *sigerror =
"http_method pattern with leading tab";
202 const uint8_t _flow_flags,
void *txv,
const int list_id)
206 htp_tx_t *tx = (htp_tx_t *)txv;
228 const uint8_t *b = NULL;
230 if (rs_http2_tx_get_method(txv, &b, &b_len) != 1)
232 if (b == NULL || b_len == 0)
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
#define SIGMATCH_INFO_STICKY_BUFFER
SigTableElmt * sigmatch_table
uint8_t DetectEngineInspectBufferGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Do the content inspection & validation for a signature.
#define SIGMATCH_INFO_CONTENT_MODIFIER
#define HTP_REQUEST_PROGRESS_LINE
int DetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
main detection engine ctx
#define htp_tx_request_method(tx)
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
int DetectBufferTypeGetByName(const char *name)
#define SIG_FLAG_TOSERVER
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror))
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
void DetectAppLayerMpmRegister(const char *name, int direction, int priority, PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register an app layer keyword for mpm
void DetectHttpMethodRegisterTests(void)
this function registers unit tests for DetectHttpMethod
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg, int sm_type, int sm_list, AppProto alproto)
SignatureInitData * init_data
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
void DetectHttpMethodFree(void *)
void InspectionBufferApplyTransforms(InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
SignatureInitDataBuffer * buffers
#define SCLogError(...)
Macro used to log ERROR messages.
Handle HTTP method match.
void InspectionBufferSetup(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
a single match condition for a signature
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
void DetectHttpMethodRegister(void)
Registration function for keyword: http_method.
void(* RegisterTests)(void)