Commit graph

7653 commits

Author SHA1 Message Date
Julien Wallior
ae7625bb2b Fix base.protocols.krb.kinit unit test. 2018-05-10 10:14:30 -04:00
Julien Wallior
98a430c1eb Decrypt the krb ticket and send authentication data out. 2018-05-10 10:14:30 -04:00
Jon Siwek
1f777b57b8 BIT-1926: add unit tests for misc. HTTP patches 2018-05-08 15:39:27 -05:00
Jon Siwek
e5d5cf9ff1 Fix case insensitive HTTP/MIME header name comparisons
Since the function was never used to check for anything other than
equality, I've changed it to return a bool, otherwise the changes to
its implementation are based on a patch submitted by Jeffrey Bencteux:

Function was comparing two strings based on the length of a user
provided string which could lead to evasions. Any prefix of the static
string could pass conditions where strcasecmp_n was used. Comparison
is now based on the static string length and lengths are checked
before calling strncasecmp.
2018-05-08 15:29:53 -05:00
jbencteux
ec4a936f66 fix using chunked mode with HTTP/1.0
According to RFC 7230, Transfer-Encoding was added in HTTP/1.1. Such a
header in a HTTP/1.0 message should be ignored. Interpreting it can be
harmful when sending a HTTP/1.0 message because the parser would
indefinitely wait for a chunk size instead of parsing the message's
body as non-chunked, leading to a HTTP content evasion.
2018-05-08 15:29:53 -05:00
Jon Siwek
2e2d086144 Fix previous content-length != content-range patch
In the case where no Content-Length header is seen, the content_length
value still should be set based upon the range (same as it would
have been before the patch).
2018-05-08 15:29:53 -05:00
jbencteux
c0cc4ef192 fix handling of HTTP body length
Partial content bytes range length value and content length value
should not be stored in the same variable. An attacker could override
a given Content-Length or Content-Range with a smaller value to
evade HTTP content.
2018-05-08 15:29:53 -05:00
jbencteux
2a01c70837 fix Content-Encoding: x-gzip
RFC 7230 section 4.2.3 states that:

"A recipient SHOULD consider 'x-gzip' to be equivalent to 'gzip'"

This could lead to evasions as an attacker could use:

Content-Encoding: x-gzip

To bypass Bro's decompression.
2018-05-08 15:29:53 -05:00
Johanna Amann
bb20026267 Add test for dump_current_packet bif. 2018-05-08 11:24:38 -07:00
Johanna Amann
0f9ff2879d Merge branch 'patch-1' of https://github.com/assafmo/bro
* 'patch-1' of https://github.com/assafmo/bro:
  dump_packet & dump_current_packet better detect which file is being dumped to
  Fix dump_packet & dump_current_packet ignores file_name
2018-05-08 11:21:50 -07:00
Johanna Amann
10441807ff Update submodule
[nomail]
2018-05-08 10:50:34 -07:00
Jon Siwek
f8f29ecf6e Updating submodule(s).
[nomail]
2018-05-08 10:13:11 -05:00
Assaf Morami
1953c04581
dump_packet & dump_current_packet better detect which file is being dumped to 2018-05-08 17:36:17 +03:00
Assaf Morami
f35eae2e7e
Fix dump_packet & dump_current_packet ignores file_name
This fixes an issue where `dump_packet` and `dump_current_packet` ignores the `file_name` parameter if `addl_pkt_dumper` is already pointing to some file (doesn't matter which file...)

http://mailman.icsi.berkeley.edu/pipermail/bro/2018-May/013184.html
2018-05-08 15:46:18 +03:00
Jon Siwek
091d1e163f Merge remote-tracking branch 'origin/topic/vladg/fix_binpac_proto_violation'
* origin/topic/vladg/fix_binpac_proto_violation:
  Make BinPAC exception handling more consistent

BIT-1930 #merged
2018-05-03 15:00:20 -05:00
Vlad Grigorescu
ceab58c17e Make BinPAC exception handling more consistent 2018-05-02 15:39:43 -05:00
Jon Siwek
5572d05921 Merge remote-tracking branch 'origin/topic/dnthayer/test-improvements'
* origin/topic/dnthayer/test-improvements:
  Fix the ip-broken-header.bro test on macOS
  Improve reliability of the logging rotate.bro test
  Improve reliability of missing-file-initially.bro test

BIT-1929 #merged
2018-05-01 18:29:59 -05:00
Jon Siwek
d5ff658f06 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Update install instructions for Ubuntu 18.04
2018-05-01 18:17:36 -05:00
Jon Siwek
c859919f31 Improve canonicalization of build dir path in a coverage unit test 2018-05-01 18:10:11 -05:00
Jon Siwek
81133f3116 Merge remote-tracking branch 'origin/topic/seth/dhcp-update'
* origin/topic/seth/dhcp-update:
  Rework to the DHCP analyzer.
  First step of DHCP analyzer rearchitecture.
  Add .btest scripts for dhck_ack and dhcp_discover messages verifying that new options are correctly reported in dhcp.log records.
  Extend DHCP protocol analyzer with new options.

BIT-1924 #merged

Additional changes:

* Removed known-hosts.bro as the only thing populating its table was
  the already-removed known-hosts-and-devices.bro.  So a
  known_devices.log will no longer be generated.

* In dhcp-options.pac, the process_relay_agent_inf_option had a memleak
  and also process_auto_proxy_config_option looked like it accessed one
  byte past the end of the available bytestring, so fixed those.
2018-05-01 18:06:41 -05:00
Daniel Thayer
1d98a99ccf Update install instructions for Ubuntu 18.04 2018-05-01 15:24:52 -05:00
Jon Siwek
a91da7021d Updating submodule(s).
[nomail]
2018-04-30 16:50:29 -05:00
Jon Siwek
60e943322f Merge remote-tracking branch 'origin/topic/johanna/openssl-fixes'
* origin/topic/johanna/openssl-fixes:
  Change ordering of include directories.

BIT-1928 #merged
2018-04-30 16:48:22 -05:00
Jon Siwek
720cf55d53 Improve how coverage unit tests handle name of build dir
This change allows the tests to still pass if the build dir is named
something other than 'build' and/or is a symlink.
2018-04-30 16:30:21 -05:00
Johanna Amann
d3180fff6d Change ordering of include directories.
It turns out that --with-openssl does not currently work because even
when the correct library is chosen, the include path ordering will
(typically) cause the system OpenSSL to be included.

Push OpenSSL header directory as the highest priority one. This probably
also makes sense since OpenSSL is/will be one of the most common
libraries that needs specific include directories.
2018-04-30 15:36:10 -04:00
Seth Hall
effc72ba0b Merge branch 'topic/seth/intel-fix-subnet-expiration' 2018-04-27 20:01:24 -04:00
Seth Hall
c973375f1f Add subnet intel expiration to a test. 2018-04-27 19:55:22 -04:00
Seth Hall
e5e1037e91 Fix subnet expiration in the intel framework. 2018-04-27 16:42:19 -04:00
Robin Sommer
cb5a867cf1 Updating submodule(s).
[nomail]
2018-04-27 10:50:00 -07:00
Robin Sommer
8df77aee09 Merge remote-tracking branch 'origin/topic/jsiwek/bit-1909'
I've moved the resizing loop into a static method of RecordVal.

* origin/topic/jsiwek/bit-1909:
  BIT-1909: fix invalid redef'd record field accesses
2018-04-27 10:35:37 -07:00
Jon Siwek
2799713a89 Updating submodule(s).
[nomail]
2018-04-27 11:13:38 -05:00
Jon Siwek
4e9a8e02e0 BIT-1430: Improve cross compilation support
* Add --toolchain= configure option

* Add --with-bifcl= configure option

* Change --with-binpac= configure option to mean "path to binpac
  executable"

* Add an example of how to use the above options for cross compiling
  Bro to the docs
2018-04-27 11:04:31 -05:00
Jon Siwek
19389ad350 Merge remote-tracking branch 'origin/topic/jsiwek/bit-1914'
* origin/topic/jsiwek/bit-1914:
  BIT-1914: comment out &check usages now that they emit warnings
  Convert some BinPAC &check expressions to &enforce
  Update &check'd fields in various protocol parsers

BIT-1914 #merged
2018-04-25 11:09:43 -05:00
Jon Siwek
89b2e6cd77 Merge branch 'patch-1' of https://github.com/lmammino/bro
* 'patch-1' of https://github.com/lmammino/bro:
  Update consts.bro
2018-04-25 10:50:44 -05:00
Luciano Mammino
ff84e4faa3
Update consts.bro
Removed duplicated entries (`000001a0-0000-0000-c000-000000000046`, with `i=3, i=4`) and related comments line

This change should make this file more readable and it will be easier to convert it to other formats (personally I found it out while I was trying to convert this to a JavaScript structure).
2018-04-25 16:25:34 +01:00
Jon Siwek
b97abd3798 Updating submodule(s).
[nomail]
2018-04-24 13:02:55 -05:00
Daniel Thayer
27a7276009 Fix the ip-broken-header.bro test on macOS
There is no xzcat command on macOS by default.
2018-04-23 17:06:01 -05:00
Daniel Thayer
6600556f51 Improve reliability of the logging rotate.bro test
Occasionally a few lines in the first part of the output file were
not in the expected order (this seems to be caused by each line in the
output being created by a process that is run in the background but
bro doesn't wait for it to finish).  Fixed by sorting the output.
2018-04-23 12:31:59 -05:00
Daniel Thayer
e16cc13667 Improve reliability of missing-file-initially.bro test
This test has failed numerous times on Travis CI.  Fixes to make this
test more reliable:  create the does-not-exist.dat file atomically, and
increase wait time after starting bro in order to give all input
streams a chance to try to read the input file.

Also added the input stream name to the test output, in order to make
output easier to understand if the test fails again.
2018-04-23 12:26:16 -05:00
Robin Sommer
135fa9dc69 Updating submodule(s).
[nomail]
2018-04-20 07:47:10 -07:00
Robin Sommer
0cc8436eee Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Reduce number of btest threads running tests on Travis CI
2018-04-20 07:45:57 -07:00
Daniel Thayer
b23029a09d Reduce number of btest threads running tests on Travis CI
On Travis CI, btest was using 32 threads when running with "-j".  Reducing
this to "-j 4" seems to make the tests run a bit faster overall and
somewhat reduces the number of test failures.
2018-04-20 09:30:06 -05:00
Jon Siwek
f1dee42125 BIT-1914: comment out &check usages now that they emit warnings 2018-04-19 17:12:04 -05:00
Jon Siwek
708a7136f6 Convert some BinPAC &check expressions to &enforce
These checks for the DCE/RPC version and DNP3 'start' fields look
correct.
2018-04-19 14:07:40 -05:00
Jon Siwek
e2b48ceb80 Updating submodule(s).
[nomail]
2018-04-19 11:56:57 -05:00
Jon Siwek
10b1857a9c Update &check'd fields in various protocol parsers
* The altered Modbus checks seemed overly strict -- the pcap used
  for the unit test at least had quantities/byte_count fields of
  zero, to which the server responds with an error (expected).

* Most of the altered DNP3 checks seemed overly strict and caused
  the unit tests to fail.  The one that was just wrong was the
  'start' field in header blocks.

* Removed the "start" parameter of the dnp3_header_block event
  since it's always the same value.

* The SMB check failed to compile and I don't know what it intended
  to do, so removed.
2018-04-18 18:16:34 -05:00
Jon Siwek
eb0c989ab3 Improve std::map usages in SMB code
Removed redundant lookup operations
2018-04-18 11:46:38 -05:00
Jon Siwek
55a925db96 Improve HLL cardinality estimate unit test.
The test could fail on the order of 100s of iterations, so I bumped to
desired accuracy to actually check for results that are outside the
error margin.
2018-04-18 10:55:37 -05:00
Jon Siwek
181b36cafb Merge remote-tracking branch 'origin/topic/seth/smb-pending-fix'
* origin/topic/seth/smb-pending-fix:
  Updating the defined SMB2 dialects to match Microsofts current docs.
  On rare occasions the server doesn't return the tree id on read responses.
  Fix an issue with pending commands.

BIT-1862 #merged
2018-04-18 10:48:03 -05:00
Johanna Amann
0747080e5f Merge branch 'Reporter/MessageFix' of https://github.com/catenacyber/bro
* 'Reporter/MessageFix' of https://github.com/catenacyber/bro:
  Better reporter for Brostring with embedded NUL

I slightly changed the code for beautification purposes and added a
testcase. No functional changes.
2018-04-16 10:58:45 -07:00