Commit graph

11634 commits

Author SHA1 Message Date
Jon Siwek
8b9d525097 Update external test suite commit hash 2019-02-26 15:09:32 -06:00
mauro
b6aa0b9d72 added more options to SMB2 set-info command 2019-02-26 15:11:59 +01:00
Jon Siwek
53dc1176b7 GH-281: Improve parsing of Google Pixel user agent
Fixes GH-281
2019-02-25 14:07:53 -06:00
Jon Siwek
74c225c7cb GH-286: Check for record type mismatch in ternary operator
Fixes GH-286
2019-02-25 12:55:03 -06:00
Justin Azoff
8fc83f5fee Remove redundant buffering in contentline
The contentline analyzer has two code paths that buffer data:
 * right at the top of DeliverStream
 * later in DoDeliverOnce

However, contentline can be in plain delivery mode, and if so, the
buffer resize in DeliverStream does not need to be done just because
DeliverStream was passed an 8K data chunk.

This was causing contentline to resize it's buffer to fit chunks of HTTP
response data.  Additionally, the buffer was sized to be 3/2 of the
chunk, so an 8K chunk would result in a 12K allocation.
2019-02-24 11:17:33 -05:00
Justin Azoff
bc1f2a0a63 Avoid buffering all http headers
Only buffer all http headers if the http_all_headers event is in use.
2019-02-23 21:02:51 -05:00
Jon Siwek
a342090f18 Merge remote-tracking branch 'origin/topic/johanna/input-whitespace'
* origin/topic/johanna/input-whitespace:
  Be more liberal with whitespaces for ip-addresses, subnets, etc.
2019-02-22 14:58:43 -06:00
Jon Siwek
9345ff346a Add missing libkrb5 include dir to CMake config 2019-02-22 14:35:54 -06:00
mauro
a346b01a85 clean up, test and pcap for transform_header added 2019-02-21 12:01:02 +01:00
mauro
f1cdae2829 added smb2-com-transform-header for smb3.x 2019-02-21 09:53:32 +01:00
Johanna Amann
cb47b37215 Be more liberal with whitespaces for ip-addresses, subnets, etc.
This change ignores leading/trailing whitespaces for a couple of
data-types (bool, port, subnet, addr) and just parses them as if the
whitespace was not present.
2019-02-19 15:06:06 -08:00
Justin Azoff
52dbaef6da Defer initialization of lists and dicts until an item is added.
Instead of pre-allocating every list with space for 10 items, don't
initialize it at all until the first Insert.

Instead of pre-allocating every dictionary with 17 buckets,
don't initialize it at all until the first Insert.
2019-02-18 12:50:22 -05:00
Justin Azoff
ea167846fa update baselines 2019-02-17 12:48:24 -05:00
Justin Azoff
a5ad864e13 Use more efficient method to grab the protocol.
get_conn_transport_proto needs to use sessions->FindConnection and do a
hash lookup to find the connection while get_port_transport_proto just
looks at the port directly.
2019-02-17 12:39:01 -05:00
Justin Azoff
a97cf10d03 improve performance of dns policy
defer allocating various tables until at least 2 pending queries are
seen.
2019-02-17 12:39:01 -05:00
Jon Siwek
aff3f4b3fd Skip autogenerated doc coverage test for Travis pull requests 2019-02-15 17:53:53 -06:00
Jon Siwek
e6e328efb4 Merge branch 'master' of https://github.com/ZekeMedley/zeek
* 'master' of https://github.com/ZekeMedley/zeek:
  lstrip test output cleanup
  implemented rstrip
  add rstrip tests
  cleanup of lstrip function
  added implementation of lstrip
  added tests for lstrip function
2019-02-15 17:51:29 -06:00
Jon Siwek
3131d766fc Updating submodule(s).
[nomail]
2019-02-15 15:26:47 -06:00
Jon Siwek
f69ebe1538 Updating submodule(s).
[nomail]
2019-02-15 14:00:27 -06:00
mauro
84afafc512 added test and pcap files for smb_files.log fix 2019-02-14 16:51:50 +01:00
Zeke Medley
ffbe366646 lstrip test output cleanup 2019-02-14 00:02:41 -08:00
Zeke Medley
60507545d8 implemented rstrip 2019-02-13 23:55:48 -08:00
Zeke Medley
8ac53a5fae add rstrip tests 2019-02-13 23:51:27 -08:00
Zeke Medley
a8904adf4f cleanup of lstrip function 2019-02-13 23:24:15 -08:00
Zeke Medley
368e458f47 added implementation of lstrip 2019-02-13 23:19:58 -08:00
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