Victor Julien
5703ce371e
detect/byteextract: suppress runtime error messages
6 years ago
Victor Julien
0de86211c6
detect: register dynamic buffers into de_ctx
...
Register buffers that are created during rule parsing. Currently
this means an existing buffer with one or more transformations.
8 years ago
Victor Julien
862780c7c3
detect: add debug statements for byte_extract/isdataat
8 years ago
Victor Julien
ab1200fbd7
compiler: more strict compiler warnings
...
Set flags by default:
-Wmissing-prototypes
-Wmissing-declarations
-Wstrict-prototypes
-Wwrite-strings
-Wcast-align
-Wbad-function-cast
-Wformat-security
-Wno-format-nonliteral
-Wmissing-format-attribute
-funsigned-char
Fix minor compiler warnings for these new flags on gcc and clang.
8 years ago
Victor Julien
7eda6beade
detect: don't rescan when just distance is used
...
Content inspection optimization: when just distance is used without
within we don't need to search recursively.
E.g. content:"a"; content:"b"; distance:1; will scan the buffer for
'a' and when it finds 'a' it will scan the remainder for 'b'. Until
now, the failure to find 'b' would lead to looking for the next 'a'
and then for 'b' after that. However, we already inspected the
entire buffer for 'b', so we know this will fail.
8 years ago
Victor Julien
cc4010343d
detect: add and use util func for alproto sets
9 years ago
Victor Julien
dfac5276b8
detect: remove unused SIGMATCH_PAYLOAD flag
9 years ago
Victor Julien
775e182531
detect: remove AppLayerMatch API call
9 years ago
Victor Julien
6346a074a7
http_uri: dynamic buffer
...
Clean up tests
9 years ago
Victor Julien
6bd37611ee
file_data: dynamic buffer
9 years ago
Victor Julien
779d40cedf
detect: remove hardcoded sm_list logic from setup
...
Introduce utility functions to aid this.
9 years ago
Victor Julien
f370e88135
detect: move init only Signature members to init_data
9 years ago
Victor Julien
8edc954e82
detect: get rid of Signature::sm_lists
...
Instead use the lists in init_data during setup and the SigMatchData
arrays during runtime.
9 years ago
Victor Julien
bd456076a8
detect: pass SigMatchData to inspect functions
9 years ago
Victor Julien
39613778cd
detect: make setup/free/match funcs static where possible
9 years ago
Victor Julien
bfd4bc8233
detect: constify Signature/SigMatch use at runtime
9 years ago
Victor Julien
e67ae0f174
detect keywords: use parse regex util func
9 years ago
Jason Ish
796dd5223b
tests: no longer necessary to provide successful return code
...
1 pass, 0 is fail.
9 years ago
Jason Ish
06dcaec335
byte-extract: for string, default to base "dec" if not provided
...
For Snort compatibility, as Snort defaults to "dec" if not provided.
Fixed issue 1697:
https://redmine.openinfosecfoundation.org/issues/1697
10 years ago
Giuseppe Longo
41a1a9f4af
find and replace HSBDMATCH by FILEDATA
...
This commit do a find and replace of the following:
- DETECT_SM_LIST_HSBDMATCH by DETECT_SM_LIST_FILEDATA
sed -i 's/DETECT_SM_LIST_HSBDMATCH/DETECT_SM_LIST_FILEDATA/g' src/*
- HSBD by FILEDATA:
sed -i 's/HSBDMATCH/FILEDATA/g' src/*
10 years ago
Jason Ish
a18e2ef402
Bug 1230: Check all SigMatch lists for a named byte_extract variable.
11 years ago
Victor Julien
1de9256b18
byte-extract: switch to pcre_copy_substring
...
Fixes memory leaks (str_ptr was never freed).
Fixes cppcheck warning:
[src/detect-byte-extract.c:268]: (error) Uninitialized variable: str_ptr
Bug #1046 .
11 years ago
Victor Julien
684d787567
Coverity fix
...
Coverity 992695, fix potential array index with negative int. Very unlikely
case at rule keyword parsing stage.
12 years ago
Victor Julien
3fa958b9a7
byte_extract/test/jump: fix coverity issues
...
During keyword setup there was a path that in theory could lead to
indexing an array with a negative int.
Coverity 992695, 400605, 400604
12 years ago
Anoop Saldanha
b1dffdfbe0
Add app layer protocol packet event detection support.
12 years ago
Victor Julien
7292998a58
Content: set up sticky buffers like file_data and dce_stub_data w/o flags, but with a list variable
12 years ago
Anoop Saldanha
c3d98f9640
Fix the bug specified in the previous commit.
...
Bug emanates from byte_test, byte_jump and byte_extract keyword being
unable to handle negative offsets when the inspection pointer is at the
end of the buffer.
12 years ago
Anoop Saldanha
0b5d277254
code cleanup for all content based keywords.
13 years ago
Anoop Saldanha
51dcf19817
turn dce_stub_data into a sticky buffer.
13 years ago
Anoop Saldanha
a308d718ae
Allow the use of relative without the presence of a related previous keyword.
13 years ago
Last G
8ae11f73b2
Added parentheses to fix Eclipse static code analysis
...
Fixed bug in action priority (REJECT_DST had lowest prio)
13 years ago
Eric Leblond
e176be6fcc
Use unlikely for error treatment.
...
When handling error case on SCMallog, SCCalloc or SCStrdup
we are in an unlikely case. This patch adds the unlikely()
expression to indicate this to gcc.
This patch has been obtained via coccinelle. The transformation
is the following:
@istested@
identifier x;
statement S1;
identifier func =~ "(SCMalloc|SCStrdup|SCCalloc)";
@@
x = func(...)
... when != x
- if (x == NULL) S1
+ if (unlikely(x == NULL)) S1
13 years ago
Anoop Saldanha
5878d83174
byte_extract_id var now a non-global de_ctx specific var
13 years ago
Anoop Saldanha
bff2866aed
more coverity fixes
13 years ago
Anoop Saldanha
37f66e5f46
update handling negative offsets in byte_extract. Also improve validation in byte_extract to not extract values out of the buffer range
14 years ago
Victor Julien
d72b82fae0
Misc fixes.
14 years ago
Eileen Donlon
9b2bd9280a
fix invalid unittests with mixed content modifiers
...
Fixed some unittests that were incorrectly mixing relative and non-relative content modifiers.
14 years ago
Anoop Saldanha
1acb7cdc7d
All http_server_body modified patterns now are DETECT_CONTENT and not DETECT_AL_HTTP_SERVER_BODY
14 years ago
Anoop Saldanha
4810ee9c5f
All uricontent modified patterns now are DETECT_CONTENT and not DETECT_URICONTENT. Step towards unifying all content based patterns. Makes way for easier management of patterns
14 years ago
Anoop Saldanha
ac68c3f893
code cleanup - replace SigMatchAppendDcePayload with SigMatchAppendSMToList
14 years ago
Anoop Saldanha
6cab663bf0
code cleanup - replace SigMatchAppendPayload with SigMatchAppendSMToList
14 years ago
Anoop Saldanha
c4cb37b8da
code cleanup - replace SigMatchAppendUricontent with SigMatchAppendSMToList
14 years ago
Anoop Saldanha
603d4a719a
remove det_ctx->payload_offset and use det_ctx->buffer_offset. Update hscd and hsmd to use the new generic content inspection engine
14 years ago
Victor Julien
296ce8b5f9
file-data: make bytejump, bytetest, byteextract and isdataat work better with file_data.
14 years ago
Victor Julien
07e560b137
file-data: initial file_data support
...
Support file_data for: content, pcre (relative), byte_test, byte_jump,
byte_extract, isdataat.
File_data support is handled at signature parsing time, all matches
occurring after the file_data in the rule are converted to http_server_body
matches.
Content matches relative to the file_data are converted. Within to depth,
distance to offset. Relative to the start of the body buffer.
14 years ago
Anoop Saldanha
420befb180
Changed my email address to anoopsaldanha at gmail dot com from my current one
14 years ago
Victor Julien
2d16abcf8b
Minor code cleanups fixing all GCC 4.6 compiler warnings for default, debug and unittests mode.
14 years ago
Anoop Saldanha
ed3b44b3b5
fix parsing content keywords. We are more strict now. All content keywords need to be enclosed in double quotes. Better validation for sid, priority and rev keywords
14 years ago
Anoop Saldanha
c8701cf8d1
fix var name parsing in byte_extract
14 years ago
Victor Julien
22a97af226
Only compile byte_extract unittests if --enable-unittests is enabled.
14 years ago