Commit graph

2399 commits

Author SHA1 Message Date
Jon Siwek
a43c7d0691 Merge remote-tracking branch 'origin/topic/jsiwek/ncp-fixes'
* origin/topic/jsiwek/ncp-fixes:
  Add NCP::max_frame_size tuning option
  Migrate NCP analyzer to use latest analyzer API
2018-06-05 11:32:38 -05:00
Johanna Amann
a891517762 Fix read at invalid address in X509 extension parser.
When encountering an extension unknown to OpenSSL, we would read from
the wrong memory location. Also added a testcase to prevent this specific
case from happening again.
2018-06-04 12:05:56 -07:00
Johanna Amann
791b24d232 Merge remote-tracking branch 'origin/topic/jsiwek/broker-misc'
* origin/topic/jsiwek/broker-misc:
  Add Broker::publish_and_relay BIF
  Document variable argument list BIFs using ellipsis
  Support unserializing broker data into type 'any'
  Fix a bug in broker data type-casting check
  Remove dead code in broker data/val conversion function
2018-06-04 10:00:49 -07:00
Johanna Amann
327acf6555 KRB: do not set keytab by default.
Only enable decryption if a user purposefully sets a keytab.
2018-06-01 12:46:26 -07:00
Johanna Amann
8bb76cd3c1 KRB: do not set authentication info to nouser.
Simply do not set it at all in this case - it is an optional after
all...
2018-06-01 12:32:34 -07:00
Johanna Amann
5d5dd65cab Merge branch 'krb_changes2' of https://github.com/jwallior/bro
I did some cleanup work.
2018-06-01 12:28:45 -07:00
Jon Siwek
55f14c2eb8 Relocate temporary script coverage files
So they don't clutter the top-level of unit test .tmp/ dir.
2018-06-01 11:30:36 -05:00
Johanna Amann
b2dc7ffb26 Merge branch 'smb2-updates' of https://github.com/dtrejod/bro 2018-05-31 21:13:20 -07:00
Johanna Amann
7e801563a0 Merge branch 'topic/p-l-/add-badarp-tests' of https://github.com/p-l-/bro
* 'topic/p-l-/add-badarp-tests' of https://github.com/p-l-/bro:
  Add bad ARP tests
2018-05-31 15:06:33 -07:00
Jon Siwek
224ee790e2 Add Broker::publish_and_relay BIF
Like Broker::relay, except the relaying-node also calls event handlers.
2018-05-31 15:26:22 -05:00
Jon Siwek
d873acc9e3 Support unserializing broker data into type 'any'
The receiver side will wrap the data as a Broker::Data value, which
can then be type-checked/cast via 'is' or 'as' operators to a specific
Bro type.  For example:

Sender:

    Broker::publish("topic", my_event, "hello")

Receiver:

    event my_event(arg: any)
        {
        if ( arg is string )
            print arg as string;
        }
2018-05-31 10:39:40 -05:00
Jon Siwek
fe478877c6 Change Intel framework to round-robin insertion events across proxies 2018-05-24 14:36:22 -05:00
Jon Siwek
b2923f5528 Documentation improvements/fixes 2018-05-23 16:50:31 -05:00
Jon Siwek
58864c358c Add NCP::max_frame_size tuning option
This helps prevent excessive allocations based on message lengths
taken from NCP headers.
2018-05-22 18:27:52 -05:00
Jon Siwek
e35da5f592 Migrate NCP analyzer to use latest analyzer API
It was possibly never updated for newer Analyzer API changes, as simply
attaching the NCP analyzer to a connection would result in null pointer
derefernces and also support analyzers were not attached.
2018-05-22 16:27:07 -05:00
Jon Siwek
de029dd430 Merge remote-tracking branch 'origin/topic/jsiwek/binpac-fixes'
* origin/topic/jsiwek/binpac-fixes:
  Update test baseline for binpac changes
  Update test baseline for optimized binpac static-size array parsing
  Fixes for MySQL and SMB protocol parsers
  BIT-1829: add unit test for modbus parser issue
2018-05-22 15:06:51 -05:00
Jon Siwek
c1871b0f0b Update test baseline for binpac changes 2018-05-22 12:46:30 -05:00
Robin Sommer
fe7e1ee7f0 Merge topic/actor-system throug a squashed commit. 2018-05-18 22:39:23 +00:00
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
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
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
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
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
Johanna Amann
bb20026267 Add test for dump_current_packet bif. 2018-05-08 11:24:38 -07: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
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
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
Seth Hall
c973375f1f Add subnet intel expiration to a test. 2018-04-27 19:55:22 -04: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
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
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
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
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
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
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
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
Jon Siwek
8152508330 BIT-1909: fix invalid redef'd record field accesses 2018-04-11 16:23:26 -05:00
Daniel Thayer
8c91cafad8 Trim the Travis CI build log output
Remove some output from the Travis CI build log to make it easier
to read.

There is an issue with Travis CI when using encrypted environment
variables.  In this case, when btest calls the python function
sys.stdout.isatty() it returns False, which causes btest to output one
line for each test (passed or failed).  As a result, it is difficult to
see at a glance which tests failed.  Switching to btest brief output to
address this issue.
2018-04-05 14:12:24 -05:00