Go to the documentation of this file.
52 #define KEYWORD_NAME "ssh.hassh.server"
53 #define KEYWORD_ALIAS "ssh-hassh-server"
54 #define KEYWORD_DOC "ssh-keywords.html#ssh.hassh.server"
55 #define BUFFER_NAME "ssh.hassh.server"
56 #define BUFFER_DESC "Ssh Client Fingerprinting For Ssh Servers"
57 static int g_ssh_hassh_buffer_id = 0;
62 const uint8_t flow_flags,
void *txv,
const int list_id)
70 const uint8_t *hasshServer = NULL;
73 if (rs_ssh_tx_get_hassh(txv, &hasshServer, &b_len, flow_flags) != 1)
75 if (hasshServer == NULL || b_len == 0) {
107 rs_ssh_enable_hassh();
121 static bool DetectSshHasshServerHashValidateCallback(
const Signature *s,
const char **sigerror)
127 for (; sm != NULL; sm = sm->
next) {
134 *sigerror =
"ssh.hassh.server should not be used together with "
135 "nocase, since the rule is automatically "
136 "lowercased anyway which makes nocase redundant.";
141 *sigerror =
"Invalid length of the specified ssh.hassh.server (should "
142 "be 32 characters long). This rule will therefore "
148 if (!isxdigit(cd->
content[i])) {
149 *sigerror =
"Invalid ssh.hassh.server string (should be string of hexadecimal "
151 "This rule will therefore never match.";
168 for (; sm != NULL; sm = sm->
next) {
#define DETECT_CONTENT_NOCASE
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.
int DetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
void DetectBufferTypeRegisterSetupCallback(const char *name, void(*SetupCallback)(const DetectEngineCtx *, Signature *))
main detection engine ctx
@ DETECT_AL_SSH_HASSH_SERVER
void DetectSshHasshServerRegister(void)
Registration function for hasshServer keyword.
#define SIG_FLAG_TOCLIENT
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
int DetectBufferTypeGetByName(const char *name)
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)
#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
SignatureInitData * init_data
Data structures and function prototypes for keeping state for the detection engine.
int RunmodeIsUnittests(void)
bool SigMatchSilentErrorEnabled(const DetectEngineCtx *de_ctx, const enum DetectKeywordId id)
void InspectionBufferApplyTransforms(InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
SignatureInitDataBuffer * buffers
#define SCLogError(...)
Macro used to log ERROR messages.
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.
SpmGlobalThreadCtx * spm_global_thread_ctx
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
void SpmDestroyCtx(SpmCtx *ctx)
SpmCtx * SpmInitCtx(const uint8_t *needle, uint16_t needle_len, int nocase, SpmGlobalThreadCtx *global_thread_ctx)