suricata
|
#include "suricata-common.h"
#include "conf.h"
#include "decode.h"
#include "detect.h"
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-build.h"
#include "detect-byte.h"
#include "flow.h"
#include "flow-var.h"
#include "flow-util.h"
#include "util-byte.h"
#include "util-unittest.h"
#include "util-unittest-helper.h"
#include "app-layer.h"
#include "app-layer-parser.h"
#include "app-layer-htp.h"
#include "stream-tcp.h"
#include "detect-lua.h"
#include "detect-lua-extensions.h"
#include "util-var-name.h"
#include "util-lua.h"
#include "util-lua-sandbox.h"
#include "detect-engine-alert.h"
Go to the source code of this file.
Functions | |
void | DetectLuaRegister (void) |
Registration function for keyword: lua. More... | |
int | DetectLuaMatchBuffer (DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, const uint8_t *buffer, uint32_t buffer_len, uint32_t offset, Flow *f) |
void | DetectLuaPostSetup (Signature *s) |
post-sig parse function to set the sid,rev,gid into the ctx, as this isn't available yet during parsing. More... | |
Definition in file detect-lua.c.
#define DEFAULT_LUA_ALLOC_LIMIT 500000 |
Definition at line 130 of file detect-lua.c.
#define DEFAULT_LUA_INSTRUCTION_LIMIT 500000 |
Definition at line 131 of file detect-lua.c.
#define FLAG_BLOCKED_FUNCTION_LOGGED BIT_U32(24) |
Definition at line 126 of file detect-lua.c.
#define FLAG_DATATYPE_BUFFER BIT_U32(22) |
Definition at line 124 of file detect-lua.c.
#define FLAG_DATATYPE_DNP3 BIT_U32(21) |
Definition at line 123 of file detect-lua.c.
#define FLAG_DATATYPE_DNS_REQUEST BIT_U32(16) |
Definition at line 118 of file detect-lua.c.
#define FLAG_DATATYPE_DNS_RESPONSE BIT_U32(17) |
Definition at line 119 of file detect-lua.c.
#define FLAG_DATATYPE_DNS_RRNAME BIT_U32(15) |
Definition at line 117 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_REQUEST_BODY BIT_U32(10) |
Definition at line 112 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_REQUEST_COOKIE BIT_U32(7) |
Definition at line 109 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_REQUEST_HEADERS BIT_U32(5) |
Definition at line 107 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_REQUEST_HEADERS_RAW BIT_U32(6) |
Definition at line 108 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_REQUEST_LINE BIT_U32(9) |
Definition at line 111 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_REQUEST_UA BIT_U32(8) |
Definition at line 110 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_RESPONSE_BODY BIT_U32(12) |
Definition at line 114 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_RESPONSE_COOKIE BIT_U32(11) |
Definition at line 113 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_RESPONSE_HEADERS BIT_U32(13) |
Definition at line 115 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_RESPONSE_HEADERS_RAW BIT_U32(14) |
Definition at line 116 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_URI BIT_U32(3) |
Definition at line 105 of file detect-lua.c.
#define FLAG_DATATYPE_HTTP_URI_RAW BIT_U32(4) |
Definition at line 106 of file detect-lua.c.
#define FLAG_DATATYPE_PACKET BIT_U32(0) |
Definition at line 102 of file detect-lua.c.
#define FLAG_DATATYPE_PAYLOAD BIT_U32(1) |
Definition at line 103 of file detect-lua.c.
#define FLAG_DATATYPE_SMTP BIT_U32(20) |
Definition at line 122 of file detect-lua.c.
#define FLAG_DATATYPE_SSH BIT_U32(19) |
Definition at line 121 of file detect-lua.c.
#define FLAG_DATATYPE_STREAM BIT_U32(2) |
Definition at line 104 of file detect-lua.c.
#define FLAG_DATATYPE_TLS BIT_U32(18) |
Definition at line 120 of file detect-lua.c.
#define FLAG_ERROR_LOGGED BIT_U32(23) |
Definition at line 125 of file detect-lua.c.
#define FLAG_INSTRUCTION_LIMIT_LOGGED BIT_U32(25) |
Definition at line 127 of file detect-lua.c.
#define FLAG_MEMORY_LIMIT_LOGGED BIT_U32(26) |
Definition at line 128 of file detect-lua.c.
int DetectLuaMatchBuffer | ( | DetectEngineThreadCtx * | det_ctx, |
const Signature * | s, | ||
const SigMatchData * | smd, | ||
const uint8_t * | buffer, | ||
uint32_t | buffer_len, | ||
uint32_t | offset, | ||
Flow * | f | ||
) |
Definition at line 273 of file detect-lua.c.
References DetectLuaData::buffername, SigMatchData_::ctx, DetectThreadCtxGetKeywordThreadCtx(), LuaExtensionsMatchSetup(), LuaPushStringBuffer(), DetectLuaThreadData::luastate, offset, SCEnter, SCReturnInt, and DetectLuaData::thread_ctx_id.
void DetectLuaPostSetup | ( | Signature * | s | ) |
post-sig parse function to set the sid,rev,gid into the ctx, as this isn't available yet during parsing.
Definition at line 1021 of file detect-lua.c.
References SigMatch_::ctx, DETECT_LUA, DETECT_SM_LIST_MAX, DetectLuaData::gid, Signature_::gid, Signature_::id, Signature_::init_data, SigMatch_::next, DetectLuaData::rev, Signature_::rev, DetectLuaData::sid, SignatureInitData_::smlists, and SigMatch_::type.
void DetectLuaRegister | ( | void | ) |
Registration function for keyword: lua.
Definition at line 78 of file detect-lua.c.
References SigTableElmt_::desc, DETECT_LUA, SigTableElmt_::Match, SigTableElmt_::name, sigmatch_table, and SigTableElmt_::url.
Referenced by SigTableSetup().