Commit Graph

10752 Commits (fbc856f14d1a841aa4cb8e4e4406e3758c5df32d)
 

Author SHA1 Message Date
Philippe Antoine fbc856f14d smb: adds file overlap event against evasions
Evasion scenario is
- a first dummy write of one byte at offset 0 is done
- the second full write of EICAR at offset 0 is then done
and does not trigger detection

The last write had the final value, and as we cannot "cancel"
the previous write, we set an event which is then transformed into
an app-layer decoder alert
6 years ago
Philippe Antoine 98e5a3ccd4 applayer: fix a leak in protocol change
TCPProtoDetect can either set f->alproto, change f->alstate
and return error.

When the original alstate gets freed, we shall set the pointer
to NULL, as it can get reused.
6 years ago
Philippe Antoine 6caaf5e757 dnp3: more precise probing for banners 6 years ago
Ilya Bakhtin b044093e63 dnp3: fixed wrong flow direction identification
dnp3 is a communication between so-called master and outstation
in our terms master is a client and outstation is a server
DIR flag in dnp3 header is nonzero when a packet is from master
so if DIR is nonzero then packet is 'toserver'
6 years ago
Philippe Antoine c03c8738b4 dnp3: fix probing test not using final null in string 6 years ago
Philippe Antoine 6674327a68 signature: checks protocol for file.name keyword
By setting the flags as for the filename keyword (not sticky version)

(cherry picked from commit 61d0cd1399)
6 years ago
Jason Ish 1438f7c8a1 enip: set unidirection transaction flag
(cherry picked from commit 2b215a45e0)
6 years ago
Jason Ish 19ed8dcc9b dhcp: set unidirection transaction flag
(cherry picked from commit 0529a00ffd)
6 years ago
Jason Ish 34a69d040e ikev2: set unidirection transaction flag
(cherry picked from commit 3036ec4db0)
6 years ago
Jason Ish c00c7ec070 sip: set unidirection transaction flag
(cherry picked from commit 54d5f336d4)
6 years ago
Jason Ish 41ce783896 rdp: set unidirection transaction flag
(cherry picked from commit 1d40d0c5f9)
6 years ago
Jason Ish 4a343c1585 krb5: set unidirection transaction flag
(cherry picked from commit f7dee602e9)
6 years ago
Jason Ish 2d1379d39c ntp: set unidirection transaction flag
(cherry picked from commit 984d3c7f20)
6 years ago
Jason Ish a39fa120ef snmp: set unidirectional transaction flag
(cherry picked from commit fc7d59d92f)
6 years ago
Jason Ish 428b06426c applayer: add flags to parser registration struct
This will allow Rust parsers to register for gap handing from
Rust (some Rust parsers do handle gaps, but they set the flag
from C).

(cherry picked from commit 53aa967e0b)
6 years ago
Jason Ish 443937a16a app-layer: handle unidirectional transactions
(cherry picked from commit 60ebc27c4e)
6 years ago
Jason Ish f22b1eb546 app-layer: backport unidirectional tx option
This is a partial backport of:
ac3cf6ff75

    detect/config: set config for special cases

    Allow app-layer to declare the txs are uni-directional and special
    care is needed for applying config.
6 years ago
Emmanuel Thompson 08bebaf465 detect/asn1: Fix relative_offset keyword option
- Fix relative_offset keyword option to be relative in regards to the
last content match
- Change relative_offset to int32_t with bounds check to allow the full
range of the packet buffer size (uint16_t)
- Added checks for over/underflows
- Changed the offset type to uint16_t because the offset is applied to
the payload length, which is a uint16_t
- Adjusted test cases to work relative to the content match
- Added test case to verify bounds

(cherry picked from commit be3379f00e)
6 years ago
Jeff Lucovsky b9abdb4f5c detect/rules: Fix copy/paste error
This commit corrects a copy/paste error handling the `include-mpm-stats`
configuration setting.

(cherry picked from commit db9776af64)
6 years ago
Jeff Lucovsky 11ba1199fe detect/rules: Increase array size to remove SEGV
This commit changes the size of reporting variables to be dynamic based
on the buffer ids in use instead of a fixed value to address a SEGV when
the fixed value was less than the max buffer/type id in use.

(cherry picked from commit d911fb87b8)
6 years ago
Victor Julien 29ab696fe1 http: error check htp_list_size
This avoids a potential casting to uint64_t of -1, leading to a very
high upper bound of the tx loop.

(cherry picked from commit e07a4393a9)
6 years ago
Victor Julien b659780654 decode/geneve: fix unittests now that config is disabled 6 years ago
Victor Julien b2b9b0b49e decode/geneve: disable by default w/o config 6 years ago
Philippe Antoine 52d2e09eff applayer: keep running detection on protocol change
ie do not stop on first try if we do not have enough data

(cherry picked from commit 07cbdb32b3)
6 years ago
Jeff Lucovsky 0ad03268cb decode/geneve: Disable geneve decoding by default. 6 years ago
Victor Julien 7d073ae349 decode/geneve: add config to yaml
(cherry picked from commit 57a611b429)
6 years ago
Ali Jad Khalil c73f633e66 decode/geneve: Add Geneve decoding functionality
These changes are in response to feature request 3063. Geneve is
very similar to VXLAN, but uses a slightly different encapsulation
scheme.

(cherry picked from commit ef9e532f07)
6 years ago
Philippe Antoine 3d0e740a94 detect: checks for overflow when comparing signatures priorities
(cherry picked from commit 1674239442)
6 years ago
Philippe Antoine 8901fcb540 signature: checks for integer overflow in limits propagation
(cherry picked from commit a99ad4c1e4)
6 years ago
Philippe Antoine 840a0de0b7 signature: checks for integer overflow in limits propagation
(cherry picked from commit 61c327dd80)
6 years ago
Philippe Antoine bdbbeeec5f detect: fix read overflow in DetectGetLastSMByListId
(cherry picked from commit 5c31383d1c)
6 years ago
Emmanuel Thomspon cb819fe66e detect/asn1: Fixes definite long form parsing of length field
(cherry picked from commit a9f590b350)
6 years ago
Philippe Antoine 5202b8ba6f dnp3: adds unit test against previous bug
(cherry picked from commit 0ffa1c6014)
6 years ago
Victor Julien 9c13d26ada nfs: fix 'dangling' files in lossy sessions
In case of lossy connections the NFS state would properly clean up
transactions, including file transactions. However for files the
state was never set to 'truncated', leading to files to stay 'active'.

This would lead these files staying in the NFS's state. In long running
sessions with lots of files this would lead to performance and memory
use issues.

This patch cleans truncates the file that was being transmitted when
a file transaction is being closed.

Based on 65e9a7c31c

(cherry picked from commit 44d7dd02b3)
6 years ago
Victor Julien 54d4a8ffb0 nfs: check post-gap timeouts once a second at most
Based on 25f2efe977

(cherry picked from commit 760d6c1877)
6 years ago
Victor Julien 77c79ebb86 nfs: update ts only if it changed
Based on 8aa380600d

(cherry picked from commit f8e9fe95cb)
6 years ago
Jeff Lucovsky 3ce608886b output/anomaly: Restrict anomaly logger count
This commit restricts the anomaly logger count. The restriction is
necessary due to state maintenance in the logger that doesn't scale
beyond a single logger.

Until that issue's solved, when multiple anomaly loggers are configured,
an error message will be emitted to highlight the restriction.

(cherry picked from commit 8e2aab7467)
6 years ago
Philippe Antoine 05f554e692 fuzz: disable DNP3 checksums while fuzzing
(cherry picked from commit 8a61f754c4)
6 years ago
Antti Tönkyrä 6642285574 Fix stack overflow in DetectFlowbitsAnalyze
Use dynamically allocated array instead of stack and free it after it is no longer needed.

(cherry picked from commit fd4ef5cd54)
6 years ago
Philippe Antoine d6db4a37df signature: fix linked list for bidirectional signatures
Bidirectional signatures are really two signatures with one id
This needs to be handled with care when changing a linked list

(cherry picked from commit 5ac8e41a13)
6 years ago
Philippe Antoine 4dbd16c058 enip: use status for probing parser
(cherry picked from commit 0da4dc0dea)
6 years ago
Philippe Antoine dd1ed2f32d dnp3: fix buffer over read in responses parsing
(cherry picked from commit d465bb8686)
6 years ago
Philippe Antoine 984cc14fce dnp3: probing parser fixes direction based on dnp3 header
(cherry picked from commit 629a16e373)
6 years ago
Jeff Lucovsky 6d169fa909 detect/content: Validate content byte array
This commit checks whether the content byte array is compatible with the
transforms, if any, for the rule.

(cherry picked from commit 051465ee74)
6 years ago
Jeff Lucovsky dbb7074bc9 doc: Fix spelling error
(cherry picked from commit cbcb7c5b99)
6 years ago
Jeff Lucovsky 6149c5074d general: Fix spelling error
(cherry picked from commit aed6356e5b)
6 years ago
Jeff Lucovsky 0e1b58847b detect: Add transform validation api
This commit extends the API with a function that validates arguments
against the transforms for the SM list (if any).

(cherry picked from commit 8f1a7111ed)
6 years ago
Jeff Lucovsky 96bac523d3 detect/transform: Add validation function
This commit adds a function to pre-validate buffers. If a content
buffer contains whitespace, the validation fails.

(cherry picked from commit bc81474e3f)
6 years ago
Jeff Lucovsky 00ffcf1012 detect/transform: Add transform "validate" function
This commit adds an (optional) entry for a validation function. The
validation function, if present, will be used during rule processing.

Its role is to determine if the arguments are compatible with the
transform. E.g., a content string of "this string has whitespace" is not
compatible with the `strip_whitespace` transform.

(cherry picked from commit 596875fa68)
6 years ago
Eric Leblond 03d7cc74c7 util-log-redis: add support for unix socket
If there is a '/' in the redis server string then we consider that
the connection should be done other a unix socket.

(cherry picked from commit e12437e31e)
6 years ago