Victor Julien
51d6c63860
Luajit: fix compilation and tests after libhtp upgrade
13 years ago
Anoop Saldanha
48cf0585fb
Suricata upgrade to libhtp 0.5.x.
...
Remove the support for now unsupported personalities from libhtp -
TOMCAT_6_0, APACHE and APACHE_2_2. We instead use the APACHE_2
personality.
13 years ago
Victor Julien
080c15b3fc
Enable libhtp 0.3.0 compilation and crash free UT run. Still see 5 failed tests.
13 years ago
Victor Julien
538da26812
Fix sgh mpm flags assignment
13 years ago
Eric Leblond
150cd39c6e
detect-engine: do a direct update of flag
...
There is no reason not to update the flag directly. So do it
to avoid to crash the test.
13 years ago
Eric Leblond
2f2916d9ec
ccccinelle: add formatted comment for flag test
13 years ago
Victor Julien
aafc65c757
Autotools: move libhtp conditionals to configure
...
In preparation of the libhtp upgrade, move all libhtp related conditionals
to configure. This allows for one set of build scripts that works regardless
of the presence of a local libhtp dir.
13 years ago
Victor Julien
73e27c1fb7
Generate proper errors if sid,gid,rev values are out of range. Bug #779 .
13 years ago
Victor Julien
164d60e8cd
Yaml: give a more detailed error if the user supplies a directory instead of a yaml file. Bug #803 .
13 years ago
Victor Julien
a4e838c1d3
TLS: create certs directory during startup if it doesn't exist yet. Bug #710 .
13 years ago
Eric Leblond
0e92469222
nfq: be sure to always verdict packets
...
To be sure to always verdict packets (bug #769 ), this patch adds
a ReleaseData function to NFQ packets. The release function simply
drop the packet if it has not been verdicted before.
13 years ago
Victor Julien
4a0050b9ea
Print pkt src to alert-debug log
13 years ago
Victor Julien
1c371da46d
DNS: better handle TX' with lost replies
13 years ago
Victor Julien
0fd9b0c4fa
HTP: free TX from transaction free API call
13 years ago
Victor Julien
1367074c75
App layer: clean up TX before lowest active one
...
Update DNS to handle cleaning up this way.
13 years ago
Victor Julien
0b229ec8b9
DNS: suppress log-dns registration message
13 years ago
Victor Julien
f59f90331d
Applayer: remove obsolete StateUpdateTransactionId
...
Also, update StateTransactionFree to take an u64 tx id, so it's
consistant with the rest of the engine.
To reflect these changes, AppLayerRegisterTransactionIdFuncs has
been renamed to AppLayerRegisterTxFreeFunc.
HTP, DNS, SMB, DCERPC parsers updated.
13 years ago
Victor Julien
ebab9aee83
DNS: move internal tx id tracking to u64
13 years ago
Victor Julien
e8ad876b48
App layer: add 'StateHasEvents' API call
...
Per TX decoder events resulted in significant overhead to the
detection engine, as it walked all TX' all the time to check
if decoder events were available.
This commit introduces a new API call StateHasEvents, which speeds
up this process, at the expense of keeping a counter in the state.
Implement this for DNS as well.
13 years ago
Anoop Saldanha
cd7b4fac40
remove unused pattern id assignment functions. Goodbye
13 years ago
Victor Julien
f353fb630c
DNS: convert dns_query to sticky buffer
13 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
13 years ago
Victor Julien
d476e4e50d
Coverity 1040312, 1040313, 1040314 1040315: improve pool thread error handling.
13 years ago
Victor Julien
1373a20e8a
Thread: remove thread id
13 years ago
Victor Julien
d7aaa9464c
Stream: use per thread ssn_pool_id instead of thread id.
13 years ago
Victor Julien
92b7ffad69
Improve memory cleanup in some unittests
13 years ago
Victor Julien
fd7899cc8b
Stream: fix unittests after ssn pool changes.
13 years ago
Victor Julien
aa449d51ca
Stream: use per thread ssn pool
...
Use per thread pools to store and retrieve SSN's from. Uses PoolThread
API.
Remove max-sessions setting. Pools are set to unlimited, but TCP memcap
limits the amount of sessions.
The prealloc_session settings now applies to each thread, so lowered the
default from 32k to 2k.
13 years ago
Victor Julien
b6af6cb241
pool: add error msgs and improve memory layout
13 years ago
Victor Julien
5b9ef94f34
pool: add api for per thread pools
...
This API is a wrapper around the regular pools where the thread pools
are arrays of locks+pools.
13 years ago
Victor Julien
016d03bdaf
pool: add error msgs and improve memory layout
13 years ago
Victor Julien
46af6b7e0f
Add a per threadvars thread local thread id, that starts at 0 and increments for each thread.
13 years ago
Victor Julien
b3b554c269
Coverity 1038959: DNS mpm might use initialized variable
13 years ago
Anoop Saldanha
fba95e9125
Remove mpm ctxs in the wrong direction.
...
A lot of http mpm ctxs have now been removed as a result of this.
13 years ago
Anoop Saldanha
3c2ddf04c1
Update mpm init ctx to not accept the final cuda_rc_module argument.
...
It was a part of our older architecture and is no longer used.
13 years ago
Victor Julien
33818c0272
DNS: fix CUDA build
13 years ago
Victor Julien
be7e6cdd7a
DNS: fix warning when debug is not enabled
13 years ago
Victor Julien
571b8ac186
DNS: add support for per TX decoder events.
13 years ago
Victor Julien
9dc04d9fab
app layer: add support for per TX decoder events
13 years ago
Victor Julien
72e35efbc6
Reset app layer events when we start inspecting a new TX
13 years ago
Victor Julien
28a6c1d9f8
DNS: add test for app layer event match
13 years ago
Victor Julien
6645620c03
Merge SIG_FLAG_MPM_HTTP and SIG_FLAG_MPM_DNS into SIG_FLAG_MPM_APPLAYER, do the same for the _NEG variant.
13 years ago
Victor Julien
43ba5a677e
DNS: enable mpm/fast_pattern support for dns_query
13 years ago
Victor Julien
4817e1305f
DNS: add /F modifier to pcre to inspect DNS query name
13 years ago
Victor Julien
e567e12230
DNS: add unittests for UDP and TCP for dns_query keyword
13 years ago
Victor Julien
f10dd603ff
DNS: adding dns_request content modifier
13 years ago
Victor Julien
6674f4892c
DNS: add per tx internal id
...
Add per TX id. Rename transaction_cnt to transaction_max (id) and increment it on tx creation.
13 years ago
Victor Julien
59780ca770
Hacks to enable alert dns even though we have dnstcp and dnsudp parsers. Needs proper solution later.
13 years ago
Victor Julien
8e01cba85d
DNS TCP and UDP parser and DNS response logger
13 years ago
Eric Leblond
4521de2dfd
Use PACKET_* macro instead of UPDATE
...
Setting the ACTION_DROP flag can be done via PACKET_DROP instead
of using PACKET_UPDATE_ACTION.
13 years ago
Eric Leblond
c0c59fbd17
decode: factorize macro code
...
PACKET_* are now wrapper to the newly introduced PACKET_SET_ACTION
macro.
13 years ago
Eric Leblond
3f107fa130
decode: Packet action start with PACKET
...
Rename all Packet action macro to have them prefixed by PACKET.
13 years ago
Anoop Saldanha
3304c91c91
Don't let geoip match on pseudo packets.
13 years ago
Anoop Saldanha
1fb4aae993
Coverity 1038523: Fix using cuda buffer slice that has been returned to the pool.
13 years ago
Victor Julien
51cdd464a6
stream: detect keep-alive and keep-alive ACK
13 years ago
Victor Julien
03c3ff5632
stream: fix typo in function name
13 years ago
Eric Leblond
4c6595f437
Coverity 1038106: fix FP out-of-bond access
...
A cast during the reading of a configuration variable was invalid
because a 16 bit integer was cast to a 32 bit integer. The called
function is only setting the pointer value to 1 or 0 so there is
no real issue there.
13 years ago
Eric Leblond
7df156ef50
Coverity: 1038139 suppress sanity check
...
The sanity check was really useless as the NULL value is checked in
the code flow.
13 years ago
Eric Leblond
75cd1f6096
Coverity 1038515: check function return
...
This is more cosmetic than useful but it is cleaner anyway.
13 years ago
Anoop Saldanha
b4e750068f
Cuda make distcheck fix for cuda-ptxdump.h
13 years ago
Anoop Saldanha
7d46d59cdd
Coverity 1038522: fix memset inside cuda code. Wrong size specified to memset.
13 years ago
Victor Julien
d6fcd07a31
Coverity 1038085: remove 'default' statement in SCErrorToString. This way a warning will be given if an error is defined w/o updating this function.
13 years ago
Victor Julien
e2444f0ed5
Coverity 1038092 & 1038093: remove dead code
13 years ago
Victor Julien
0902c7f3aa
Coverity 1038518: fix wrong error check
13 years ago
Victor Julien
db1dad8cc6
Coverity 1038124: memory leak on 'seq' keyword parsing failure
13 years ago
Victor Julien
b2e962da03
Coverity 1038123: memory leak on 'flowint' keyword parsing failure
13 years ago
Victor Julien
5c5b2f98dd
Coverity 1038116 & 1038117: memory leaks on 'app-layer-event' keyword parsing failure
13 years ago
Victor Julien
778851626c
Coverity 1038115: memory leak on 'ack' keyword parsing failure
13 years ago
Victor Julien
98dbf3e62c
Coverity 1038113: possibly out of bounds read
13 years ago
Anoop Saldanha
602c91ed41
Minor cosmetic changes to the cuda code.
...
Moved a couple of functions to more cuda relevant files;
Re-structured some data types.
13 years ago
Anoop Saldanha
c9f076def3
Modified CudaBufferCullCompletedSlices.
...
Allow readers specify max size of data they want to read.
13 years ago
Anoop Saldanha
70cb4d30eb
Add a usleep to CudaBuffer culling process. Would lead to a situation where the thread wouldn't care to yield to others."
13 years ago
Anoop Saldanha
17c763f855
Version 1 of AC Cuda.
13 years ago
Anoop Saldanha
2de59fc235
Version 1 of CudaBuffer API. Introduced to buffer data to the gpu.
...
This version allows async writes to a buffer by threads. Allows only
sequential reads though.
13 years ago
Anoop Saldanha
557cab3dc9
We call packet and stream mpm as late as possible now. Won't affect the working of the engine.
...
The rationale behind this is, if we have pkt buffered to the gpu, we'd want
to delay processing the pkt as much as possible.
13 years ago
Anoop Saldanha
d2063d98ad
pool now uses a queue kinda behaviour when getting/inserting data through poolbuckets.
13 years ago
Anoop Saldanha
f4c719b83a
code refactoring. Call mpmprefilter slightly later than where it's called atm
13 years ago
Anoop Saldanha
b787da5643
Remove all cuda related code in the engine except for the cuda api wrappers
13 years ago
Anoop Saldanha
e2a6cfb6a6
update cuda API wrappers
13 years ago
Eric Leblond
d8ce2b1ca4
unix-socket: fix OSX build
...
MSG_NOSIGNAL is not defined on macOSX and SO_NOSIGPIPE is used
instead.
13 years ago
Eric Leblond
a35c367942
action handling: use macro for test.
...
Use test macro instead of direct access to action field.
This patch has been obtained by using the following
spatch file:
@@
Packet *p;
expression E;
@@
- p->action & E
+ TEST_PACKET_ACTION(p, E)
13 years ago
Eric Leblond
efaa9a7302
action handling: define and use macros
...
The action field in Packet structure should not be accessed
directly as the tunneled packet needs to update the root packet
and not the initial packet.
This patch is fixing issue #819 where suricata was not able to
drop fragmented packets in AF_PACKET IPS mode. It also fixes
drop capability for tunneled packets.
13 years ago
Anoop Saldanha
429b5cec10
Fix magic unittets.
...
Fix segv, when magic_load() fails due to the non-availability of default
magic files.
13 years ago
Anoop Saldanha
058e9278c5
Fix wrong casting of htp pointer. Fixed it back to (HTPState *) inside
...
htp utility functions.
13 years ago
Anoop Saldanha
21f9cc3a39
discontinue matching on buffer if urilen returns a match failure.
13 years ago
Victor Julien
56c6dd9bb2
bytetest: add unittest showing missed detection
...
Tests recursive and relative negative byte_test matching.
13 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.
13 years ago
Anoop Saldanha
bd6896bee1
Unit-tests exposing a bug in byte_test, byte_jump and byte_extract.
...
Bug emanates from all the keywords being unable to handle negative offsets
when the inspection pointer is at the end of the buffer.
13 years ago
Victor Julien
0fbfaadd53
bytetest: fix debug messages not printing negative offset correctly
13 years ago
Anoop Saldanha
ff222b51e7
Http trailer headers unittests added.
13 years ago
Anoop Saldanha
ab4b15c2e7
fix for #788 .
...
Now depth is kept in mind when we inspect chunks in client/server body.
This takes care of FPs originating from inspecting subsequent chunks that
match with depth, but shouldn't.
13 years ago
Victor Julien
f29e5459e6
luajit/flowint: add ScFlowintIncr & ScFlowintDecr
...
Add flowint lua functions for incrementing and decrementing flowints.
First use creates the var and inits to 0. So a call:
a = ScFlowintIncr(0)
Results in a == 1.
If the var reached UINT_MAX (2^32), it's not further incremented. If the
var reaches 0 it's not decremented further.
Calling ScFlowintDecr on a uninitialized var will init it to 0.
Example script:
function init (args)
local needs = {}
needs["http.request_headers"] = tostring(true)
needs["flowint"] = {"cnt_incr"}
return needs
end
function match(args)
a = ScFlowintIncr(0);
if a == 23 then
return 1
end
return 0
end
return 0
This script matches the 23rd time it's invoked on a flow.
13 years ago
Victor Julien
f312486c6e
flowvar/luajit: make 'sets' real time. Needed for cross HTTP-header matching.
13 years ago
Victor Julien
72f6bc2aed
luajit: add flowint support
...
Expose ScFlowintGet and ScFlowintSet functions to luajit. These set
flowints in real time, regardless of rule and/or script match.
Example:
function init (args)
local needs = {}
needs["http.request_headers"] = tostring(true)
needs["flowint"] = {"cnt"}
return needs
end
function match(args)
a = ScFlowintGet(0);
if a then
ScFlowintSet(0, a + 1)
else
ScFlowintSet(0, 1)
end
a = ScFlowintGet(0);
if a == 23 then
return 1
end
return 0
end
return 0
Script's init call first registers "cnt" at id 0, then 0 is used to use
this var.
13 years ago
Victor Julien
c3c3cd76e5
flowvar/flowint: split set functions into normal and NoLock version, where the latter won't lock the flow.
13 years ago
Victor Julien
57d3cd97f3
flowvar/flowint: make local function static
13 years ago
Victor Julien
6e18ed0489
luajit flowvar support
...
This patch adds flowvar support to luajit. It does so by exposing two special
C functions to the luajit scripts: ScFlowvarGet and ScFlowvarSet.
13 years ago
Ken Steele
9d677ea006
Clear the PKT_ALLOC flag when storing Packets into the Packet pool.
...
The PKT_ALLOC flag is set by PacketGetFromAlloc(), which needs to be
cleared for Packets in the Packet Pool, so clear the flag here.
13 years ago
Ken Steele
9c7b411a5d
More PacketGetFromMalloc() to allocate packets.
13 years ago
Ken Steele
394f99e32c
Use PacketGetfromAlloc() for packet allocation instead of SCMalloc.
...
Only changed in one file for testing.
13 years ago