]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
4 years agodoc: update sphinx api to use add_css_file 6224/head
Philippe Antoine [Mon, 17 May 2021 14:27:49 +0000 (16:27 +0200)] 
doc: update sphinx api to use add_css_file

instead of deprecated add_stylesheet

(cherry picked from commit 95f225e8fbd5d352a8ca86cd317f908034966ed4)

4 years agorust/template: suppress unread variable warning 6222/head
Jason Ish [Mon, 21 Jun 2021 20:00:45 +0000 (14:00 -0600)] 
rust/template: suppress unread variable warning

Suppress the warning about an unused variable in the template
parser. As this is just a template I think this is OK, however
master should make sure this variable is used, if only to be
more self documenting.

4 years agorust: fix warnings with nightly
Sascha Steinbiss [Tue, 22 Jun 2021 07:33:24 +0000 (09:33 +0200)] 
rust: fix warnings with nightly

4 years agomodbus: fix memory leak in signature parsing
Philippe Antoine [Tue, 22 Jun 2021 06:16:40 +0000 (08:16 +0200)] 
modbus: fix memory leak in signature parsing

Bug: #4538.

4 years agoconfig: fix null dereference in MacSetRegisterFlowStorage 6212/head
Philippe Antoine [Fri, 11 Jun 2021 12:13:44 +0000 (14:13 +0200)] 
config: fix null dereference in MacSetRegisterFlowStorage

Crash happens with
--set outputs.eve-json.types.files.force-magic=yes

(cherry picked from commit 8bf653054025e6297f05ec211a0baa44cf795704)

4 years agohttp2: make http1 rules work on http2 traffic optional
Philippe Antoine [Wed, 26 May 2021 08:16:54 +0000 (10:16 +0200)] 
http2: make http1 rules work on http2 traffic optional

4 years agoproto: introduce signature protocol, as extension to flow protocol
Philippe Antoine [Mon, 7 Dec 2020 13:41:00 +0000 (14:41 +0100)] 
proto: introduce signature protocol, as extension to flow protocol

AppProtoEquals function allows to check if a flow protocol
matches a signature protocol

This allows HTTP1 keywords on HTTP2 traffic

4 years agoftp: ftp-data recognized by StringToAppProto
Philippe Antoine [Thu, 21 Jan 2021 13:44:33 +0000 (14:44 +0100)] 
ftp: ftp-data recognized by StringToAppProto

(cherry picked from commit 43f25f127f069292e5e92377b82d40df2c3cb2d4)

4 years agohttp2: http.stat_code keyword now works for HTTP2
Philippe Antoine [Mon, 26 Apr 2021 12:39:24 +0000 (14:39 +0200)] 
http2: http.stat_code keyword now works for HTTP2

(cherry picked from commit 1e96272576cc6cd734f973e16594dbc1a1e383f6)

4 years agohttp2: http.cookie keyword now works for HTTP2
Philippe Antoine [Mon, 26 Apr 2021 13:50:44 +0000 (15:50 +0200)] 
http2: http.cookie keyword now works for HTTP2

(cherry picked from commit 999327ba1f02904f219c4ffe6ff1d952facddc92)

4 years agohttp2: makes all HTTP1 header keywords work
Philippe Antoine [Mon, 26 Apr 2021 13:01:53 +0000 (15:01 +0200)] 
http2: makes all HTTP1 header keywords work

(cherry picked from commit 017e39d8fd59028d07efa281c8fb9250b33a056f)

4 years agohttp2: http.host.raw keyword now works for HTTP2
Philippe Antoine [Mon, 26 Apr 2021 13:37:57 +0000 (15:37 +0200)] 
http2: http.host.raw keyword now works for HTTP2

(cherry picked from commit df039555bce1ca52f93a34cd1dc8f8ef43e6d05d)

4 years agohttp2: http.method keyword now works for HTTP2
Philippe Antoine [Mon, 26 Apr 2021 13:17:09 +0000 (15:17 +0200)] 
http2: http.method keyword now works for HTTP2

(cherry picked from commit 1e82d0b3c88309461252680fe87bd4bdeaf2b26b)

4 years agohttp2: http.user_agent keyword now works for HTTP2
Philippe Antoine [Thu, 17 Dec 2020 12:26:35 +0000 (13:26 +0100)] 
http2: http.user_agent keyword now works for HTTP2

(cherry picked from commit 47928babfc4adcd897aaa8c485f031683caf8f78)

4 years agohttp2: http.uri.raw keyword now works for HTTP2
Philippe Antoine [Thu, 17 Dec 2020 13:19:25 +0000 (14:19 +0100)] 
http2: http.uri.raw keyword now works for HTTP2

(cherry picked from commit 5d676c5998aeb33c529e8ee8efcaa2fdf10324ef)

4 years agohttp2: http.uri keyword now works for HTTP2
Philippe Antoine [Tue, 8 Dec 2020 11:46:24 +0000 (12:46 +0100)] 
http2: http.uri keyword now works for HTTP2

cf #4067

(cherry picked from commit a98d0fe6edcd6bd5af460c067caca3021f543587)

4 years agohttp2: allow http1 keywords for http2 traffic
Philippe Antoine [Tue, 12 Jan 2021 15:42:48 +0000 (16:42 +0100)] 
http2: allow http1 keywords for http2 traffic

Adding a special case in DetectSignatureSetAppProto

4 years agohttp2: only mimic http1 request if there is one 6186/head
Philippe Antoine [Thu, 22 Apr 2021 07:41:30 +0000 (09:41 +0200)] 
http2: only mimic http1 request if there is one

That may not be the case in midstream/async configurations

(cherry picked from commit d00b755b647a69eb4d4a10adb57be45fd4d14c7d)

4 years agothresholds: Fix buffer overflow in threshold context
Mats Klepsland [Thu, 27 May 2021 10:02:55 +0000 (12:02 +0200)] 
thresholds: Fix buffer overflow in threshold context

th_entry is resized using ThresholdHashRealloc() every time a rule with
a threshold using by_rule tracking is added. The problem is that this is
done before the rules are reordered, so occasionally a rule with by_rule
tracking gets a higher signature number (after reordering) than the
number of th_entries allocated, causing Suricata to crash.

This commit fixes this by allocating th_entries after all the rules are
loaded and reordered.

Backtrace from core dump:

  Program terminated with signal SIGSEGV, Segmentation fault.

  #0  0x000000000051b381 in ThresholdHandlePacket (p=p@entry=0x7fb0080f3960, lookup_tsh=0x51, new_tsh=new_tsh@entry=0x7fb016c316e0, td=td@entry=0x14adedf0, sid=9800979, gid=1, pa=0x7fb0080f3b18)
      at detect-engine-threshold.c:415
  415>----                if (TIMEVAL_DIFF_SEC(p->ts, lookup_tsh->tv1) < td->seconds) {

Bug #4503.

(cherry picked from commit 2a326421aa29154ebfaada3888974a634feb5f56)

4 years agothresholds: syntax fixes
Mats Klepsland [Thu, 27 May 2021 09:04:15 +0000 (11:04 +0200)] 
thresholds: syntax fixes

Fix syntax of if statement in SigGetThresholdTypeIter()

(cherry picked from commit f47e4375b3310554c13561efb2f382f04bd24340)

4 years agothresholds: remove unneeded function argument
Mats Klepsland [Thu, 27 May 2021 08:59:36 +0000 (10:59 +0200)] 
thresholds: remove unneeded function argument

Remove packet pointer from SigGetThresholdTypeIter() as it is
unused.

(cherry picked from commit b0b4fab7949dddeaf4c1b844c403dcc2c2470595)

4 years agorust: fix app-layer parser flags
Philippe Antoine [Fri, 4 Jun 2021 08:28:10 +0000 (10:28 +0200)] 
rust: fix app-layer parser flags

This especially allows for SSH bypass to work

(cherry picked from commit fdab22d924702168e3b7d07d061009ebdcfa9aa9)

4 years agoftp: completely parses pasv and epsv responses
Philippe Antoine [Tue, 27 Apr 2021 07:03:45 +0000 (09:03 +0200)] 
ftp: completely parses pasv and epsv responses

(cherry picked from commit ca6e434e0b84dc8478763dc0a8716c5e3686a99a)

4 years agounix-socket: reset to ready state on startup
Jason Ish [Thu, 25 Feb 2021 17:16:28 +0000 (11:16 -0600)] 
unix-socket: reset to ready state on startup

As part of commit ea15282f47c6ff781533e3a063f9c903dd6f1afb,
some initialization was moved to happen even in unix socket mode,
however, this initialization does setup some loggers that can only have
one instance enabled (anomaly, drop, file-store).

This will cause these loggers to error out on the first pcap, but work
on subsequent runs of the pcap as some deinitialization is done after
each pcap.

This fix just runs the post pcap-file deinitialization routine to
reset some of the initialization done on startup, like is done after
running each pcap in unix socket mode.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4225

Additionally this prevents alerts from being logged two times
on the first run of a pcap through the unix socket:

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4434

(cherry picked from commit 488d5fb34284f7e5be760edeca7607209cfa4b5e)

4 years agohttp2: make decompression a configure-time option 6184/head
Philippe Antoine [Mon, 31 May 2021 15:14:48 +0000 (17:14 +0200)] 
http2: make decompression a configure-time option

4 years agohttp2: have filecontainer for both directions
Philippe Antoine [Fri, 23 Apr 2021 19:55:20 +0000 (21:55 +0200)] 
http2: have filecontainer for both directions

(cherry picked from commit 6fe8bce3b0c653df8e72bdb81bc235672386b8b1)

4 years agohttp2: adds check about dynamic headers table size
Philippe Antoine [Tue, 16 Mar 2021 12:07:30 +0000 (13:07 +0100)] 
http2: adds check about dynamic headers table size

(cherry picked from commit 3de0123ffbf355e3d3de318080f18bd639ec9beb)

4 years agohttp2: remove dead code
Victor Julien [Tue, 18 May 2021 13:07:02 +0000 (15:07 +0200)] 
http2: remove dead code

(cherry picked from commit de280c47d9776c3c16743bb01f8cceb6e97ad94a)

4 years agohttp2: remove assertion which can be wrong
Philippe Antoine [Tue, 18 May 2021 07:52:53 +0000 (09:52 +0200)] 
http2: remove assertion which can be wrong

Brotli decoder stops consuming input it it reaches the
end of its input

(cherry picked from commit b3c502d572693368aba277d28aefc9c9cfe685af)

4 years agohttp2: pass data through when decompression fails
Philippe Antoine [Mon, 5 Apr 2021 13:53:09 +0000 (15:53 +0200)] 
http2: pass data through when decompression fails

as is done for HTTP1

(cherry picked from commit 1ca4f041bb452742f326985479fca9a02473649f)

4 years agohttp2: decompression for files
Philippe Antoine [Thu, 12 Nov 2020 08:24:36 +0000 (09:24 +0100)] 
http2: decompression for files

gzip and brotli decompression for files

(cherry picked from commit d8612282149df27be47f7aaba906ea08dcc3952e)

4 years agorust: BIT_U16 macro utility
Philippe Antoine [Tue, 8 Dec 2020 13:53:01 +0000 (14:53 +0100)] 
rust: BIT_U16 macro utility

(cherry picked from commit 2e46b5d1001d61da2131c42554eff10b7400ad81)

4 years agorust: better panic message for missing file config
Philippe Antoine [Sun, 6 Dec 2020 19:36:45 +0000 (20:36 +0100)] 
rust: better panic message for missing file config

(cherry picked from commit aee8e601491c60aac9ee158918a4110df87bcc1e)

4 years agodecode/vntag: By default, disable vntag decoding 6173/head
Jeff Lucovsky [Fri, 4 Jun 2021 12:26:09 +0000 (08:26 -0400)] 
decode/vntag: By default, disable vntag decoding

This commit makes the VNTag decoder off by default.

4 years agodecode/vntag: Add VNTag decoder logic
Jeff Lucovsky [Sun, 25 Apr 2021 13:20:54 +0000 (09:20 -0400)] 
decode/vntag: Add VNTag decoder logic

(cherry picked from commit 0f0cb5169f378614c753328e2d0396f5b9211a38)

4 years agotests/vntag: VNTAG decoder unittests
Jeff Lucovsky [Sat, 24 Apr 2021 19:44:17 +0000 (15:44 -0400)] 
tests/vntag: VNTAG decoder unittests

(cherry picked from commit 596d7608333290d22ea6cee26a79eb4f9ca8605d)

4 years agodecode/vntag: VNTAG 802.1Qbh decoder
Jeff Lucovsky [Sat, 24 Apr 2021 19:43:50 +0000 (15:43 -0400)] 
decode/vntag: VNTAG 802.1Qbh decoder

(cherry picked from commit 713bace44f05c4b900c35ad2da537ef5e0ad18ec)

4 years agodecode/stats: VNTAG stats
Jeff Lucovsky [Sat, 24 Apr 2021 19:42:48 +0000 (15:42 -0400)] 
decode/stats: VNTAG stats

(cherry picked from commit b944e636a8dfa34971d0375baa1cb3fa764bb2e0)

4 years agodecode/events: VNTAG decoder events
Jeff Lucovsky [Sat, 24 Apr 2021 19:38:16 +0000 (15:38 -0400)] 
decode/events: VNTAG decoder events

(cherry picked from commit 1ddad0a0d610265baea902387eb40d7012c8c841)

4 years agodecode: Add ethertype for VNTAG
Jeff Lucovsky [Sat, 24 Apr 2021 19:36:57 +0000 (15:36 -0400)] 
decode: Add ethertype for VNTAG

(cherry picked from commit 049afde3a275ab748f4ef1f4777b9cfd5dd400ce)

4 years agogithub: Update codeowner handle 6148/head
Shivani Bhardwaj [Fri, 30 Apr 2021 06:55:58 +0000 (12:25 +0530)] 
github: Update codeowner handle

(cherry picked from commit 0c5a8fb35d3f60b3828c5e7b91f4bb9e6c37990c)

4 years agorust: pin memchr to ~2.3 6143/head
Jason Ish [Tue, 25 May 2021 16:18:56 +0000 (10:18 -0600)] 
rust: pin memchr to ~2.3

2.4+ requires a newer version of Rust.

4 years agomakefile: don't include the whole test/ directory
Jason Ish [Tue, 25 May 2021 17:39:31 +0000 (11:39 -0600)] 
makefile: don't include the whole test/ directory

Including the whole directory results in .deps files ending up
in the distribution archive which shouldn't be there. Instead
we have to list all the test sources individually.

Backport of 70b21df75633253ac8318f229de2f521c14a6630.

4 years agordp: correctly returns incomplete in parse_tc 6099/head
Philippe Antoine [Thu, 11 Mar 2021 21:17:13 +0000 (22:17 +0100)] 
rdp: correctly returns incomplete in parse_tc

Adding the already consumed bytes
In case an incomplete tls handshake is handled with/after
a refular rdp t123_tpkt

(cherry picked from commit 6da9a37285a50b513077e5c88094f8112740ffcb)

4 years agoftp: fixes leak with duplicate expectation
Philippe Antoine [Thu, 8 Apr 2021 15:44:01 +0000 (17:44 +0200)] 
ftp: fixes leak with duplicate expectation

(cherry picked from commit 68d6922e3cc47c2608e1ac3614c6bd3a48185a12)

4 years agooutput/log: Ensure files closed in threaded mode
Jeff Lucovsky [Sun, 11 Apr 2021 16:20:15 +0000 (12:20 -0400)] 
output/log: Ensure files closed in threaded mode

This commit ensures that file objects are closed in threaded mode.

(cherry picked from commit 38ae21a19691466b078a6201494df893bc91308c)

4 years agooutput/log: Removed pcie (Tilera) log vestiges
Jeff Lucovsky [Mon, 12 Apr 2021 13:12:23 +0000 (09:12 -0400)] 
output/log: Removed pcie (Tilera) log vestiges

This commit removes the last remnants of the Tilera log output mechanism
(unsupported since 5.0.x).

(cherry picked from commit aa9ad56a5b0faeb9528558f6197ff967c6714e94)

4 years agoflow/bypass: Properly set the ICMP emergency-bypassed value
Luke Coughlan [Mon, 26 Apr 2021 12:05:15 +0000 (13:05 +0100)] 
flow/bypass: Properly set the ICMP emergency-bypassed value

Currently the ICMP emergency-bypassed value defined in suricata.conf is
overwriting the UDP value rather than correctly setting it for ICMP.
This commit corrects this bug so that the ICMP value can be set as
expected.

(cherry picked from commit 7fb56a9075a97cd9781d08efd0f949b0bfca2719)

4 years agokerberos: fix probing parser tag condition
Philippe Antoine [Thu, 11 Mar 2021 15:12:36 +0000 (16:12 +0100)] 
kerberos: fix probing parser tag condition

according to the comment

(cherry picked from commit cb150e97d09baea09a738388426eafad3cccff2a)

4 years agodetect/alert: apply pd only actions to flow
Victor Julien [Wed, 10 Mar 2021 12:25:55 +0000 (13:25 +0100)] 
detect/alert: apply pd only actions to flow

Ticket #4394

(cherry picked from commit 6cf44fc839e8f1da820095928b5b25e7fc0a8521)

4 years agodetect/alert: minor code refactor
Victor Julien [Tue, 9 Mar 2021 19:56:14 +0000 (20:56 +0100)] 
detect/alert: minor code refactor

Use a simpler reject check and move logic into util func.

(cherry picked from commit 6c594d29db55bb0d6f28f0a5fa758c3e00a86ca1)

4 years agodetect/iponly: don't check & set flow flags twice
Victor Julien [Tue, 9 Mar 2021 15:25:14 +0000 (16:25 +0100)] 
detect/iponly: don't check & set flow flags twice

Per flow IP-only flags are checked and set by IP-only engine, so
no need to set/check them per alert.

(cherry picked from commit fbcdd2ec267d49040ca178f8562767d8fb00aa73)

4 years agothreshold-config: Improve support for big IP lists
Jeff Lucovsky [Sat, 5 Dec 2020 14:28:38 +0000 (09:28 -0500)] 
threshold-config: Improve support for big IP lists

(cherry picked from commit ef62761e8c64d1644f2628ca7fc99e815bd96b88)

4 years agodetect/threshold: Improve threshold.config perf
Jeff Lucovsky [Mon, 29 Mar 2021 12:30:59 +0000 (08:30 -0400)] 
detect/threshold: Improve threshold.config perf

This commit improves performance when parsing threshold.config by
removing a loop-invariant to create a one-time object with the parsed
address(es).

Then, as needed, copies of this object are made as the suppression
rule(s) are processed.

(cherry picked from commit 02ceac8b8d4473de5f373a4785a1c143778b06e1)

4 years agodetect/threshold: Function to deep-copy thresh obj
Jeff Lucovsky [Mon, 29 Mar 2021 12:28:50 +0000 (08:28 -0400)] 
detect/threshold: Function to deep-copy thresh obj

This commit adds a function to make a deep copy of a DetectThresholdData
object.

The function is used when parsing threshold.config items to make a
one-time object and then add copies as needed.

(cherry picked from commit e873632a2811be4cd370336d43fcc5619bcd28e2)

4 years agodetect/address: Expose DetectAddressCopy function
Jeff Lucovsky [Mon, 29 Mar 2021 12:26:40 +0000 (08:26 -0400)] 
detect/address: Expose DetectAddressCopy function

(cherry picked from commit 11f9cc6524958d11b6d9ab1f0785bfe16237096f)

4 years agogeneral: Typo cleanup
Jeff Lucovsky [Mon, 29 Mar 2021 12:33:02 +0000 (08:33 -0400)] 
general: Typo cleanup

(cherry picked from commit 2893b04ab014c4dcc0bfc4c6f9dbf83fd44717a1)

4 years agoeve/drop: use highest priority drop
Victor Julien [Fri, 12 Mar 2021 09:22:01 +0000 (10:22 +0100)] 
eve/drop: use highest priority drop

When adding the alert to a drop record make sure the add the highest
priority.

It would until now add all drops from high to low prio, effectively
overwriting the record each time.

Ticket #4397

(cherry picked from commit 398ebf934509a8d27a1c8b858eae061b89d5c44a)

4 years agomisc: include queue.h before other headers 6079/head
Jason Ish [Thu, 22 Apr 2021 14:52:08 +0000 (08:52 -0600)] 
misc: include queue.h before other headers

At least on FreeBSD, some other include is including "sys/queue.h"
which results in FreeBSDs /usr/include/sys/queue.h being picked
up and setting __SYS_QUEUE_H__ so our queue.h is not picked up.

But the FreeBSD queue.h does not have the CIRCLEQ definitions. To
fix just include our queue.h first, which also sets __SYS_QUEUE_H__
preventing the system one from being picked up.

(cherry picked from commit d4554ec6bb6e4e52fb2e36cf0412c981a4d1d2e9)

4 years agotx: fix unidir tx cleanup
Jason Ish [Thu, 22 Apr 2021 15:38:24 +0000 (09:38 -0600)] 
tx: fix unidir tx cleanup

A unidirection protocol parser should only have its transactions
marked as "skipped" if it is skipped in both the TS and TC
directions, otherwise unidir transactions are always considered
skipped and the cleanup will never updates its minimum id.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4437

(cherry picked from commit afaa18c5ad183d068795cf15d21d3642814ceb23)

4 years agoeve/mqtt: fix mqtt logging with threaded eve 6016/head
Jason Ish [Thu, 25 Mar 2021 18:11:01 +0000 (12:11 -0600)] 
eve/mqtt: fix mqtt logging with threaded eve

Mqtt was not setting up a per-thread file context for logging
in threaded mode, leading a crash when used in threaded mode.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4404

(cherry picked from commit 64330498f842386cc1f1cdec0409959b5565496f)

4 years agoci: make format check use 6.0.x branch
Victor Julien [Wed, 31 Mar 2021 13:20:14 +0000 (15:20 +0200)] 
ci: make format check use 6.0.x branch

4 years agodetect/icmp: reject invalid rules for icode/itype
Victor Julien [Wed, 3 Mar 2021 13:01:55 +0000 (14:01 +0100)] 
detect/icmp: reject invalid rules for icode/itype

(cherry picked from commit 68f8b2f40f24a8656b09b3a9b1245ab3cf62a11d)

4 years agodetect/prefilter: fix null ptr deref on invalid rule
Victor Julien [Wed, 3 Mar 2021 12:41:26 +0000 (13:41 +0100)] 
detect/prefilter: fix null ptr deref on invalid rule

A bad rule 'icode:<0; prefilter;' would trigger a null ptr deref
in ApplyToU8Hash.

Bug #4375.

(cherry picked from commit 7d6835958bbb6ddf2931c9e20f409eadfc8ca068)

4 years agoversion: start development towards 6.0.3
Victor Julien [Fri, 5 Mar 2021 10:41:37 +0000 (11:41 +0100)] 
version: start development towards 6.0.3

4 years agorelease: 6.0.2; update changelog; require htp 0.5.37 5962/head suricata-6.0.2
Victor Julien [Mon, 1 Mar 2021 15:56:01 +0000 (16:56 +0100)] 
release: 6.0.2; update changelog; require htp 0.5.37

4 years agodetect/prefilter: fix handling of prefilter as fast_pattern alias
Victor Julien [Sat, 20 Feb 2021 14:53:51 +0000 (15:53 +0100)] 
detect/prefilter: fix handling of prefilter as fast_pattern alias

(cherry picked from commit 0dd5921bc9791ac733c8d264212d69e661309df1)

4 years agodetect: forbids unsupported prefilters
Philippe Antoine [Sun, 7 Feb 2021 20:34:12 +0000 (21:34 +0100)] 
detect: forbids unsupported prefilters

(cherry picked from commit b7fd01c86e0d0f3c341031d62ec89e305859aa0b)

4 years agodetect: set HTTP SWF decompress limits
Victor Julien [Thu, 25 Feb 2021 21:38:34 +0000 (22:38 +0100)] 
detect: set HTTP SWF decompress limits

(cherry picked from commit af13d4de180515f92813befc9bca06b66f7233bb)

4 years agoRevert "detect/state: optimize state keeping"
Victor Julien [Mon, 1 Mar 2021 07:02:22 +0000 (08:02 +0100)] 
Revert "detect/state: optimize state keeping"

This reverts commit 13ce474d5e3947389e781f95fa6337d2eb36e129.

The optimization is incomplete. A more complete fix is merged in
master, but this needs a bit more time before getting backported.

4 years agosmb: relax probing parser to handle first NBSS message
Philippe Antoine [Wed, 17 Feb 2021 14:36:12 +0000 (15:36 +0100)] 
smb: relax probing parser to handle first NBSS message

cf dcerpc-udp S-V test :
First message is Message Type: Session request (0x81)
Second message is SMB

(cherry picked from commit 83070102557d2755b9ffc67bb14b9b4d48b039e9)

4 years agosmb: probing parser for start and midstream
Philippe Antoine [Tue, 2 Feb 2021 12:31:08 +0000 (13:31 +0100)] 
smb: probing parser for start and midstream

The probing parser is more strict at the start of the stream

(cherry picked from commit 1b6e81cd7284355cb4315606cac30325e144d25a)

4 years agosmb: split probing function for code style
Philippe Antoine [Tue, 2 Feb 2021 12:29:14 +0000 (13:29 +0100)] 
smb: split probing function for code style

Introduces rs_smb_probe_tcp_midstream

(cherry picked from commit 9dc5258a21cecdabca26aaac108e83d85147d30b)

4 years agoprotodetect: only run ProbingParserTc if STREAM_TOCLIENT
Philippe Antoine [Wed, 17 Feb 2021 13:54:46 +0000 (14:54 +0100)] 
protodetect: only run ProbingParserTc if STREAM_TOCLIENT

(cherry picked from commit 660e9e489b7d898509946d8a66f15c6107fd5a4e)

4 years agodetect: fix overflows in SetupU8Hash
Philippe Antoine [Wed, 17 Feb 2021 16:02:35 +0000 (17:02 +0100)] 
detect: fix overflows in SetupU8Hash

For instance ">255" resulted in overflow

(cherry picked from commit 2d765d6c686449e78e29759b07c4852ebab3c46e)

4 years agossl: reset state when breaking out of SSLV3_HANDSHAKE_PROTOCOL
Philippe Antoine [Fri, 18 Dec 2020 21:12:23 +0000 (22:12 +0100)] 
ssl: reset state when breaking out of SSLV3_HANDSHAKE_PROTOCOL

So that we cannot resumt it with corrupted values

(cherry picked from commit eb460cf78dadc874633a57571245acf2911a6b6e)

4 years agomodbus: stop allocating transactions when flooded
Philippe Antoine [Thu, 17 Dec 2020 20:48:54 +0000 (21:48 +0100)] 
modbus: stop allocating transactions when flooded

cf #4224

(cherry picked from commit 89030d3e59e23d4850ac9a7db5763c3d4d4fd537)

4 years agoicmpv6: bail out for icmpv6.hdr keyword if not ICMPv6
Philippe Antoine [Fri, 18 Dec 2020 13:21:16 +0000 (14:21 +0100)] 
icmpv6: bail out for icmpv6.hdr keyword if not ICMPv6

(cherry picked from commit ddb4d289ae00908d8f25fdd3afbcd5a1da2111a6)

4 years agooutput/http2: Multi-threaded EVE logging support
Jeff Lucovsky [Tue, 8 Dec 2020 13:38:18 +0000 (08:38 -0500)] 
output/http2: Multi-threaded EVE logging support

This commit adds multi-threaded EVE logging support to the HTTP/2
logging path.

(cherry picked from commit 538fc58b37cb6633824fc2e167068b11d09a013a)

4 years agoeve: fix memory leak in metadata
Philippe Antoine [Mon, 7 Dec 2020 11:16:31 +0000 (12:16 +0100)] 
eve: fix memory leak in metadata

Fixes #4205

(cherry picked from commit 35f6c80bbf4eef7ec311ed78dd29819cc471905e)

4 years agoprotodetect: rename direction to flags
Philippe Antoine [Tue, 2 Feb 2021 10:12:12 +0000 (11:12 +0100)] 
protodetect: rename direction to flags

And use whole flags in AppLayerProtoDetectPPGetProto

(cherry picked from commit c6aadf0dfa0d438e3a4a46db2de893b62e76d7ce)

4 years agodecode: limits the number of decoded layers
Philippe Antoine [Thu, 28 Jan 2021 16:48:48 +0000 (17:48 +0100)] 
decode: limits the number of decoded layers

so as to avoid overrecursion leading to stack exhaustion

(cherry picked from commit 7500c29300dcef8716d87461842e7d7c3e5101ac)

4 years agodetect/http.request_body: fix tracking with xforms 5934/head
Victor Julien [Thu, 25 Feb 2021 21:00:17 +0000 (22:00 +0100)] 
detect/http.request_body: fix tracking with xforms

Fix handling of file progress tracking for regular http.request_body
along with transform combinations.

This is done by implementing the 'base id' logic.

Related tickets: #4361 #4199 #3616

(cherry picked from commit 4a1482a1cfab7bbf95be81dff9b9db3708f6626a)

4 years agodetect/file.data: fix mixing transforms (http)
Victor Julien [Thu, 25 Feb 2021 20:36:27 +0000 (21:36 +0100)] 
detect/file.data: fix mixing transforms (http)

Fix handling of file progress tracking for regular file.data along
with transform combinations for the part of the implementation that
uses the HTTP inspection logic.

This is done by implementing the 'base id' logic.

Related tickets: #4361 #4199 #3616

(cherry picked from commit ea3fb4a465e0ecd3f08c2828aa08804335c77a46)

4 years agodetect/file.data: fix mixing transforms (file api)
Victor Julien [Thu, 25 Feb 2021 19:07:41 +0000 (20:07 +0100)] 
detect/file.data: fix mixing transforms (file api)

Fix handling of file progress tracking for regular file.data along
with transform combinations for the part of the implementation that
uses the File API.

This is done by implementing the 'base id' logic.

Related tickets: #4361 #4199 #3616

(cherry picked from commit 54ad7de9cea22b9a3c3e7cc64145155126f4dada)

4 years agodetect: track base id for xform buffers
Victor Julien [Thu, 25 Feb 2021 19:06:40 +0000 (20:06 +0100)] 
detect: track base id for xform buffers

Buffers with transforms are based on the non-transformed "base"
buffer, with a new ID assigned and the transform callbacks added.

This patch stores the id of the original buffer in the new buffer
inspect and prefilter structures. This way the buffers with and
without transforms can share some of the logic are progression
of file and body inspection trackers.

Related tickets: #4361 #4199 #3616

(cherry picked from commit 975062cf401f79c00abf728d923c65aabd143af2)

4 years agodetect/analyzer: fix pkt engine display
Victor Julien [Sun, 7 Feb 2021 08:00:49 +0000 (09:00 +0100)] 
detect/analyzer: fix pkt engine display

(cherry picked from commit 52692da7cf9f66a979bac24f38efd5ce2767d066)

4 years agoclassification: sync and update
Victor Julien [Wed, 24 Feb 2021 15:30:13 +0000 (16:30 +0100)] 
classification: sync and update

Sync to latest ET open and introduce inappropriate as a classification
to replace something some find inappropriate.

(cherry picked from commit f037f6f4ff08ed0442b3bbc1623dfb7ecb23c716)

4 years agotcp: remove debug asserts about large windows
Philippe Antoine [Wed, 17 Feb 2021 14:43:17 +0000 (15:43 +0100)] 
tcp: remove debug asserts about large windows

Completes 00d7c9034be7470177c01e8805831c258b016d0e

(cherry picked from commit 7264f58f2cbf266ba44efd32c5031b692b57967d)

4 years agodcerpc: trigger raw assembly on record completion
Shivani Bhardwaj [Tue, 23 Feb 2021 09:55:52 +0000 (15:25 +0530)] 
dcerpc: trigger raw assembly on record completion

(cherry picked from commit 0ac5c5376a2a6e32ac0c12ff8bc483abf04c9cb8)

4 years agorust/context: add AppLayerParserTriggerRawStreamReassembly
Shivani Bhardwaj [Tue, 23 Feb 2021 08:23:06 +0000 (13:53 +0530)] 
rust/context: add AppLayerParserTriggerRawStreamReassembly

(cherry picked from commit c77c8e70050b865401b3cfd3d5396bec90ac2498)

4 years agodcerpc/udp: improve detection
Shivani Bhardwaj [Sat, 13 Feb 2021 12:27:42 +0000 (17:57 +0530)] 
dcerpc/udp: improve detection

Lately, Wireguard proto starting w pattern |04 00| is misdetected as
DCERPC/UDP which also starts with the same pattern, add more checks
to make sure that it is the best guess for packet to be dcerpc/udp.

(cherry picked from commit f967a491047a6d8eaa232944c690dadfb0cc3c86)

4 years agodcerpc: add probe function
Shivani Bhardwaj [Sat, 20 Feb 2021 06:32:28 +0000 (12:02 +0530)] 
dcerpc: add probe function

(cherry picked from commit 3641f1b52256b7eb289048d6b83e660fe4907aaf)

4 years agorust/applayer: split EOF flag per direction
Shivani Bhardwaj [Sat, 20 Feb 2021 06:31:20 +0000 (12:01 +0530)] 
rust/applayer: split EOF flag per direction

(cherry picked from commit d7a3523b12d0280f6fd8cdadc14118d1ede31fd5)

4 years agodcerpc/udp: remove transmute
Shivani Bhardwaj [Sat, 20 Feb 2021 06:30:17 +0000 (12:00 +0530)] 
dcerpc/udp: remove transmute

The book defines transmute as "This is really, truly, the most horribly unsafe
thing you can do in Rust. The guardrails here are dental floss."
Transmute can result into mind boggling undefined behaviors. Get rid of
it wherever possible.

(cherry picked from commit 0ca8591994abfe92bbef20ea6ab1856b11e3efde)

4 years agogithub-ci: use suricata-update master-1.2.x branch
Jason Ish [Wed, 24 Feb 2021 22:51:28 +0000 (16:51 -0600)] 
github-ci: use suricata-update master-1.2.x branch

Suricata 6.0.x tracks the Suricata-Update 1.2.x branch.

4 years agostream/tcp: fix stream side after direction change 5911/head
Ilya Bakhtin [Tue, 28 Jul 2020 14:33:23 +0000 (16:33 +0200)] 
stream/tcp: fix stream side after direction change

(cherry picked from commit 1ecea0f44c0050feb57c6b26a5a94c8ad8f1b85d)

4 years agodoc/quickstart: use new test url that works
Jason Ish [Mon, 22 Feb 2021 21:23:52 +0000 (15:23 -0600)] 
doc/quickstart: use new test url that works

Replace http://testmyids.org with http://testmynids.org/uid/index.html,
as testmyids.org now always redirects to https.

(cherry picked from commit 560974b2dbd402928e5fa8004ab810919cd86f04)

4 years agodoc: update installation documentation for CentOS and Fedora
Josh Stroschein [Fri, 18 Dec 2020 18:09:48 +0000 (12:09 -0600)] 
doc: update installation documentation for CentOS and Fedora

(cherry picked from commit 7ece0ac31f9a3af13aebf928a1c63c672532dcec)

4 years agohttp: makes decompression time limit configurable
Philippe Antoine [Wed, 17 Feb 2021 08:37:57 +0000 (09:37 +0100)] 
http: makes decompression time limit configurable

(cherry picked from commit a04b5566a62d9d6967587f83dfaca89b5c33eb66)