72 Flow *f,
const uint8_t flow_flags,
73 void *txv,
const int list_id);
75static int g_tls_ja3s_hash_buffer_id = 0;
110 DetectTlsJa3SHashSetupCallback);
136 SCLogError(
"rule contains conflicting protocols.");
156 const uint8_t flow_flags,
void *txv,
const int list_id)
162 if (ssl_state->server_connp.ja3_hash == NULL) {
166 const uint32_t data_len = (uint32_t)strlen(ssl_state->server_connp.ja3_hash);
167 const uint8_t *data = (uint8_t *)ssl_state->server_connp.ja3_hash;
170 det_ctx, list_id, buffer, data, data_len, transforms);
183 for (; sm != NULL; sm = sm->
next) {
189 bool changed =
false;
191 for (u = 0; u < cd->content_len; u++) {
192 if (isupper(cd->content[u])) {
void SSLEnableJA3(void)
if not explicitly disabled in config, enable ja3 support
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
void InspectionBufferSetupAndApplyTransforms(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len, const DetectEngineTransforms *transforms)
setup the buffer with our initial data
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const 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
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
void DetectBufferTypeRegisterSetupCallback(const char *name, void(*SetupCallback)(const DetectEngineCtx *, Signature *))
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.
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
bool DetectMd5ValidateCallback(const Signature *s, const char **sigerror, const DetectBufferType *map)
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror, const DetectBufferType *))
int DetectBufferTypeGetByName(const char *name)
int DetectSignatureSetMultiAppProto(Signature *s, const AppProto *alprotos)
this function is used to set multiple possible app-layer protos
bool SigMatchSilentErrorEnabled(const DetectEngineCtx *de_ctx, const enum DetectKeywordId id)
SigTableElmt * sigmatch_table
void DetectTlsJa3SHashRegister(void)
Registration function for keyword: ja3s.hash.
#define SIG_FLAG_TOCLIENT
#define SIGMATCH_INFO_STICKY_BUFFER
main detection engine ctx
SpmGlobalThreadCtx * spm_global_thread_ctx
SSLv[2.0|3.[0|1|2|3]] state structure.
a single match condition for a signature
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
SignatureInitDataBuffer * buffers
SignatureInitData * init_data
int RunmodeIsUnittests(void)
#define SCLogError(...)
Macro used to log ERROR messages.
int Ja3IsDisabled(const char *type)
SpmCtx * SpmInitCtx(const uint8_t *needle, uint16_t needle_len, int nocase, SpmGlobalThreadCtx *global_thread_ctx)
void SpmDestroyCtx(SpmCtx *ctx)