Commit Graph

5153 Commits (suricata-2.0.6)
 

Author SHA1 Message Date
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
Victor Julien 012f36562d stream: fix 'bad window update' false positive
ACK packets completing a valid FIN shutdown could be flagged as
'bad window update' if they would shrink the window.

This patch detects this case before doing the bad window update
check.
11 years ago
Tom DeCanio 08a04a0a15 sanity check tcp SACK edges prior to recording. Attempt to avoid Cisco ASA
tcp randomization issue with it not properly writing sequence numbers in SACK.
11 years ago
Victor Julien 5b394cab31 stream: improve handling of 3whs packet loss
If the 3whs ACK and some data after this is lost, we would get stuck
in the 'SYN_RECV' state, where from there each packet might be
considered invalid.

This patch improves the handling of this case.
11 years ago
Victor Julien 407ff92f58 stream: fix ssh/ssl logging on tcp session reuse
TCP session reuse wouldn't unset FLOW_NO_APPLAYER_INSPECTION.
11 years ago
Victor Julien 9e6acc50a9 ssh.softwareversion: allow more characters
The keyword would not allow matching on "OpenSSH_5.5p1 Debian-6+squeeze5"
as the + and space characters were not allowed.

This patch adds support for them.
11 years ago
Jason Ish b6f9809403 Bug 1230: Check all SigMatch lists for a named byte_extract variable. 11 years ago
Jason Ish a333f02347 Bug 1230: Simple test case demonstrating failure. 11 years ago
Ken Steele 27182f7f65 Fix compiler warning about uninitialized variable in mpipe. 11 years ago
Victor Julien 7c621d53bb tile: silence harmless cc warnings 11 years ago
Victor Julien c387bfdaa5 lua: improve configure checks
The base 'lua' library has different names on different OS' and even
Linux distro's. Instead of selecting the proper one, we now just try
all. This way no OS/distro specific knowledge about the name is needed.
11 years ago
Victor Julien 3c4e3381bb tcp session reuse: reset detect state
Reset the detect state on TCP session reuse. We reset the app layer,
so we need to reset the stateful detection as well.
11 years ago
Victor Julien 00325be458 detect state: always lock de_state_m
Always lock the de_state_m on access, also at flow recycle or
cleanup.
11 years ago
Victor Julien 382cb7c8af filestore: fix parsing bug
Filestore keyword can have options or no options, and the parser
was enforcing the NOOPT flag too strictly.

Bug #1288
11 years ago
Victor Julien 8cf0736046 Update changelog for 2.0.4 11 years ago
Victor Julien cd03c00297 ssh: convert error message to debug statement
Don't print errors based on traffic issues.
11 years ago
Eric Leblond 8ec28dea16 app-layer-ssh: fix banner parser
Carefully crafted SSH banner could result in parser error.

CVE 2014-6603

Signed-off-by: Eric Leblond <eric@regit.org>
Reported-By: Steffen Bauch
11 years ago
Victor Julien 48499b1739 ipv6: RH extension header parsing issue
A logic error in the IPv6 Routing header parsing caused accidental
updating of the original packet buffer. The calculated extension
header lenght was set to the length field of the routing header,
causing it to be wrong.

This has 2 consequences:

1. defrag failure. As the now modified payload was used in defrag,
the decoding of the reassembled packet now contained a broken length
field for the routing header. This would lead to decoding failure.

The potential here is evasion, although it would trigger:
[1:2200014:1] SURICATA IPv6 truncated extension header

2. in IPS mode, especially the AF_PACKET mode, the modified and now
broken packet would be transmitted on the wire. It's likely that
end hosts and/or routers would reject this packet.

NFQ based IPS mode would be less affected, as it 'verdicts' based on
the packet handle. In case of replacing the packet (replace keyword
or stream normalization) it could broadcast the bad packet.

Additionally, the RH Type 0 address parsing was also broken. It too
would modify the original packet. As the result of this code was not
used anywhere else in the engine, this code is now disabled.

Reported-By: Rafael Schaefer <rschaefer@ernw.de>
11 years ago
Victor Julien a3bd19e18a af-packet: check pointers before use 11 years ago
Eric Leblond e9821accc8 af-packet: force suricata in IPS mode when needed
AF_PACKET is not setting the engine mode to IPS when some
interfaces are peered and use IPS mode. This is due to the
fact, it is possible to peer 2 interfaces and run an IPS on
them and have a third one that is running in normal IDS mode.

In fact this choice is the bad one as unwanted side effect is
that there is no drop log and that stream inline is not used.

To fix that, this patch puts suricata in IPS mode as soon as
there is two interfaces in IPS mode. And it displays a error
message to warn user that the accuracy of detection on IDS only
interfaces will be low.
11 years ago
Victor Julien 5279c2472d rule parser: set flag for optionless keywords
If a keyword doesn't have an argument, it should set the SIGMATCH_NOOPT
flag so the parser knows.
11 years ago
Victor Julien a065c8d94c rule parser: fix crashing on malformed options
Fix crashing on malformed rule options like 'rev;1;'.

Bug 1254.
11 years ago
Victor Julien 0b559b0f2f lua: fix http.request_line
The request line scripts were added to the AMATCH list. However, there
is not AppLayerMatch function defined for lua scripts. So scripts
would not run.

This patch adds the request line scripts to the normal 'MATCH' list.

Bug #1273.
11 years ago
Victor Julien 239a96d5d7 tls: fix a tls.fingerprint issue in debug mode
Print proper variable so we don't NULL-deref.

Bug #1279.
11 years ago