293static void PrintFeatureList(
const SigTableElmt *e,
char sep)
305 printf(
"compatible with IP only rule");
311 printf(
"compatible with decoder event only rule");
317 printf(
"content modifier");
323 printf(
"sticky buffer");
329 printf(
"supports firewall");
349static void SigMultilinePrint(
size_t i,
const char *prefix)
354 printf(
"%sFeatures: ", prefix);
371 if (
name == NULL || strlen(
name) == 0) {
375 if (strcmp(keyword,
name) == 0) {
388 if (keyword == NULL) {
389 printf(
"=====Supported keywords=====\n");
390 for (i = 0; i < size; i++) {
392 if (
name != NULL && strlen(
name) > 0) {
393 if (
name[0] ==
'_' || strcmp(
name,
"template") == 0)
396 printf(
"- %s\n",
name);
399 }
else if (strcmp(
"csv", keyword) == 0) {
400 printf(
"name;description;app layer;features;documentation\n");
401 for (i = 0; i < size; i++) {
403 if (
name != NULL && strlen(
name) > 0) {
404 if (
name[0] ==
'_' || strcmp(
name,
"template") == 0)
422 }
else if (strcmp(
"all", keyword) == 0) {
423 for (i = 0; i < size; i++) {
425 if (
name != NULL && strlen(
name) > 0) {
426 if (
name[0] ==
'_' || strcmp(
name,
"template") == 0)
429 SigMultilinePrint(i,
"\t");
433 for (i = 0; i < size; i++) {
437 SigMultilinePrint(i,
"");
441 printf(
"Non existing keyword\n");
447static void DetectFileHandlerRegister(
void)
457 SCSigTableNamesElmt kw;
459 kw.name = (
char *)base->
name;
460 kw.desc = (
char *)base->desc;
461 kw.url = (
char *)base->url;
462 SCDetectSigMatchNamesFree(&kw);
485#define ARRAY_CAP_STEP 16
486static void (**PreregisteredCallbacks)(void) = NULL;
487static size_t preregistered_callbacks_nb = 0;
488static size_t preregistered_callbacks_cap = 0;
496 if (preregistered_callbacks_nb == preregistered_callbacks_cap) {
497 void *tmp =
SCRealloc(PreregisteredCallbacks,
503 PreregisteredCallbacks = tmp;
505 PreregisteredCallbacks[preregistered_callbacks_nb] = KeywordsRegister;
506 preregistered_callbacks_nb++;
517 FatalError(
"Could not allocate sigmatch_table");
741 DetectTransformCompressWhitespaceRegister();
742 DetectTransformStripWhitespaceRegister();
743 DetectTransformStripPseudoHeadersRegister();
744 DetectTransformMd5Register();
745 DetectTransformSha1Register();
746 DetectTransformSha256Register();
747 DetectTransformDotPrefixRegister();
749 DetectTransformUrlDecodeRegister();
750 DetectTransformXorRegister();
751 DetectTransformToLowerRegister();
752 DetectTransformToUpperRegister();
753 DetectTransformHeaderLowercaseRegister();
754 DetectTransformFromBase64DecodeRegister();
755 SCDetectTransformDomainRegister();
758 DetectFileHandlerRegister();
766 SCDetectDHCPRegister();
767 SCDetectWebsocketRegister();
768 SCDetectEnipRegister();
769 SCDetectMqttRegister();
770 SCDetectRfbRegister();
771 SCDetectSipRegister();
772 SCDetectTemplateRegister();
773 SCDetectLdapRegister();
774 SCDetectSdpRegister();
775 SCDetectDNSRegister();
776 SCDetectPgsqlRegister();
778 for (
size_t i = 0; i < preregistered_callbacks_nb; i++) {
779 PreregisteredCallbacks[i]();
796 SCLogDebug(
"detection plugin %s has no unittest "
801 "registration function.",
void DetectAppLayerEventRegister(void)
Registers the keyword handlers for the "app-layer-event" keyword.
void DetectAppLayerProtocolRegister(void)
void DetectAppLayerStateRegister(void)
void DetectAsn1Register(void)
Registration function for asn1.
void DetectBase64DataRegister(void)
void DetectBase64DecodeRegister(void)
void DetectBsizeRegister(void)
Registration function for bsize: keyword.
void DetectBypassRegister(void)
Registration function for keyword: bypass.
void DetectBytejumpRegister(void)
void DetectBytemathRegister(void)
Registers the keyword handlers for the "byte_math" keyword.
void DetectBytetestRegister(void)
void DetectClasstypeRegister(void)
Registers the handler functions for the "Classtype" keyword.
void DetectConfigRegister(void)
Registers the "config" keyword for detection.
void DetectContentRegister(void)
void DetectCsumRegister(void)
Registers handlers for all the checksum keywords. The checksum keywords that are registered are ipv4-...
void DetectDatarepRegister(void)
void DetectDatasetRegister(void)
void DetectDceIfaceRegister(void)
Registers the keyword handlers for the "dce_iface" keyword.
void DetectDceOpnumRegister(void)
Registers the keyword handlers for the "dce_opnum" keyword.
void DetectDceStubDataRegister(void)
Registers the keyword handlers for the "dce_stub_data" keyword.
void DetectDepthRegister(void)
void DetectDetectionFilterRegister(void)
Registration function for detection_filter: keyword.
void DetectDistanceRegister(void)
void DetectDNP3Register(void)
void DetectDnsNameRegister(void)
void DetectDnsResponseRegister(void)
void DetectDsizeRegister(void)
Registration function for dsize: keyword.
void DetectEmailRegister(void)
void DetectEngineEventRegister(void)
Registration function for decode-event: keyword.
int SigTableList(const char *keyword)
int SCSigTablePreRegister(void(*KeywordsRegister)(void))
void SCDetectHelperKeywordSetCleanCString(uint16_t id)
bool SigTableHasKeyword(const char *keyword)
Check if a keyword exists.
void SigTableCleanup(void)
void SigTableRegisterTests(void)
#define DETECT_TBLSIZE_STEP
Data structures and function prototypes for keeping state for the detection engine.
void DetectBufferTypeCloseRegistration(void)
void DetectEntropyRegister(void)
void DetectFastPatternRegister(void)
Registration function for fast_pattern keyword.
DetectFileHandlerTableElmt filehandler_table[DETECT_TBLSIZE_STATIC]
void DetectFiledataRegister(void)
Registration function for keyword: file_data.
void DetectFileRegisterFileProtocols(DetectFileHandlerTableElmt *reg)
void DetectFilemagicRegister(void)
Registration function for keyword: filemagic.
void DetectFileMd5Register(void)
Registration function for keyword: filemd5.
void DetectFilenameRegister(void)
Registration function for keyword: filename.
void DetectFileSha1Register(void)
Registration function for keyword: filesha1.
void DetectFileSha256Register(void)
Registration function for keyword: filesha256.
void DetectFilesizeRegister(void)
Registration function for filesize: keyword.
void DetectFilestoreRegister(void)
Registration function for keyword: filestore.
void DetectFlowAgeRegister(void)
void DetectFlowBytesToServerRegister(void)
void DetectFlowPktsRegister(void)
void DetectFlowBytesRegister(void)
void DetectFlowBytesToClientRegister(void)
void DetectFlowPktsToClientRegister(void)
void DetectFlowPktsToServerRegister(void)
void DetectFlowRegister(void)
Registration function for flow: keyword.
void DetectFlowbitsRegister(void)
void DetectFlowintRegister(void)
void DetectFlowvarRegister(void)
void DetectFragBitsRegister(void)
Registration function for fragbits: keyword.
void DetectFragOffsetRegister(void)
Registration function for fragoffset.
void DetectFrameRegister(void)
Registration function for keyword: ja3_hash.
void DetectFtpCommandDataRegister(void)
void DetectFtpCommandRegister(void)
void DetectFtpCompletionCodeRegister(void)
void DetectFtpDynamicPortRegister(void)
void DetectFtpModeRegister(void)
void DetectFtpReplyReceivedRegister(void)
Registration function for ftp.reply_received: keyword.
void DetectFtpReplyRegister(void)
void DetectFtpbounceRegister(void)
Registration function for ftpbounce: keyword.
void DetectFtpdataRegister(void)
Registration function for ftpcommand: keyword.
void DetectGeoipRegister(void)
Registration function for geoip keyword (no libgeoip support)
void DetectGidRegister(void)
Registration function for gid: keyword.
void DetectHostbitsRegister(void)
void DetectHttpClientBodyRegister(void)
Registers the keyword handlers for the "http_client_body" keyword.
void DetectHttpCookieRegister(void)
Registration function for keyword: http_cookie.
void DetectHttpHHRegister(void)
Registers the keyword handlers for the "http_host" keyword.
void DetectHttpMethodRegister(void)
Registration function for keyword: http_method.
void DetectHttpProtocolRegister(void)
Registers the keyword handlers for the "http.protocol" keyword.
void DetectHttpRequestLineRegister(void)
Registers the keyword handlers for the "http_request_line" keyword.
void DetectHttpResponseLineRegister(void)
Registers the keyword handlers for the "http_response_line" keyword.
void DetectHttpServerBodyRegister(void)
Registers the keyword handlers for the "http_server_body" keyword.
void DetectHttpStartRegister(void)
Registers the keyword handlers for the "http_start" keyword.
void DetectHttpStatCodeRegister(void)
Registration function for keyword: http_stat_code.
void DetectHttpStatMsgRegister(void)
Registration function for keyword: http_stat_msg.
void DetectHttpUARegister(void)
Registers the keyword handlers for the "http_user_agent" keyword.
void DetectHttpUriRegister(void)
Registration function for keywords: http_uri and http.uri.
void DetectHttp2Register(void)
Registration function for HTTP2 keywords.
void DetectIcmpIdRegister(void)
Registration function for icode: icmp_id.
void DetectIcmpSeqRegister(void)
Registration function for icmp_seq.
void DetectIcmpv4HdrRegister(void)
Registration function for icmpv4.hdr: keyword.
void DetectICMPv6mtuRegister(void)
Registration function for icmpv6.mtu: keyword.
void DetectICMPv6hdrRegister(void)
Registration function for icmpv6.hdr: keyword.
void DetectICodeRegister(void)
Registration function for icode: keyword.
void DetectIdRegister(void)
Registration function for keyword: id.
void DetectIkeChosenSaRegister(void)
Registration function for ike.ChosenSa keyword.
void DetectIkeExchTypeRegister(void)
Registration function for ike.exchtype keyword.
void DetectIkeKeyExchangePayloadLengthRegister(void)
Registration function for ike.key_exchange_payload_length keyword.
void DetectIkeKeyExchangeRegister(void)
void DetectIkeNoncePayloadLengthRegister(void)
Registration function for ike.nonce_payload_length keyword.
void DetectIkeNonceRegister(void)
void DetectIkeSpiRegister(void)
void DetectIkeVendorRegister(void)
Registration function for ike.vendor keyword.
void DetectIPAddrBufferRegister(void)
void DetectIpOptsRegister(void)
Registration function for ipopts: keyword.
void DetectIPProtoRegister(void)
Registration function for ip_proto keyword.
void DetectIPRepRegister(void)
void DetectIpv4hdrRegister(void)
Registration function for ipv4.hdr: keyword.
void DetectIpv6hdrRegister(void)
Registration function for ipv6.hdr: keyword.
void DetectIsdataatRegister(void)
Registration function for isdataat: keyword.
void DetectITypeRegister(void)
Registration function for itype: keyword.
void DetectJa4HashRegister(void)
Registration function for keyword: ja4.hash.
void DetectKrb5CNameRegister(void)
void DetectKrb5ErrCodeRegister(void)
Registration function for krb5_err_code: keyword.
void DetectKrb5MsgTypeRegister(void)
Registration function for krb5_msg_type: keyword.
void DetectKrb5SNameRegister(void)
void DetectKrb5TicketEncryptionRegister(void)
void DetectL3ProtoRegister(void)
Registration function for ip_proto keyword.
void DetectLuaRegister(void)
Registration function for keyword: lua.
void DetectMarkRegister(void)
Registration function for nfq_set_mark: keyword.
void DetectModbusRegister(void)
Registration function for Modbus keyword.
void DetectMsgRegister(void)
void DetectNfsProcedureRegister(void)
Registration function for nfs_procedure keyword.
void DetectNfsVersionRegister(void)
Registration function for nfs_procedure keyword.
void DetectNoalertRegister(void)
void DetectNocaseRegister(void)
void DetectOffsetRegister(void)
void DetectRegisterAppLayerHookLists(void)
register app hooks as generic lists
SigTableElmt * sigmatch_table
void DetectPcreRegister(void)
void DetectPktDataRegister(void)
Registration function for keyword: file_data.
void DetectPktvarRegister(void)
void DetectPrefilterRegister(void)
void DetectPriorityRegister(void)
Registers the handler functions for the "priority" keyword.
void DetectQuicCyuHashRegister(void)
void DetectQuicCyuStringRegister(void)
void DetectQuicSniRegister(void)
Registration function for quic.sni: keyword.
void DetectQuicUaRegister(void)
Registration function for quic.ua: keyword.
void DetectQuicVersionRegister(void)
Registration function for quic.version: keyword.
void DetectRawbytesRegister(void)
void DetectReferenceRegister(void)
Registration function for the reference: keyword.
void DetectReplaceRegister(void)
void DetectRequiresRegister(void)
void DetectRevRegister(void)
void DetectRpcRegister(void)
Registration function for rpc keyword.
void DetectSameipRegister(void)
Registration function for sameip: keyword.
void DetectSidRegister(void)
void DetectSipMethodRegister(void)
void DetectSipUriRegister(void)
void DetectSmbNtlmsspUserRegister(void)
void DetectSmbNtlmsspDomainRegister(void)
void DetectSmbNamedPipeRegister(void)
void DetectSmbShareRegister(void)
void DetectSmbVersionRegister(void)
Registers the keyword handlers for the "smb_version" keyword.
void SCDetectSMTPRegister(void)
void DetectSshHasshServerStringRegister(void)
Registration function for hasshServer.string keyword.
void DetectSshHasshServerRegister(void)
Registration function for hasshServer keyword.
void DetectSshHasshStringRegister(void)
Registration function for hassh.string keyword.
void DetectSshHasshRegister(void)
Registration function for hassh keyword.
void DetectSshVersionRegister(void)
Registration function for keyword: ssh.protoversion.
void DetectSshProtocolRegister(void)
void DetectSshSoftwareVersionRegister(void)
Registration function for keyword: ssh.softwareversion.
void DetectSshSoftwareRegister(void)
void DetectSslStateRegister(void)
Registers the keyword handlers for the "ssl_state" keyword.
void DetectSslVersionRegister(void)
Registration function for keyword: ssl_version.
void DetectStreamSizeRegister(void)
Registration function for stream_size: keyword.
void DetectTagRegister(void)
Registration function for keyword tag.
void DetectTargetRegister(void)
Registration function for target keyword.
void DetectAckRegister(void)
Registration function for ack: keyword.
void DetectFlagsRegister(void)
Registration function for flags: keyword.
void DetectSeqRegister(void)
Registration function for ack: keyword.
void DetectWindowRegister(void)
Registration function for window: keyword.
void DetectTcpWscaleRegister(void)
Registration function for tcp.wscale keyword.
void DetectTcphdrRegister(void)
Registration function for tcp.hdr: keyword.
void DetectTcpmssRegister(void)
Registration function for tcpmss: keyword.
void DetectTemplate2Register(void)
Registration function for template2: keyword.
void DetectTemplateRegister(void)
Registration function for template: keyword.
void DetectThresholdRegister(void)
Registration function for threshold: keyword.
void DetectTlsAlpnRegister(void)
Registration function for keyword: tls.alpn.
void DetectTlsFingerprintRegister(void)
Registration function for keyword: tls.cert_fingerprint.
void DetectTlsIssuerRegister(void)
Registration function for keyword: tls.cert_issuer.
void DetectTlsSerialRegister(void)
Registration function for keyword: tls.cert_serial.
void DetectTlsSubjectRegister(void)
Registration function for keyword: tls.cert_subject.
void DetectTlsValidityRegister(void)
Registration function for tls validity keywords.
void DetectTlsCertChainLenRegister(void)
void DetectTlsCertsRegister(void)
Registration function for keyword: tls.certs.
void DetectTlsJa3HashRegister(void)
Registration function for keyword: ja3_hash.
void DetectTlsJa3StringRegister(void)
Registration function for keyword: ja3.string.
void DetectTlsJa3SHashRegister(void)
Registration function for keyword: ja3s.hash.
void DetectTlsJa3SStringRegister(void)
Registration function for keyword: ja3s.string.
void DetectTlsRandomRegister(void)
Registration function for keyword: tls.random.
void DetectTlsSniRegister(void)
Registration function for keyword: tls.sni.
void DetectTlsSubjectAltNameRegister(void)
Registration function for keyword: tls.subjectaltname.
void DetectTlsVersionRegister(void)
Registration function for keyword: tls.version.
void DetectTlsRegister(void)
Registration function for keyword: tls.version.
void DetectTosRegister(void)
Register Tos keyword.
void DetectTtlRegister(void)
Registration function for ttl: keyword.
void DetectUdphdrRegister(void)
Registration function for udp.hdr: keyword.
void DetectUricontentRegister(void)
Registration function for uricontent: keyword.
void DetectUrilenRegister(void)
Registration function for urilen: keyword.
void DetectVlanLayersRegister(void)
void DetectVlanIdRegister(void)
void DetectWithinRegister(void)
void DetectXbitsRegister(void)
#define SIGMATCH_IPONLY_COMPAT
#define SIGMATCH_INFO_STICKY_BUFFER
#define SIGMATCH_DEONLY_COMPAT
#define SIGMATCH_SUPPORT_FIREWALL
#define SIGMATCH_INFO_CONTENT_MODIFIER
element in sigmatch type table.
void(* RegisterTests)(void)
void(* Cleanup)(struct SigTableElmt_ *)
void(* Transform)(DetectEngineThreadCtx *, InspectionBuffer *, void *context)
bool(* SupportsPrefilter)(const Signature *s)
const char * GetDocURL(void)
#define SCLogWarning(...)
Macro used to log WARNING messages.
#define SCRealloc(ptr, sz)