Commit graph

7932 commits

Author SHA1 Message Date
Pierre LALET
8315aa36a6 Add bad ARP tests
The capture file (btest/Traces/arp-leak.pcap) contains the
exploitation of an ARP leak flaw against NetBSD 7.0.2 using Scapy
etherleak() function.
2018-05-18 17:39:53 +02:00
Jon Siwek
99a417fc07 Update test baseline for optimized binpac static-size array parsing 2018-05-18 10:34:06 -05:00
Jon Siwek
954e7980cf Fixes for MySQL and SMB protocol parsers
* MySQL: the parser for this was generally broken (not following
  the specification well) and needed many changes.  One addition is a
  new "mysql_result_row" event that provides access to the results of
  queries.

* SMB: the spec seems to explitly call out the omission of the
  PrimaryDomain field on SMB_COM_SESSION_SETUP_ANDX responses (and I
  don't see that field in pcaps either), so this may have just been a
  typo that used to work fine in the past only due to faulty array
  parsing behavior in binpac.
2018-05-18 10:31:36 -05:00
Pierre LALET
cc4605c8ae Tests/ARP: fix capture files.
It seems the wrong ones were selected in a merge conflict (see
d5797d8).
2018-05-18 17:25:55 +02:00
Jon Siwek
9c1e20394b BIT-1829: add unit test for modbus parser issue 2018-05-18 09:24:06 -05:00
Seth Hall
7ffc162383 Merge branch 'master' of ssh://git.bro-ids.org/bro 2018-05-18 09:52:37 -04:00
Seth Hall
d5797d8bde Merge branch 'p-l--topic/support-wlan-monitor'
# Conflicts:
#	testing/btest/Traces/arp-who-has-radiotap.pcap
#	testing/btest/Traces/arp-who-has-wlanmon.pcap
2018-05-18 09:52:28 -04:00
Johanna Amann
2b24e04ada Add non-standard experimental Google post-quantum ciphers 2018-05-17 15:54:48 -07:00
Pierre LALET
ab73946289 ARP: fix the l2 source address check
ARP_Analyzer::NextPacket() incorrectly assumed that the MAC source
address was at data+6 (which is fine for classical ARP over Ethernet
frames but incorrect for ARP over Wi-Fi for example) and the
destination was at data.

Use pkt->l2_src and pkt->l2_dst instead, set by Packet::ProcessLayer2().
2018-05-16 00:59:29 +02:00
Pierre LALET
0944747bab Add tests for ARP in 802.11 (w & w/o RadioTAP) 2018-05-16 00:21:20 +02:00
Seth Hall
09d283f7ed Merge branch 'topic/support-wlan-monitor' of https://github.com/p-l-/bro 2018-05-15 13:35:20 -04:00
Seth Hall
f2b4c16dd5 Merge branch 'p-l--topic/support-wlan-monitor' 2018-05-15 13:32:34 -04:00
Pierre LALET
a7fb278710 Add tests for ARP in 802.11 (w & w/o RadioTAP) 2018-05-15 18:15:17 +02:00
Pierre LALET
dfa392bd6c Add a test for 802.11 monitor mode 2018-05-15 17:59:26 +02:00
Pierre LALET
30c28da046 Support 802.11 monitor mode 2018-05-15 14:08:48 +02:00
Jon Siwek
057c982b9d Merge branch 'BIT-1927' of https://github.com/hosom/bro
* 'BIT-1927' of https://github.com/hosom/bro:
  Fix for BIT-1927: notice/extend-email relocation

And updated coverage unit tests.

BIT-1927 #close
2018-05-10 11:28:08 -05:00
Jon Siwek
623fb9d5c5 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Sort output of the missing-file-initially.bro test
2018-05-10 11:02:29 -05:00
Julien Wallior
54ef1083bc Make linking against libkrb5 optional based on whether it is installed
on the system or not.
2018-05-10 10:15:08 -04:00
Julien Wallior
afac2ac20f Add krb unit test 2018-05-10 10:14:30 -04:00
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
Stephen Hosom
6611d28920 Fix for BIT-1927: notice/extend-email relocation
This is a fairly straightforward change. Previously, users had no
control over whether this script was loaded. By relocating it to
policy, users can now choose whether or not this is necessary
functionality without modifying core Bro scripts.
2018-05-10 09:13:52 -04:00
Daniel Thayer
075edbdd2b Sort output of the missing-file-initially.bro test
The output needs to be sorted to ensure that the test doesn't fail.
2018-05-09 14:30:22 -05: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