Commit graph

9059 commits

Author SHA1 Message Date
Zeke Medley
f9191d439b added tests for lstrip function 2019-02-13 23:19:31 -08:00
Jon Siwek
8e9dc3c789 Improve format of conn_state docs 2019-02-13 16:15:13 -08:00
mauro
328ab79025 fixing some missing log lines in smb_files.log 2019-02-13 18:03:17 +01:00
mauro
c9cc1a55b9 added test and pcap files for smb 3.1.1 negotiate-response 2019-02-13 17:39:37 +01:00
Ryan Denniston
5262237c3b Add linux netfilter NFLOG capture functionality initial commit
modified GetLinkHeaderSize to support link type
   modified ProcessLayer2 to support NFLOG packets
   expecting out of the box support from libpcap

hacking my way around bpf, bpf is not supported in libpcap (would be easy to implement) but at the moment, throw a warn if applying a filter and short circuit bpf code.

want to ensure this works... commenting out error states.

Fixed SetFilter to properly detect m_matches_anything, which is used by the DLT_NFLOG type to short circuit bpf filters.

Added NFLOG parsing to zeek source, added m_matches_anything flag check for bpf functionality (NFLOG is bpf incompatible, but shouldn't be)
2019-02-12 13:23:50 -08:00
Jon Siwek
0790c1c559 Merge remote-tracking branch 'origin/topic/jsiwek/gh-211'
* origin/topic/jsiwek/gh-211:
  GH-208: change invalid subnet expressions to a runtime error
  GH-211: improve consistency of how scripting errors are handled

Removed the 'allow_init_errors' option.
2019-02-07 10:33:52 -06:00
Jon Siwek
018f687c33 Add validity checking/warnings for Broker messages 2019-02-06 13:19:00 -06:00
mauro
4330b7922c smb3.1.1 additions to negotiate-response command 2019-02-04 17:14:32 +01:00
Johanna Amann
1ee96516e8 Fix crash when using debug.log.
It turns out that bro -B all caused a segmentation fault since the
configuration framework was merged; this is caused by the fact that
calling the global_ids bif interacted poorly with -B all due to
side-effects that caused insertions into the global scope in the
global_ids loop.
2019-01-31 14:34:50 -08:00
Jon Siwek
01a8418d79 GH-208: change invalid subnet expressions to a runtime error
Rather than abort.
2019-01-30 12:01:46 -06:00
Jon Siwek
67484a90fa GH-211: improve consistency of how scripting errors are handled
Scripting errors/mistakes now consistently generate a runtime error
which have the behavior of unwinding the call stack all the way out of
the current event handler.

Before, such errors were not treated consistently and either aborted
the process entirely or emitted a message while continuing to execute
subsequent statements without well-defined behavior (possibly causing
a cascade of errors).

The previous behavior also would only unwind out of the current
function (if within a function body), not out the current event
handler, which is especially problematic for functions that return
a value: the caller is essentially left a mess with no way to deal
with it.

This also changes the behavior of the startup/initialization process
to abort if there's errors during bro_init() rather than continue one
to the main run loop.  The `allow_init_errors` option may change this
new, default behavior.
2019-01-30 11:20:09 -06:00
Jon Siwek
49a30d61cf Fix memory leak due to enum type/val circular references
Introduced in 2982765128
2019-01-29 18:28:13 -06:00
Johanna Amann
2e2f611df5 Merge branch 'master' of https://github.com/hosom/zeek
* 'master' of https://github.com/hosom/zeek:
  Add fuid to SSL:Invalid_Server_Cert notice
2019-01-29 14:52:34 -08:00
Stephen Hosom
e30a02e186 Add fuid to SSL:Invalid_Server_Cert notice
This is a very basid quality of life improvement. It should make it
much easier to find additional information about the certificate
in question.
2019-01-29 13:34:51 -05:00
Jon Siwek
3e2c2a6140 GH-210: improve call stack tracking
Adds tracking of arguments
2019-01-28 14:17:04 -06:00
Jon Siwek
253adfd14b Updating submodule(s).
[nomail]
2019-01-28 10:07:01 -06:00
Jon Siwek
1b2b1b2850 Fix building with LibreSSL again 2019-01-24 17:54:18 -06:00
Johanna Amann
7465bceb7e Merge remote-tracking branch 'origin/topic/jsiwek/gh-167'
* origin/topic/jsiwek/gh-167:
  GH-167: improve error message for unclosed function at EOF
2019-01-24 15:22:42 -08:00
Jon Siwek
7a3ecd76b4 Merge remote-tracking branch 'origin/topic/johanna/md5-fips'
* origin/topic/johanna/md5-fips:
  A few more updates to the digest functions.
  Tell OpenSSL that MD5 is not used for security in order to allow bro to work properly on a FIPS system

I changed a couple places that looked like memory management pitfalls:
moved some cleanup code into the dtors of HashVal derived classes
(seemed like it got stuck in ctors by accident) and also added a
cautionary cleanup in the MIME code.

Plus minor formatting changes.
2019-01-24 17:20:06 -06:00
Jon Siwek
9b43f1d5f4 GH-167: improve error message for unclosed function at EOF 2019-01-24 14:54:39 -06:00
Johanna Amann
51cb4f5051 Merge branch 'stu-h/erspan-testing' of https://github.com/stu-h/zeek
* 'stu-h/erspan-testing' of https://github.com/stu-h/zeek:
  Added ERSPAN III testing
2019-01-24 12:52:29 -08:00
Johanna Amann
ec2d98b382 Merge remote-tracking branch 'origin/master' into topic/johanna/md5-fips 2019-01-24 12:19:17 -08:00
Johanna Amann
86161c85c4 A few more updates to the digest functions.
This builds upon the previous commit to make Zeek compile on FIPS
systems.

This patch makes the changes a bit more aggressive. Instead of having a
number of different hash functions with different return values, we now
standardize on EVP_MD_CTX and just have one set of functions, to which
the hash algorithm that is desired is passed.

On the positive side, this enables us to support a wider range of hash
algorithm (and to easily add to them in the future).

I reimplemented the internal_md5 function - we don't support ebdic
systems in any case.

The md5/sha1 serialization functions are now also tested (I don't think
they were before).
2019-01-24 10:44:28 -08:00
Stu H
5ef70c4df1 Added ERSPAN III testing 2019-01-24 14:05:13 +00:00
Jon Siwek
30138dfbd0 Updating submodule(s).
[nomail]
2019-01-23 14:00:05 -06:00
Johanna Amann
5f0562bb04 Merge remote-tracking branch 'origin/topic/jsiwek/gh-219'
* origin/topic/jsiwek/gh-219:
  GH-219: fix |x| operator int overflow / floating point type inconsistency
2019-01-23 10:05:31 -08:00
Jon Siwek
3256ac7c49 GH-219: fix |x| operator int overflow / floating point type inconsistency
When 'x' is an integral arithmetic expression, it's now coerced to
yield a signed integer before taking the absolute value of it to
prevent the common issue of unsigned integer overflow/wraparound for
values below zero.

Using a time or interval value/expression for 'x' now also yields a
time or interval, respective, from the |x| operation instead of
a double.
2019-01-22 16:42:40 -06:00
Jon Siwek
bebc0fba6d Updating submodule(s).
[nomail]
2019-01-22 15:07:34 -06:00
Johanna Amann
7c892ef7d4 Merge remote-tracking branch 'origin/topic/jsiwek/gh-151'
* origin/topic/jsiwek/gh-151:
  GH-151: fix hash calculation for nested sets
2019-01-22 09:08:14 -08:00
Jon Siwek
d86fb9f87a GH-151: fix hash calculation for nested sets
Hash key construction of nested sets depended on the order in
which their elements are iterated, which varied even between sets
containing equivalent elements.  The iteration order is now sorted
by each element's hash value (or, on collision, by full key) such
that equivalent sets no longer hash differently.
2019-01-18 20:54:22 -06:00
Johanna Amann
ffa6756255 Merge branch 'master' of https://github.com/rbclark/bro into topic/johanna/md5-fips
* 'master' of https://github.com/rbclark/bro:
  Tell OpenSSL that MD5 is not used for security in order to allow bro to work properly on a FIPS system
2019-01-18 15:34:06 -08:00
Johanna Amann
b9702e0f27 Updating CHANGES and VERSION. 2019-01-18 15:20:47 -08:00
Johanna Amann
d4f7dae768 Merge remote-tracking branch 'origin/topic/jsiwek/val_mgr'
* origin/topic/jsiwek/val_mgr:
  Pre-allocate and re-use Vals for bool, int, count, enum and empty string
  Preallocate booleans and small counts

I added a tiny change to CompHash to make sure that nothing messes this
up in the future.
2019-01-18 15:17:34 -08:00
Jon Siwek
5618b21cca Improve ERSPAN Type III support
Added check for the optional sub-header in ERSPAN Type III as well
as additional truncation checks to the GRE parsing logic in general.
Also added a unit test for ERSPAN Type II.
2019-01-17 18:06:10 -06:00
Jon Siwek
995e67147a Merge branch 'stu-h/erspan' of https://github.com/stu-h/zeek
* 'stu-h/erspan' of https://github.com/stu-h/zeek:
  Implement ERSPAN type II and ERSPAN type III support
2019-01-17 18:01:21 -06:00
Jon Siwek
2ff746fea7 Change doc/ subdir into a git submodule
The docs now live at https://github.com/zeek/zeek-docs
2019-01-17 14:15:45 -06:00
Jon Siwek
0d685efbf5 Add Broker::peer_counts_as_iosource option
Disabling this option allows one to read pcaps, but still initiate
Broker peerings and automatically exit when done processing the pcap
file.  The default behavior would normally cause Broker::peer() to
prevent shutting the process down even after done reading the pcap.
2019-01-16 19:03:35 -06:00
Jon Siwek
5eab9b9d47 Merge branch 'patch-1' of https://github.com/fatemabw/zeek
* 'patch-1' of https://github.com/fatemabw/zeek:
  Patch for the Revoked bit set in DNSKEY Flag
2019-01-16 11:19:59 -06:00
Jon Siwek
5062f45d94 Updating submodule(s).
[nomail]
2019-01-16 09:39:05 -06:00
Fatema BW
ac0ded1e0a
Patch for the Revoked bit set in DNSKEY Flag
A patch to parse the Revoked KSK flag combination in DNSKEY RR.
2019-01-15 17:38:43 -05:00
Jon Siwek
39b1d49fc3 GH-170: fix segfault triggered by invalid pattern symbols
Fixes GH-170
2019-01-15 14:29:25 -06:00
Jon Siwek
6eee5ded61 GH-172: fix broxygen not merging bif and script identifier comments
Fixes GH-172
2019-01-15 12:13:32 -06:00
Jon Siwek
12f3ab303b Improve unit test for reporter shutdown order 2019-01-15 10:32:13 -06:00
Jon Siwek
ed1a50ec5b GH-213: change type of vector for-loop index to a count 2019-01-14 18:04:30 -06:00
Jon Siwek
89da20339d Updating submodule(s).
[nomail]
2019-01-14 17:53:46 -06:00
Jon Siwek
3a2cdcf834 Updating submodule(s).
[nomail]
2019-01-14 16:22:09 -06:00
Jon Siwek
2f33245b35 GH-205: prioritize use of sigaction() over sigset() 2019-01-14 16:12:38 -06:00
Jon Siwek
38cb3dbf2e GH-188: fix crash when shutting down with pending reporter errors
This fixes some use-after-free issues in the shutdown order of
various systems: I/O, plugin, logging, and reporter systems may
interact during shutdown if there's errors emitted (or maybe just
still pending) during the shutdown.

Fixes GH-188
2019-01-14 15:40:17 -06:00
Jon Siwek
766b1d9520 Fix compiler warning in DNS analyzer
Switch statement compared values from different enum types
2019-01-14 14:50:32 -06:00
Jon Siwek
399660c9eb GH-162: fix segfault when &expire_func is missing a return value
Fixes GH-162
2019-01-14 14:21:17 -06:00