Commit graph

9059 commits

Author SHA1 Message Date
Justin Azoff
bbcf95dca4 problem: default snaplen is too small for jumbo frames
Jumbo frames start at 9000 bytes and can be up to 9216 bytes
2017-09-20 15:31:06 -04:00
Jon Siwek
8403fd9f94 Updating CHANGES and VERSION. 2017-09-20 11:04:04 -05:00
Jon Siwek
4ec7d66468 Updating submodule(s).
[nomail]
2017-09-20 10:51:09 -05:00
Johanna Amann
ed678dd72c Add -B scripts flag to allow debug output of script load order.
This patch adds a "scripts" option to -B, when Bro is enabled with
--enable-debug. This option will output information about the scripts
that are loaded to debug.log, showing their exact load order.
2017-09-19 09:38:08 -07:00
Johanna Amann
5243a054ef Fix segmentation fault on eval condition with no return value.
Signatures using an eval-condition that had no return value caused a
segmentation fault. This fix just returns false in this case, as it is
done for an interpreter error.
2017-09-19 09:23:09 -07:00
Johanna Amann
fc33bf2014 Make strerror_r portable.
This uses the same code that broker already uses to determine if we use
the XSI or gnu version of strerror_r. Patch by Thomas Petersen.
2017-09-18 14:50:30 -07:00
Johanna Amann
2a873f5aed Prevent crash when calling bro -U [unwritable destination]
set_processing_status can be called before reporter is initialized or
after it is deleted. Work around by sending data to stderr instead.

Patch by Thomas Petersen.
2017-09-18 14:33:22 -07:00
Johanna Amann
c1f8e3baec Remove annoying error message from connsize bifs.
The connsize bifs used to output a reporter message when they could not
find the associated connection. This patch disables this message; it is
not useful and can happen during normal operation when trying to use
thresholding on short-lived connections. This case is still reported by
the boolean value that the respective functions return.
2017-09-18 14:07:12 -07:00
Johanna Amann
a4d25c8828 Make "in" keyword work with binary data.
This switches in from using strstr to use strnstr (implementation from
FreeBSD on systems which do not bring their own implementation).

It is especially likely that users come accross this when using the
DATA_EVENT analyzer with files that contain binary data - the test uses
exactly this case.
2017-09-18 12:12:38 -07:00
jrolli
45ee32db49 Added and verified correct test results 2017-09-17 21:25:59 +00:00
John E. Rollinson
9ad93a5077 Initial btest structure 2017-09-17 16:13:10 -04:00
John E. Rollinson
5afde3f0e5 Changes proposed in #104 2017-09-17 14:59:41 -04:00
Vlad Grigorescu
16f504e828 Merge remote-tracking branch 'origin/master' into topic/vladg/bit-1838 2017-09-15 20:34:41 -05:00
Vlad Grigorescu
7e374f8c3f Updates the SSH analyzer to support the "curve25519-sha256" KEX.
From the OpenSSH 7.4 changelog:

sshd(8), ssh(1): Support the "curve25519-sha256" key exchange
   method. This is identical to the currently-supported method named
   "curve25519-sha256@libssh.org".
2017-09-15 20:30:39 -05:00
Johanna Amann
6ffa99d67e Merge remote-tracking branch 'origin/topic/dnthayer/ticket1836'
* origin/topic/dnthayer/ticket1836:
  Add test to verify that log rotation works with gzipped logs
  Fix ascii writer to not discard a ".gz" file extension

BIT-1836 #close
2017-09-15 10:57:06 -07:00
Daniel Thayer
75647a448c Add test to verify that log rotation works with gzipped logs 2017-09-15 12:17:31 -05:00
Johanna Amann
1e66034862 Merge branch 'master' of https://github.com/amesbury/bro
* 'master' of https://github.com/amesbury/bro:
  Fixed typo
2017-09-12 16:29:36 -05:00
Johanna Amann
1a6b6f2586 Updating CHANGES and VERSION. 2017-09-11 21:02:07 -05:00
Johanna Amann
e1997144c2 Fix small OCSP parser bug.
It turns out that the serial number field in all events was never
populated correctly. Instead, the previous field (issuer key hash) was
re-read and repeated in all events.
2017-09-11 09:26:33 -07:00
Johanna Amann
1ede6bf7fe Add TLS 1.3 fix and testcase.
It turns out that Chrome supports an experimental mode to support TLS
1.3, which uses a non-standard way to negotiate TLS 1.3 with a server.
This non-standard way to negotiate TLS 1.3 breaks the current draft RFC
and re-uses an extension on the server-side with a different binary
formatting, causing us to throw a binpac exception.

This patch ignores the extension when sent by the server, continuing to
correctly parse the server_hello reply (as far as possible).

From what I can tell this seems to be google working around the fact
that MITM equipment cannot deal with TLS 1.3 server hellos; this change
makes the fact that TLS 1.3 is used completely opaque unless one looks
into a few extensions.

We currently log this as TLS 1.2.
2017-09-09 22:25:49 -07:00
Nate Guagenti
5a526a5f4f Update main.bro
The HTTP "Origin" header is a useful header for CSRF, Chrome plugins making requests, and other scenarios where referrer may not be present.
Reference:
https://tools.ietf.org/html/rfc6454#section-7  ---- "In some sense, the origin granularity is a historical artifact of how the security model evolved."
Especially useful if origin/referrer is a "file://" ---- https://tools.ietf.org/html/rfc6454#section-4
2017-09-05 19:33:20 -04:00
Alan
8741d6323a Fixed typo 2017-08-28 14:20:37 -05:00
Daniel Thayer
823fba1713 Fix ascii writer to not discard a ".gz" file extension
When Bro writes a compressed log, it uses a file extension of ".gz".
However, upon log rotation the ascii writer script function
"default_rotation_postprocessor_func" was discarding the ".gz"
file extension.  Fixed so that the correct file extension is
preserved after rotation.
2017-08-25 15:39:12 -05:00
Robin Sommer
5efaaf1368 Merge remote-tracking branch 'origin/fastpath' 2017-08-15 16:58:17 -07:00
Jon Siwek
fcd735cecd Fix core.truncation unit test on macOS.
The pcap file format has a global header and a header per packet.  The
global header of the pcap in question had a snaplen of 1, but with
packet headers indicating the full number of bytes saved within the
file.  It seems like the pcap file must of been artifically edited in
order for it to be this way.

When reporting the captured length of a packet, Apple's version of
libpcap now seems to report the full number of bytes saved within the
pcap's per-packet headers, but other versions seem to report the snaplen
from the global pcap header.  This caused the core.truncation test to
behave differently on macOS from other platforms.

I've manually hexedit'd the pcap so that the snaplen is still 1, but
contains just a single packet with a pcap header indicating a length of
8, which is less than the size of the link layer header and so should
still test the original code path that the unit test intended to
exercise.
2017-08-11 14:03:06 -05:00
Daniel Thayer
7127800791 Fix the expire-redef.bro test
The expire-redef.bro test was sometimes failing due to the second "Run"
message being printed after (should happen before) the "Expired"
message.  Fixed by increasing the time interval between events.

Also reduced the number of events raised to make the test finish more
quickly.
2017-08-10 14:15:31 -05:00
Johanna Amann
bb14765e08 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix a netcontrol test that often fails
2017-08-08 13:26:20 -07:00
Daniel Thayer
c251245538 Fix a netcontrol test that often fails
The catch-and-release.bro test was failing whenever three conditions
were all true:  sorting the netcontrol.log before comparing to
the baseline, the presence of LC_ALL=C in btest.cfg changes the sort
order, and sometimes the timestamp increases slightly beginning
with one of the rule_id == 5 lines.

As a result of these three conditions, the sorted order of the lines
with rule_id of 5 were different than the baseline.

Fixed by not sorting netcontrol.log, as this doesn't seem necessary.
2017-08-07 16:26:17 -05:00
Robin Sommer
09486c9062 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Update install instructions for Fedora 26
2017-08-07 07:42:04 -07:00
Robin Sommer
6ba710fbf7 Updating CHANGES, NEWS, and VERSION. 2017-08-04 15:09:51 -07:00
Robin Sommer
b950145c13 Merge branch 'master' of git.bro.org:bro 2017-08-04 14:17:10 -07:00
Robin Sommer
0b5894ce23 Merge remote-tracking branch 'origin/topic/johanna/ocsp-sct-validate'
* origin/topic/johanna/ocsp-sct-validate:
  SSL SCT/OCSP: small fixes by robin; mostly update comments.
2017-08-04 13:28:08 -07:00
Johanna Amann
eab80c8834 HTTP: Recognize and skip upgrade/websocket connections.
This adds a slight patch to the HTTP analyzer, which recognizez when a connection is
upgraded to a different protocol (using a 101 reply with a few specific headers being
set).

In this case, the analyzer stops further processing of the connection (which will
result in DPD errors) and raises a new event:

event http_connection_upgrade(c: connection, protocol: string);

Protocol contains the name of the protocol that is being upgraded to, as specified in
one of the header values.
2017-08-04 07:04:28 -07:00
Johanna Amann
d5678418da SSL SCT/OCSP: small fixes by robin; mostly update comments.
SetMime now only works on the first call (as it was documented) and
unused code was used from one of the x.509 functions.
2017-08-01 16:30:08 -07:00
Daniel Thayer
7242aada0c Update install instructions for Fedora 26 2017-08-01 15:54:26 -05:00
Seth Hall
dbac2b1abb Addresses BIT-1831
There is apparently some situation where a field wasn't being populated
which resulted in a reporter messsage.

Thanks to the report from Chris Herdt!
2017-08-01 16:24:44 -04:00
Robin Sommer
faa4150154 Merge remote-tracking branch 'origin/topic/johanna/ocsp-sct-validate'
Closes #1830.

* origin/topic/johanna/ocsp-sct-validate: (82 commits)
  Tiny script changes for SSL.
  Update CT Log list
  SSL: Update OCSP/SCT scripts and documentation.
  Revert "add parameter 'status_type' to event ssl_stapled_ocsp"
  Revert "parse multiple OCSP stapling responses"
  SCT: Fix script error when mime type of file unknown.
  SCT: another memory leak in SCT parsing.
  SCT validation: fix small memory leak (public keys were not freed)
  Change end-of-connection handling for validation
  OCSP/TLS/SCT: Fix a number of test failures.
  SCT Validate: make caching a bit less aggressive.
  SSL: Fix type of ssl validation result
  TLS-SCT: compile on old versions of OpenSSL (1.0.1...)
  SCT: Add caching support for validation
  SCT: Add signed certificate timestamp validation script.
  SCT: Allow verification of SCTs in Certs.
  SCT: only compare correct OID/NID for Cert/OCSP.
  SCT: add validation of proofs for extensions and OCSP.
  SCT: pass timestamp as uint64 instead of time
  Add CT log information to Bro
  ...
2017-07-30 08:49:41 -07:00
Robin Sommer
310ef6974f Small fix to revert to double-% handling in HTTP back to old behaviour. 2017-07-28 12:22:54 -07:00
Robin Sommer
a85a2821d7 Updating submodule(s).
[nomail]
2017-07-28 10:09:39 -07:00
Robin Sommer
c609177cf0 Merge remote-tracking branch 'origin/topic/johanna/http-percent'
* origin/topic/johanna/http-percent:
  Better handling of % at end of line.
2017-07-28 10:06:51 -07:00
Johanna Amann
3bb05693d9 Add canonifier to catch and release test that should fix test failures. 2017-07-28 09:40:58 -07:00
Johanna Amann
db15773c09 Tiny script changes for SSL.
log-hostcerts-only relied on old event ordering; the identifier key of
validate-certs is now shorter (no function change, just potentially a
tiny bit faster).
2017-07-28 09:21:35 -07:00
Johanna Amann
ade9aa219b Better handling of % at end of line. 2017-07-27 22:04:47 -07:00
Johanna Amann
5acbccf444 Update CT Log list 2017-07-27 17:07:22 -07:00
Johanna Amann
9594f69598 SSL: Update OCSP/SCT scripts and documentation. 2017-07-27 16:22:40 -07:00
Johanna Amann
9126376581 Revert "add parameter 'status_type' to event ssl_stapled_ocsp"
This reverts commit 545848d906.

Revert further part of stapled OCSP response handling that probably
never worked.
2017-07-27 15:12:19 -07:00
Johanna Amann
0d97e5451d Revert "parse multiple OCSP stapling responses"
This reverts commit 07891b3b66.

I suspect this never really was correctly implemented and just breaks
all scripts.
2017-07-27 15:09:54 -07:00
Johanna Amann
924482d540 Merge remote-tracking branch 'origin/master' into topic/johanna/ocsp-sct-validate 2017-07-27 14:24:48 -07:00
Johanna Amann
089f87d8da Merge remote-tracking branch 'origin/topic/robin/plugin-version-check'
I added another small change - since we are inlining Configure(), we can
just set bro_plugin directly to BRO_PLUGIN_BRO_VERSION in
src/plugin/Plugin.h, instead of depending on the plugin to do it. This
also means we do not need to change init-plugin in bro-aux at this
moment.

BIT-1828 #closed

* origin/topic/robin/plugin-version-check:
  Adding plugin API number into versioned function name, and removing old runtime API version check.
  Extend plugin infrastructure to catch Bro version mismatches at link time.
2017-07-25 16:14:49 -07:00
Robin Sommer
78f8ff432f Adding plugin API number into versioned function name, and removing
old runtime API version check.
2017-07-21 13:25:56 -07:00