Commit Graph

5176 Commits (suricata-2.0.7)
 

Author SHA1 Message Date
Victor Julien eeb873b3a8 Update changelog for 2.0.7 11 years ago
Victor Julien ce5dee886a http: add event for suspicious method delimeter
Add event and rule for suspicious delim(s) between method and uri.

Add unittests as well.
11 years ago
Victor Julien 194debf5ff http: add libhtp uri warning event
Add event for libhtp warning added 0.5.17 for URI's with suspicious
delimeters.
11 years ago
Victor Julien acaae20958 stream: init global config after flow engine
Stream depends on flow engine.
11 years ago
Victor Julien b6714cdcf6 http: remove unused and broken 'content-len' logic
The HTTP tracking code would parse the content lenght and store it
in the TX user data. It didn't take the possibility or errors into
account though, leading to a possible negative int being cases to
unsigned int. Luckily, the result was unused.

This patch simply removes the offending code.

Reported-by: The Yahoo pentest team
11 years ago
Victor Julien 89017d0b03 dcerpc: don't exit() on malloc failure
In 2 places we would exit() if malloc failed. We should never exit in
such cases. This patch silently handles it.
11 years ago
Victor Julien 56196ace51 dcerpc: fix error handling for alloc errors
Fix error handling of stub parsers. In case of SCRealloc error the
function would return a non-error code. This could possibly lead to
memory corruption.

Reported-By: The Yahoo pentest team
11 years ago
Victor Julien ff0b6b50a4 Fix make distcheck on CentOS 5.11
datarootdir was undefined. Define it.
11 years ago
Victor Julien 9622ddc731 CentOS 5.11 pkg-config fix
Check for the minimal pkg-config 0.21 version. Without it, CentOS'
pkg-config will fail with the warning:

configure: error: The pkg-config script could not be found or is too old.
11 years ago
Victor Julien 0eb1273f57 smtp: fix compiler warning
cc1: warnings being treated as errors
app-layer-smtp.c: In function ‘SMTPParseCommandBDAT’:
app-layer-smtp.c:639: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[3]: *** [app-layer-smtp.o] Error 1
11 years ago
Victor Julien 6a599baed5 util-magic: make unittests less specific
So they pass on CentOS 5.11 as well.
11 years ago
Eric Leblond 1a5b5a777b suricatasc: fix dump-counters command
As the exit of dump-counters command is really long and takes time
to get it can take more 5 iterations to get the complete message.
Increasing to 20 seems to fix the issue (10 was ok too).
11 years ago
Eric Leblond c440aaa7dd util-running-mode: setup config file
Without that we get warning message.
11 years ago
Eric Leblond fd2adae741 list keywords: fix regression on app layer name
It was not anymore displayed.
11 years ago
Eric Leblond 713fe1cef6 list keywords: restore 1.4 similar output
Unset was previously displayed if the application layer was not
set. Code before this patch was displaying '(null)' which is not
user friendly.
11 years ago
Victor Julien 2c2b4ab026 stream-tcp: init config before spawning threads
Bug 1318.
11 years ago
Eric Leblond 771c134156 pcap-file: add missing atomic init
It is mandatory to init all atomic to avoid problem on system
without atomic support.
11 years ago
Eric Leblond 6f51934a9f runmode-pcap-file: suppress useless include 11 years ago
Victor Julien ce5095613f tcp midstream: fix window scaling
If stream is picked by ACK, we can't know the wscale, so we assume it's
set to max. Howver, we didn't apply this to the initial window size we
set.
11 years ago
Victor Julien 57863862cb file: register filedata log before file log
This way the file log can log the 'stored' info that the filedata
log sets.
11 years ago
Victor Julien 0675925c72 file: improve file pruning
Check if file has been logged/stored before considering it 'done'.
11 years ago
Victor Julien e12227f411 runmodes: add funcs to check if file loggers enabled
Add functions to check if file/filedata loggers are enabled.
11 years ago
Victor Julien 5b035c35da file: optimize file pruning
FilePrune would clear the files, but not free them and remove them
from the list. This lead to ever growing lists in some cases.
Especially in HTTP sessions with many transactions, this could slow
us down.
11 years ago
Victor Julien e9b425ac3a Update Changelog for 2.0.6 release 11 years ago
Victor Julien 8e37a82a90 Fix OS X 10.10 unittest failure
Work around OS X 10.10 Yosemite returning EDEADLK on a rwlock wrlocked
then tested by wrtrylock. All other OS' (and versions of OS X that I
tested) seem to return EBUSY instead.
11 years ago
Victor Julien 49f25811b3 Add test for memcmp issue. 11 years ago
Victor Julien b09b20d7e2 memcmp: fix lowercase compare issue
MemcmpLowercase would not compare the first byte of both input buffers
leading to two non-identical buffers to be considered the same.

Tile version is not affected.
11 years ago
Victor Julien 9d228b56d4 Fix a fix: defrag OOM condition
** CID 1257764:  Dereference after null check  (FORWARD_NULL)
/src/defrag.c: 291 in Defrag4Reassemble()

** CID 1257763:  Dereference after null check  (FORWARD_NULL)
/src/defrag.c: 409 in Defrag6Reassemble()

In the error case 'rp' can be both NULL or non-NULL.
11 years ago
Victor Julien 707888c074 Fix compilation on OS X Yosemite
Due to our unconditional declaration of the strlcat and strlcpy
functions, compilation failed on OS X Yosemite.

Bug #1192
11 years ago
Travis Green 5b2047745d Update reference.config
Updated reference.config to match ET Open reference.config found here:
https://rules.emergingthreats.net/open/suricata/reference.config

Due to startup error shown here:
root@xxxxxxx01:/etc/suricata/rules# /usr/bin/suricata -c /etc/suricata/suricata.yaml --pidfile /var/run/suricata.pid --af-packet
23/12/2014 -- 22:07:56 - <Error> - [ERRCODE: SC_ERR_REFERENCE_UNKNOWN(150)] - unknown reference key "osvdb". Supported keys are defined in reference.config file.  Please have a look at the conf param "reference-config-file"
<...>
Killed
11 years ago
Victor Julien ade48ec422 stream: improve inline mode GAP handling
Don't conclude a GAP is 'final' until the missing data is ack'd.

Further, cleanup and unify more with the non-inline code.
11 years ago
Victor Julien 229f65a361 stream: move utility functions
This way they can be used by the *Inline* functions as well.
11 years ago
Eric Leblond 63ef0d5226 output-json: fix duplicate logging
This patches is fixing a issue in the OutputJSONBuffer function. It
was writing to file the content of the buffer starting from the start
to the final offset. But as the writing is done for each JSON string
we are duplicating the previous events if we are reusing the same
buffer.

Duplication was for example triggered when we have multiple alerts
attached to a packet. In the case of two alerts, the first one was
logged twice more as the second one.

This si almost the same code as the one of master but it fixes a
conflict during cherry picking in:
	src/output-json-alert.c
11 years ago
Victor Julien 090ae0c6be Update Changelog for 2.0.5 11 years ago
Ken Steele ec3425d709 Make bad copy-mode be an error in runmode-tile. 11 years ago
Victor Julien 771bdd04ef Bug 1329: error out on invalid rule protocol
Due to a logic error in AppLayerProtoDetectGetProtoByName invalid
protocols would not be detected as such. Instead of ALPROTO_UNKNOWN
ALPROTO_MAX was returned.

Bug #1329
11 years ago
Eric Leblond 605e3cc14c unix-manager: fix cppcheck errors
This patch fixes the following errors:
 [src/unix-manager.c:306]: (error) Memory pointed to by 'client' is freed twice.
 [src/unix-manager.c:313]: (error) Memory pointed to by 'client' is freed twice.
 [src/unix-manager.c:323]: (error) Memory pointed to by 'client' is freed twice.
 [src/unix-manager.c:334]: (error) Memory pointed to by 'client' is freed twice.

Unix manager was treating the packet after closing the socket if message was
too long.
11 years ago
Victor Julien 41e3bbefbb stream: don't send EOF to AppLayer too soon
Sending EOF too soon results in the AppLayer cleaning up prematurely.
11 years ago
Ken Steele 4b37224145 Correct flow memory usage bookkeeping error
Fix bug 1321 where flow_memuse was incremented more on allocation than
free.
11 years ago
Victor Julien 2c9ce634a9 http: don't crash when normalizing uri on low memory 11 years ago
Victor Julien 4eff27c108 defrag: don't crash when out of memory
Handle memory allocation errors in defrag better. Could lead to
crashes if malloc errors happened.
11 years ago
Victor Julien dbd8c6e604 pcre: fix var capture for non relative matches
Var capture setup depended on the match being relative due to a logic
error.
11 years ago
Christophe M 3f5c34ae35 Fix to output a JSON buffer to an Unix domain socket.
Create the JSON buffer and write to it like regular file.

Upper function SCConfLogOpenGeneric already handle it properly.

Closes issue #1246.
11 years ago
Ken Steele ba13b2d5d1 Make suricata_ctl_flags be volatile
The global variable suricata_ctl_flags needs to volatile, otherwise the
compiler might not cause the variable to be read every time because it
doesn't know other threads might write the variable.

This was causing Suricata to not exit under some conditions.
11 years ago
Victor Julien a8c30df638 stream/async: improve handling of syn/ack pickup
If we picked up the ssn with a syn/ack, we don't need to make more
assumptions about sack and wscale after that.
11 years ago
Victor Julien 64d6ee53f8 stream/async: fix session setup issues
For these 2 cases:

1. Missing SYN:
-> syn <= missing
<- syn/ack
-> ack
-> data

2. Missing SYN and 3whs ACK:
-> syn <= missing
<- syn/ack
-> ack <= missing
-> data

Fix session pickup. The next_win settings weren't correctly set, so that
packets were rejected.

Bug 1190.
11 years ago
Victor Julien 8b03feb0c5 prscript: use master-2.0.x in master-2.0.x branch 11 years ago
Victor Julien aa38f10967 stream: improve tracking with pkt loss in async
If 3whs SYN/ACK and ACK are missing we can still pick up the session if
in async-oneside mode.

-> syn
<- syn/ack <= missing
-> ack     <= missing
-> data

Bug 1190.
11 years ago
Victor Julien b99372cc5e Suppress ARM valgrind warning
Not Suricata related, so suppress.
11 years ago
Victor Julien b659508d0f stream: improve bad window update detection
Ignore more valid ACKs in FIN shutdown phase.

Improve heuristic for window shrinking in case of packet loss.
11 years ago