]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
7 years agostream: support RST getting lost/ignored
Victor Julien [Thu, 10 May 2018 15:23:05 +0000 (17:23 +0200)] 
stream: support RST getting lost/ignored

In case of a valid RST on a SYN, the state is switched to 'TCP_CLOSED'.
However, the target of the RST may not have received it, or may not
have accepted it. Also, the RST may have been injected, so the supposed
sender may not actually be aware of the RST that was sent in it's name.

In this case the previous behavior was to switch the state to CLOSED and
accept no further TCP updates or stream reassembly.

This patch changes this. It still switches the state to CLOSED, as this
is by far the most likely to be correct. However, it will reconsider
the state if the receiver continues to talk.

To do this on each state change the previous state will be recorded in
TcpSession::pstate. If a non-RST packet is received after a RST, this
TcpSession::pstate is used to try to continue the conversation.

If the (supposed) sender of the RST is also continueing the conversation
as normal, it's highly likely it didn't send the RST. In this case
a stream event is generated.

Ticket: #2501

Reported-By: Kirill Shipulin
7 years agostream-events: fix mapping
Victor Julien [Mon, 21 May 2018 14:15:39 +0000 (16:15 +0200)] 
stream-events: fix mapping

7 years agosmb: log trans2 that enable delete on close 3421/head
Victor Julien [Tue, 10 Jul 2018 15:22:53 +0000 (17:22 +0200)] 
smb: log trans2 that enable delete on close

7 years agosmb1: add support for trans2 set_path_info rename
Victor Julien [Mon, 9 Jul 2018 13:43:02 +0000 (15:43 +0200)] 
smb1: add support for trans2 set_path_info rename

7 years agosmb: improve dcerpc logic
Victor Julien [Sat, 7 Jul 2018 09:47:55 +0000 (11:47 +0200)] 
smb: improve dcerpc logic

Detect whether a pipe is a dcerpc channel based on the name of the
pipe.

7 years agosmb1: improve NT Create response record parsing
Victor Julien [Sat, 7 Jul 2018 08:37:59 +0000 (10:37 +0200)] 
smb1: improve NT Create response record parsing

7 years agohttp: fix setting event on the last tx
Victor Julien [Thu, 5 Jul 2018 09:43:41 +0000 (11:43 +0200)] 
http: fix setting event on the last tx

7 years agopcap-file: fix segv on bad pcap format
Victor Julien [Thu, 5 Jul 2018 08:13:52 +0000 (10:13 +0200)] 
pcap-file: fix segv on bad pcap format

7 years agohttp: set events for too many layers of compression
Victor Julien [Thu, 5 Jul 2018 08:01:47 +0000 (10:01 +0200)] 
http: set events for too many layers of compression

libhtp would already issue warnings, but these were not mapped
to events yet.

7 years agosource-pcap-file: delete when done (2417)
Danny Browning [Tue, 16 Jan 2018 16:24:16 +0000 (09:24 -0700)] 
source-pcap-file: delete when done (2417)

https://redmine.openinfosecfoundation.org/issues/2417

Add option to have pcap files deleted after they have been processed.
This option combines well with pcap file continuous and streaming
files to a directory being processed.

7 years agodetect: fix memory leak in app-layer-event keyword
Victor Julien [Wed, 4 Jul 2018 13:10:34 +0000 (15:10 +0200)] 
detect: fix memory leak in app-layer-event keyword

Bug #2515.

7 years agoapp-layer/tcp: set STREAM_MIDSTREAM flag
Victor Julien [Thu, 21 Jun 2018 13:22:26 +0000 (15:22 +0200)] 
app-layer/tcp: set STREAM_MIDSTREAM flag

7 years agorust/smb: search for record on midstream start
Victor Julien [Thu, 21 Jun 2018 12:31:14 +0000 (14:31 +0200)] 
rust/smb: search for record on midstream start

Calls with both START and MIDSTREAM mean the record might be cut and the
start of it could be missing. For this case, enable the same logic as is
used when catching up after a GAP. Search for the start of the record
instead of assuming it sits exactly at the start of the input data.

7 years agorust: define all STREAM_* types
Victor Julien [Thu, 21 Jun 2018 12:18:02 +0000 (14:18 +0200)] 
rust: define all STREAM_* types

7 years agoapp-layer: pass STREAM_* flags to parser
Victor Julien [Thu, 21 Jun 2018 09:23:27 +0000 (11:23 +0200)] 
app-layer: pass STREAM_* flags to parser

Pass the STREAM_* flags to the app-layer parser functions so that
the parser can know more about how it is called.

7 years agodetect: fix delayed detect
Victor Julien [Sat, 30 Jun 2018 12:13:19 +0000 (14:13 +0200)] 
detect: fix delayed detect

Last multi-detect changes broken delayed-detect by refusing to reload
a 'stub' detect engine. This patch distinguishes between a stub for
multi-tenancy and for delayed detect.

7 years agoadd note about eve-alert metadata
jason taylor [Thu, 28 Jun 2018 18:08:43 +0000 (14:08 -0400)] 
add note about eve-alert metadata

Signed-off-by: jason taylor <jtfas90@gmail.com>
7 years agodoc: alphabetize EXTRA_DIST
Jason Ish [Thu, 28 Jun 2018 16:07:52 +0000 (10:07 -0600)] 
doc: alphabetize EXTRA_DIST

7 years agodoc: add window ips inline doc to extra_dist
Jason Ish [Thu, 28 Jun 2018 16:05:05 +0000 (10:05 -0600)] 
doc: add window ips inline doc to extra_dist

7 years agodoc: make warnings errors when building man page
Jason Ish [Thu, 28 Jun 2018 15:24:46 +0000 (09:24 -0600)] 
doc: make warnings errors when building man page

7 years agodoc: link in windows ips setup page
Jason Ish [Thu, 28 Jun 2018 15:07:55 +0000 (09:07 -0600)] 
doc: link in windows ips setup page

7 years agodetect: reload-rules shouldn't reload a stub
Victor Julien [Thu, 28 Jun 2018 14:31:40 +0000 (16:31 +0200)] 
detect: reload-rules shouldn't reload a stub

7 years agodetect/debug: suppress noisy info messages 3409/head
Victor Julien [Thu, 28 Jun 2018 08:43:25 +0000 (10:43 +0200)] 
detect/debug: suppress noisy info messages

7 years agodetect/multi-tenant: fix mix of default detect engine and tenants
Victor Julien [Wed, 27 Jun 2018 20:17:34 +0000 (22:17 +0200)] 
detect/multi-tenant: fix mix of default detect engine and tenants

7 years agodetect: make detect engine types explicit
Victor Julien [Wed, 27 Jun 2018 11:44:06 +0000 (13:44 +0200)] 
detect: make detect engine types explicit

There are 3 types of detect engine objects:
    1. normal
       The normal detection engine if no multi-tenancy is in use

    2. tenant
       A per tenant detection engine

    3. stub
       A stub (or minimal as it was called before) detect engine
       that is needed to have something in place when there are
       only tenants.

       A stub is also used in case of 'delayed detect', where we
       need a minimal detect engine to start up which is replaced
       by a full (normal type) detect engine after startup.

This patch adds a new field 'type' to the DetectEngineCtx object
to distinguish between the types. This replaces the boolean 'minimal'.

7 years agodhcp: suppress notice message at startup
Victor Julien [Mon, 25 Jun 2018 09:17:29 +0000 (11:17 +0200)] 
dhcp: suppress notice message at startup

7 years agorust/dns - remove extra parantheses
Jason Ish [Mon, 25 Jun 2018 14:40:54 +0000 (08:40 -0600)] 
rust/dns - remove extra parantheses

Removes rust compiler warning.

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

7 years agoyaml-loader: fix memory leak on fail include
Jason Ish [Mon, 25 Jun 2018 13:08:38 +0000 (07:08 -0600)] 
yaml-loader: fix memory leak on fail include

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

If an include failed to load, either by the file not existing or
a parse error, the file pointer and yaml parser instance were
leaked.

7 years agooutput-json-alert: log correct dns and dnp3 tx
Eric Leblond [Thu, 21 Jun 2018 19:05:16 +0000 (21:05 +0200)] 
output-json-alert: log correct dns and dnp3 tx

Using transaction log entry is not correct to log the transaction
that did cause the alert. The tx_id in the PacketAlert is correct
so let's use that.

7 years agodetect/multi-tenant: fix removing of tenant id 0
Victor Julien [Tue, 26 Jun 2018 11:27:09 +0000 (13:27 +0200)] 
detect/multi-tenant: fix removing of tenant id 0

7 years agounix/multi-tenant: improve (log) messages
Victor Julien [Mon, 25 Jun 2018 11:57:16 +0000 (13:57 +0200)] 
unix/multi-tenant: improve (log) messages

7 years agodetect/tenants: fix crash when adding mapping
Victor Julien [Mon, 25 Jun 2018 09:15:16 +0000 (11:15 +0200)] 
detect/tenants: fix crash when adding mapping

When no tenants and mappings are defined in 'live' mode, adding a
mapping resulted in a crash.

7 years agodetect: remove lock from global keyword logic
Victor Julien [Sun, 24 Jun 2018 09:06:24 +0000 (11:06 +0200)] 
detect: remove lock from global keyword logic

The global keyword registration and per thread init handling used
the lock from the DetectEngineMasterCtx. This lead to a dead lock
situation at multi-tenancy tenant reloads.

The lock was unnecessary however, as the only time the registration
list is updated is at engine initialization. At that time Suricata
is still running in a single thread. After this, the data structure
doesn't change anymore.

Bug #2516.

7 years agoAdds WinDivert support to Windows builds 3402/head
Jacob Masen-Smith [Wed, 20 Jun 2018 20:44:26 +0000 (13:44 -0700)] 
Adds WinDivert support to Windows builds

Enables IPS functionality on Windows using the open-source
(LGPLv3/GPLv2) WinDivert driver and API.

From https://www.reqrypt.org/windivert-doc.html : "WinDivert is a
user-mode capture/sniffing/modification/blocking/re-injection package
for Windows Vista, Windows Server 2008, Windows 7, and Windows 8.
WinDivert can be used to implement user-mode packet filters, packet
sniffers, firewalls, NAT, VPNs, tunneling applications, etc., without
the need to write kernel-mode code."

- adds `--windivert [filter string]` and `--windivert-forward [filter
    string]` command-line options to enable WinDivert IPS mode.
    `--windivert[-forward] true` will open a filter for all traffic. See
    https://www.reqrypt.org/windivert-doc.html#filter_language for more
    information.

Limitation: currently limited to `autofp` runmode.

Additionally:
- `tmm_modules` now zeroed during `RegisterAllModules`
- fixed Windows Vista+ `inet_ntop` call in `PrintInet`
- fixed `GetRandom` bug (nonexistent keys) on fresh Windows installs
- fixed `RandomGetClock` building on Windows builds
- Added WMI queries for MTU

7 years agotravis: use gcc-7 on cocci build 3401/head
Jason Ish [Tue, 19 Jun 2018 17:03:04 +0000 (11:03 -0600)] 
travis: use gcc-7 on cocci build

Catches more errors, like switch statements fall throughs
that are caught in private QA.

7 years agodoc: fix minor typo 3399/head
Chris Speidel [Sun, 17 Jun 2018 22:25:23 +0000 (18:25 -0400)] 
doc: fix minor typo

7 years agofilestore: fix truncation warnings
Jason Ish [Sat, 16 Jun 2018 13:37:28 +0000 (07:37 -0600)] 
filestore: fix truncation warnings

7 years agopacket: gre over ip link type
fooinha [Fri, 1 Jun 2018 11:45:10 +0000 (12:45 +0100)] 
packet: gre over ip link type

7 years agotls: document encrypt-handling option
Victor Julien [Tue, 29 May 2018 19:37:21 +0000 (21:37 +0200)] 
tls: document encrypt-handling option

Document in sample yaml and user guide.

7 years agotls: new config for dealing with encrypted traffic
Victor Julien [Thu, 24 May 2018 12:56:30 +0000 (14:56 +0200)] 
tls: new config for dealing with encrypted traffic

Much of encrypted traffic is uninteresting to Suricata. Once encrypted
communication starts, inspecting the packet payloads is generally
not interesting anymore. The default behavior is to disable the parts
of the detection engine and stream reassembly that relate to raw content
inspection.

The tls app-layer parser also had a crude option to affect this behavior:
set 'no-reassemble' to true went much further than the default behavior.
It disabled the TCP reassembly on the flow completely, disabled all
inspection on the flow and enabled bypass if available.

This patch adds a new option: full inspection. This continues to treat
a TLS session as any other, so without any limits to inspection.

The new option is implemented in a new config option 'encrypt-handling',
that replaces 'no-reassemble'. The new option has 3 values:
'default', 'full' and 'bypass'. Default is the current default behavior,
'bypass' is the current 'no-reassemble = true' behavior and 'full'
is the new full inspection mode.

7 years agodetect/stream_size: code cleanups
Victor Julien [Thu, 24 May 2018 12:56:03 +0000 (14:56 +0200)] 
detect/stream_size: code cleanups

7 years agodetect/stream_size: apply rule to packets & stream
Victor Julien [Wed, 23 May 2018 11:55:30 +0000 (13:55 +0200)] 
detect/stream_size: apply rule to packets & stream

The use of stream_size in combination with raw content matches is an
indication that the rule needs to be evaluated per packet, not just
per reassembled stream chunk.

7 years agokerberos: minor doc updates, add author 3398/head
Victor Julien [Mon, 18 Jun 2018 08:53:14 +0000 (10:53 +0200)] 
kerberos: minor doc updates, add author

7 years agodhcp: add author
Victor Julien [Mon, 18 Jun 2018 08:52:59 +0000 (10:52 +0200)] 
dhcp: add author

7 years agodhcp: update user guide 3395/head
Jason Ish [Fri, 8 Jun 2018 19:18:03 +0000 (13:18 -0600)] 
dhcp: update user guide

7 years agodhcp: add dhcp app-layer rules file
Jason Ish [Thu, 31 May 2018 23:05:52 +0000 (17:05 -0600)] 
dhcp: add dhcp app-layer rules file

7 years agorust/dhcp: Rust based DHCP decoder and logger.
Jason Ish [Tue, 8 May 2018 23:49:52 +0000 (17:49 -0600)] 
rust/dhcp: Rust based DHCP decoder and logger.

This is a DHCP decoder and logger written in Rust. Unlike most
parsers, this one is stateless so responses are not matched
up to requests by Suricata. However, the output does contain
enough fields to match them up in post-processing.

Rules are included to alert of malformed or truncated options.

7 years agorust: a Rust ConfNode wrapper.
Jason Ish [Wed, 13 Jun 2018 22:03:33 +0000 (16:03 -0600)] 
rust: a Rust ConfNode wrapper.

A Rust wrapper around the C ConfNode object. Currenlty only exposes
ConfGetChildValueBool and ConfGetChildValue.

7 years agoeve: check if enabled before attempting to setup
Jason Ish [Wed, 13 Jun 2018 22:36:49 +0000 (16:36 -0600)] 
eve: check if enabled before attempting to setup

Before setting up a sub eve-logger, check that it is enabled. This
allows us to set "enabled: no" for loggers that are not registered
with the system without generating an error. An example of this
is loggers that are only available with Rust.

7 years agorust/app-layer: macros to export de_state functions
Jason Ish [Thu, 31 May 2018 22:39:22 +0000 (16:39 -0600)] 
rust/app-layer: macros to export de_state functions

These macros generate the extern "C" functions for transactions
structs that need provide functions for setting and getting
the de_state. The idea is to provide macros do avoid code
duplication and make it simpler to create an app-layer.

A trait would be the correct solution, but it doesn't look like
you can use traits to export extern "C" functions.

7 years agorust: add get_tx_iterator to parser registration
Jason Ish [Thu, 31 May 2018 22:38:53 +0000 (16:38 -0600)] 
rust: add get_tx_iterator to parser registration

7 years agoapp-layer-register: add GetTxIterator
Jason Ish [Thu, 31 May 2018 22:34:23 +0000 (16:34 -0600)] 
app-layer-register: add GetTxIterator

Add a field to set the GetTxIterator function to the AppLayerParser
registration struct.

7 years agoapp-layer-detect-proto: remove unnecessary gotos
Jason Ish [Mon, 28 May 2018 22:00:18 +0000 (16:00 -0600)] 
app-layer-detect-proto: remove unnecessary gotos

7 years agoKerberos 5: properly handle TCP buffering 3391/head
Pierre Chifflier [Thu, 24 May 2018 07:27:25 +0000 (09:27 +0200)] 
Kerberos 5: properly handle TCP buffering

7 years agoDocument Kerberos 5 parsing events
Pierre Chifflier [Tue, 15 May 2018 14:54:31 +0000 (16:54 +0200)] 
Document Kerberos 5 parsing events

7 years agoAdd krb5_err_code detection keyword
Pierre Chifflier [Mon, 7 May 2018 06:16:53 +0000 (08:16 +0200)] 
Add krb5_err_code detection keyword

7 years agoAdd krb5_cname and krb5_sname detection keywords
Pierre Chifflier [Sat, 5 May 2018 14:10:51 +0000 (16:10 +0200)] 
Add krb5_cname and krb5_sname detection keywords

7 years agoAdd krb5_msg_type detection keyword
Pierre Chifflier [Sat, 5 May 2018 14:06:54 +0000 (16:06 +0200)] 
Add krb5_msg_type detection keyword

7 years agoKerberos 5: rename weak crypto to weak encryption, and log it
Pierre Chifflier [Thu, 19 Apr 2018 21:15:42 +0000 (23:15 +0200)] 
Kerberos 5: rename weak crypto to weak encryption, and log it

7 years agoAdd event rules for Kerberos 5
Pierre Chifflier [Thu, 19 Apr 2018 11:09:43 +0000 (13:09 +0200)] 
Add event rules for Kerberos 5

7 years agoKerberos 5: pretty-print error code when logging
Pierre Chifflier [Thu, 19 Apr 2018 09:04:01 +0000 (11:04 +0200)] 
Kerberos 5: pretty-print error code when logging

7 years agoLog Kerberos 5 errors
Pierre Chifflier [Thu, 19 Apr 2018 09:17:23 +0000 (11:17 +0200)] 
Log Kerberos 5 errors

7 years agoKerberos 5: add support for TCP as well
Pierre Chifflier [Tue, 17 Apr 2018 07:31:04 +0000 (09:31 +0200)] 
Kerberos 5: add support for TCP as well

7 years agoKerberos: check version in probing function
Pierre Chifflier [Tue, 17 Apr 2018 06:32:59 +0000 (08:32 +0200)] 
Kerberos: check version in probing function

7 years agoAdd logger for Kerberos 5 metadata
Pierre Chifflier [Tue, 17 Apr 2018 05:50:43 +0000 (07:50 +0200)] 
Add logger for Kerberos 5 metadata

7 years agoAdd Kerberos 5 application layer
Pierre Chifflier [Mon, 16 Apr 2018 06:15:02 +0000 (08:15 +0200)] 
Add Kerberos 5 application layer

7 years agoutil-random: fix detection of getrandom failure 3386/head
Eric Leblond [Thu, 24 May 2018 11:43:30 +0000 (13:43 +0200)] 
util-random: fix detection of getrandom failure

7 years agoutil-random: workaround getrandom unavailability 3384/head
Eric Leblond [Wed, 23 May 2018 06:57:13 +0000 (08:57 +0200)] 
util-random: workaround getrandom unavailability

getrandom syscall availability is detected at runtime. So it is
possible that the build is done on a box that supports it but
the run is done on a system with no availability. So a workaround
solution is needed to fix this case.

Also we have seen some issue in docker environment where the build
is detecting getrandom but where it does not work at runtime.

For both reasons, the code is updated to have a call to a fallback
function if ever the getrandom call returns that the syscall is
not available.

7 years agorust: cargo fixes for out of tree build
Jason Ish [Tue, 22 May 2018 18:16:05 +0000 (12:16 -0600)] 
rust: cargo fixes for out of tree build

7 years agopython: fixes for out of tree build
Jason Ish [Mon, 21 May 2018 14:55:19 +0000 (08:55 -0600)] 
python: fixes for out of tree build

Autoconf/automake and python setup.py don't play that well
together with out of tree builds.

Makes suricatasc not an autoconf input file, instead use the
defaults module that is already being created.

In the case of an out of tree build, copy the generated defaults.py
to the build directory manually.

7 years agodoc: spelling mistakes in various sections of the user guide
Pascal Delalande [Tue, 15 May 2018 20:15:16 +0000 (22:15 +0200)] 
doc: spelling mistakes in various sections of the user guide

7 years agoUpdate ntp-parser to 0.2.0 3378/head
Pierre Chifflier [Tue, 15 May 2018 13:33:30 +0000 (15:33 +0200)] 
Update ntp-parser to 0.2.0

7 years agoeve/json/xff - remove check for flow being NULL. 3372/head
Jason Ish [Wed, 9 May 2018 12:50:03 +0000 (06:50 -0600)] 
eve/json/xff - remove check for flow being NULL.

Fix Coverity issue:
** CID 1435535:  Null pointer dereferences  (REVERSE_INULL)
/src/output-json-file.c: 212 in JsonBuildFileInfoRecord()

Where we check a variable for being NULL, when all paths to the
code show that it can't be NULL.

7 years agohtp: cleanup and fix test 3370/head
Victor Julien [Mon, 23 Apr 2018 10:33:02 +0000 (12:33 +0200)] 
htp: cleanup and fix test

7 years agohttp: add tests for header folding
Victor Julien [Thu, 19 Apr 2018 14:31:43 +0000 (16:31 +0200)] 
http: add tests for header folding

To test for https://github.com/OISF/libhtp/issues/159

7 years agohttp: clean up unittest
Victor Julien [Thu, 19 Apr 2018 13:34:51 +0000 (15:34 +0200)] 
http: clean up unittest

7 years agopcap-log: don't divide by 0 on no traffic
Victor Julien [Mon, 7 May 2018 14:20:45 +0000 (16:20 +0200)] 
pcap-log: don't divide by 0 on no traffic

7 years agoeve/alert: use eve-level xff config by default
Jason Ish [Thu, 3 May 2018 18:43:27 +0000 (12:43 -0600)] 
eve/alert: use eve-level xff config by default

The alert section can still have an xff configuration which
will take priority over the eve level xff config.

7 years agoeve/alert: separate xff and metadata configuration
Jason Ish [Thu, 3 May 2018 18:22:33 +0000 (12:22 -0600)] 
eve/alert: separate xff and metadata configuration

Put xff setup and metadata setup into their own
functions.

7 years agoqa/coccinelle: allow to run from non git directory
Jason Ish [Thu, 3 May 2018 17:35:18 +0000 (11:35 -0600)] 
qa/coccinelle: allow to run from non git directory

For example, when I put the contents of a git worktree into
a Docker image for a test build .git will not be a directory
causing the run_check.sh script to fail.

7 years agoeve/files: use eve-level xff config by default
Jason Ish [Thu, 3 May 2018 15:36:34 +0000 (09:36 -0600)] 
eve/files: use eve-level xff config by default

The files section can still have an xff configuration which
will take priority over the eve level xff config.

7 years agoeve/http: use eve-level xff config by default
Jason Ish [Thu, 3 May 2018 15:31:53 +0000 (09:31 -0600)] 
eve/http: use eve-level xff config by default

The http section can still have an xff configuration which
will take priority over the eve level xff config.

7 years agoeve: use eve-level xff configuration
Jason Ish [Thu, 3 May 2018 15:27:53 +0000 (09:27 -0600)] 
eve: use eve-level xff configuration

If an "xff" configuration section exists on the eve object,
parse and save it for child loggers to use.

7 years agoxff: HttpXFFGetCfg - allow conf to be NULL
Jason Ish [Mon, 30 Apr 2018 23:22:02 +0000 (17:22 -0600)] 
xff: HttpXFFGetCfg - allow conf to be NULL

The code fully handles conf being NULL, and we have other functions
where conf can be NULL.

7 years agoxff: Use XFF configuration in eve and filestore
Maurizio Abba [Mon, 15 Jan 2018 15:59:28 +0000 (15:59 +0000)] 
xff: Use XFF configuration in eve and filestore

XFF configuration is already set in app-layer-htp-xff, and in
output-json-alert. Extending XFF configuration to files and HTTP allow
to get the same behavior as for alerts.

Extend the configuration of filestore json to let filestore metafile
dump be aware of xff. This is available only if write-fileinfo is set
to yes and file-store version is 2.

7 years agoFix segfault when the protocol is anything other than HTTP 3368/head
Elazar Broad [Wed, 2 May 2018 16:38:40 +0000 (12:38 -0400)] 
Fix segfault when the protocol is anything other than HTTP

When a file is transferred over anything other than HTTP, the previously hard-coded HTTP protocol would trigger a non-existent index into htp_list_array_get(), causing a segfault. This patch mimics the logic in detect-lua-extensions.c.

7 years agodetect-tls-cert-fingerprint: fix typo in unittest
Mats Klepsland [Sun, 25 Mar 2018 09:54:01 +0000 (11:54 +0200)] 
detect-tls-cert-fingerprint: fix typo in unittest

7 years agodetect-tls-cert-fingerprint: fix failing unittest
Mats Klepsland [Sun, 25 Mar 2018 09:52:29 +0000 (11:52 +0200)] 
detect-tls-cert-fingerprint: fix failing unittest

Fix unittest that failed with the content validation callback.

7 years agodetect-tls-ja3-hash: add setup callback to lowercase content
Mats Klepsland [Sat, 24 Mar 2018 22:16:40 +0000 (23:16 +0100)] 
detect-tls-ja3-hash: add setup callback to lowercase content

Add setup callback that lowercase the content that follows 'ja3_hash'.

7 years agodetect-tls-ja3-hash: add warning if nocase is used
Mats Klepsland [Sat, 24 Mar 2018 22:15:58 +0000 (23:15 +0100)] 
detect-tls-ja3-hash: add warning if nocase is used

7 years agodetect-tls-cert-serial: add warning if nocase is used
Mats Klepsland [Sat, 24 Mar 2018 22:07:04 +0000 (23:07 +0100)] 
detect-tls-cert-serial: add warning if nocase is used

7 years agodetect-tls-cert-fingerprint: add warning if nocase is used
Mats Klepsland [Sat, 24 Mar 2018 22:00:33 +0000 (23:00 +0100)] 
detect-tls-cert-fingerprint: add warning if nocase is used

7 years agodetect-tls-ja3-hash: add content validation callback
Mats Klepsland [Sat, 24 Mar 2018 12:33:52 +0000 (13:33 +0100)] 
detect-tls-ja3-hash: add content validation callback

Validate that the content that follows the 'ja3_hash' keyword has
the correct length.

7 years agodetect-tls-cert-fingerprint: add setup callback to lowercase content
Mats Klepsland [Sat, 24 Mar 2018 12:00:31 +0000 (13:00 +0100)] 
detect-tls-cert-fingerprint: add setup callback to lowercase content

Add setup callback that lowercase the content that follows
'tls_cert_fingerprint'.

7 years agodetect-tls-cert-fingerprint: add content validation callback
Mats Klepsland [Sat, 24 Mar 2018 11:47:48 +0000 (12:47 +0100)] 
detect-tls-cert-fingerprint: add content validation callback

Validate that the content that follows the 'tls_cert_fingerprint'
keyword is on the correct form and has the correct length.

7 years agodetect-tls-cert-serial: add setup callback to uppercase content
Mats Klepsland [Fri, 23 Mar 2018 23:34:49 +0000 (00:34 +0100)] 
detect-tls-cert-serial: add setup callback to uppercase content

Add setup callback that uppercase the content that follows
'tls_cert_serial'.

7 years agodetect-engine: add DetectEngineCtx to setup callback function
Mats Klepsland [Fri, 23 Mar 2018 23:31:25 +0000 (00:31 +0100)] 
detect-engine: add DetectEngineCtx to setup callback function

Add detect engine context as variable to setup callback function
in 'DetectBufferTypeRegisterSetupCallback'.

7 years agodetect-tls-cert-serial: add content validation callback
Mats Klepsland [Fri, 23 Mar 2018 14:53:08 +0000 (15:53 +0100)] 
detect-tls-cert-serial: add content validation callback

Validate that the content that follows the 'tls_cert_serial' keyword
is on the correct form. If it's longer than two bytes it should be
separated by colons.

7 years agoAdd info about pcap log compression to user guide
Max Fillinger [Thu, 25 Jan 2018 12:54:58 +0000 (13:54 +0100)] 
Add info about pcap log compression to user guide

7 years agoconfigure: Show installation info for liblz4 if not found
Max Fillinger [Thu, 15 Feb 2018 14:57:51 +0000 (15:57 +0100)] 
configure: Show installation info for liblz4 if not found