Go to the documentation of this file.
65 static bool DetectHttpHostValidateCallback(
const Signature *s,
const char **sigerror);
69 Flow *_f,
const uint8_t _flow_flags,
70 void *txv,
const int list_id);
75 static int g_http_raw_host_buffer_id = 0;
79 const uint8_t _flow_flags,
void *txv,
const int list_id);
83 static int g_http_host_buffer_id = 0;
94 "/rules/http-keywords.html#http-host-and-http-raw-host";
122 DetectHttpHostValidateCallback);
132 "or the raw hostname from the HTTP uri";
134 "/rules/http-keywords.html#http-host-and-http-raw-host";
159 "http raw host header");
183 static bool DetectHttpHostValidateCallback(
const Signature *s,
const char **sigerror)
189 for (; sm != NULL; sm = sm->
next) {
193 *sigerror =
"http.host keyword "
194 "specified along with \"nocase\". "
195 "The hostname buffer is normalized "
196 "to lowercase, specifying "
197 "nocase is redundant.";
207 *sigerror =
"A pattern with "
208 "uppercase characters detected for http.host. "
209 "The hostname buffer is normalized to lowercase, "
210 "please specify a lowercase pattern.";
242 const uint8_t _flow_flags,
void *txv,
const int list_id)
246 htp_tx_t *tx = (htp_tx_t *)txv;
268 const uint8_t *b = NULL;
270 if (rs_http2_tx_get_host_norm(txv, &b, &b_len) != 1)
272 if (b == NULL || b_len == 0)
289 const uint8_t *b = NULL;
291 if (rs_http2_tx_get_host(txv, &b, &b_len) != 1)
293 if (b == NULL || b_len == 0)
342 const uint8_t _flow_flags,
void *txv,
const int list_id)
346 htp_tx_t *tx = (htp_tx_t *)txv;
348 const uint8_t *data = NULL;
349 uint32_t data_len = 0;
351 if (tx->parsed_uri == NULL || tx->parsed_uri->hostname == NULL) {
362 data = (
const uint8_t *)bstr_ptr(tx->parsed_uri->hostname);
363 data_len = bstr_len(tx->parsed_uri->hostname);
#define DETECT_CONTENT_NOCASE
#define htp_header_value_len(h)
void DetectHttpHHRegister(void)
Registers the keyword handlers for the "http_host" keyword.
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
int DetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
main detection engine ctx
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Handle HTTP host header. HHHD - Http Host Header Data.
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
#define htp_header_value(h)
int DetectBufferTypeGetByName(const char *name)
#define htp_tx_request_headers(tx)
#define SIG_FLAG_TOSERVER
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror))
void DetectHttpHHRegisterTests(void)
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
#define SCLogWarning(...)
Macro used to log WARNING messages.
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
#define htp_tx_request_hostname(tx)
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg, int sm_type, int sm_list, AppProto alproto)
#define htp_header_value_ptr(h)
SignatureInitData * init_data
void InspectionBufferApplyTransforms(InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
#define HTP_REQUEST_PROGRESS_HEADERS
SignatureInitDataBuffer * buffers
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)
#define htp_tx_request_header(tx, header)
void(* RegisterTests)(void)