Commit graph

2154 commits

Author SHA1 Message Date
Daniel Thayer
53d05fb24f Update a test baseline
The number of lines in scripts/base/frameworks/intel/main.bro changed
recently.
2016-11-14 14:59:19 -06:00
Johanna Amann
c92060a8ca Merge remote-tracking branch 'origin/topic/seth/smb-auth-fixes'
* origin/topic/seth/smb-auth-fixes:
  Disable SMB2 error data parsing.
  Removed some files that aren't being used.
  Fix SMB tree connect handling.
  Fix a small issue where DCE_RPC commands were improperly being logged.
  SMB fixes and cleanup.
  Including a test for raw NTLM in SMB
  Updates for SMB auth handling from Martin van Hensbergen.

BIT-1721 #merged
2016-11-02 10:25:33 -07:00
Johanna Amann
681efc2b8d Version parsing scripts now supports several beta versions.
Versions such as 2.5-beta2 now don't throw an error.
2016-11-01 11:19:14 -07:00
Seth Hall
ff682b8c2c Merge remote-tracking branch 'origin/master' into topic/seth/smb-auth-fixes 2016-10-31 16:17:01 -04:00
Seth Hall
4f3fe047f4 SMB fixes and cleanup.
SMB error handling improved. The analyzer isn't destroyed when a problem
is encoutered anymore.  The flowbuffer in the parser is now flushed and
the analyzer is set to resync against an SMB command.  This was needed
because there is some state about open files that is kept within the
parser itself which was being destroyed and that was causing analysis
after content gaps or parse errors to be faulty.  The new mechanism
doesn't detroy the parser so parsing after gaps is improved.

DCE_RPC handling in SMB is improved in the edge case where a drive
mapping isn't seen. There is a new const named SMB::pipe_filenames
which is used as a heuristic for identifying "files" opened on named
pipe shares.  If the share mapping type isn't known and a filename
in this set is found, the share type will change to "PIPE" by
generating an event named "smb_pipe_connect_heuristic".  Reads and
writes to that file will be sent to the DCE_RPC analyzer instead of
to the files framework.

The concept of "unknown" share types has been removed due to the new
heuristic detection of share types.

Some general clean up of how the SMB cmd log is written and when.
2016-10-31 13:35:47 -04:00
Seth Hall
a836ece4e6 Including a test for raw NTLM in SMB 2016-10-26 10:41:08 -04:00
Robin Sommer
b0a2586309 Updating tests. 2016-10-25 17:06:25 -07:00
Johanna Amann
0f29405d6e Merge remote-tracking branch 'origin/topic/robin/sig-fixes'
* origin/topic/robin/sig-fixes:
  Fix a couple of problems with signature matching.

BIT-1737 #merged
2016-10-25 09:42:29 -07:00
Daniel Thayer
8ae064006b Merge remote-tracking branch 'origin/master' into fastpath 2016-10-21 09:35:04 -05:00
Daniel Thayer
99cd34f57d Python 3 compatibility fix for coverage-calc script 2016-10-21 09:33:04 -05:00
Johanna Amann
96d14691df Merge remote-tracking branch 'origin/topic/dnthayer/ticket1731'
* origin/topic/dnthayer/ticket1731:
  Fix istate.pybroccoli test on systems using Python 3

BIT-1731 #merged
2016-10-20 11:41:19 -04:00
Robin Sommer
5cf2320fbc Fix a couple of problems with signature matching.
- IPv4 CIDR specifications didn't work with dst-ip/src-ip.

    - The "payload-size" condition was unreliable with UDP traffic.
2016-10-19 14:23:43 -07:00
Johanna Amann
8ce746cc25 Merge remote-tracking branch 'origin/topic/vladg/bit-1641'
* origin/topic/vladg/bit-1641:
  Logic fix for ssh/main.bro when the auth status is indeterminate, and fix a test. Addresses BIT-1641.
  Clean up the logic for ssh_auth_failed. Addresses BIT-1641
  Update baselines for adding a field to ssh.log as part of BIT-1641
  Script-land changes for BIT-1641.
  Change SSH.cc to use ssh_auth_attempted instead of ssh_auth_failed. Addresses BIT-1641.
  Revert "Fixing duplicate SSH authentication failure events."
  Create new SSH events ssh_auth_attempt and ssh_auth_result. Add auth_attempts to SSH::Info. Address BIT-1641.

I extended the tests a bit and did some small cleanups. I also moved the
SSH events back to the global namespace for backwards compatibility and
for consistency (the way it was at the moment, some of them were global
some SSH::).

Furthermore, I fixed the ssh_auth_result result event, it was only
raised in the success case. ssh_auth_result is now also checked in the
testcases. I also have a suspicion that the intel integration never
really worked before.

BIT-1641 #merged
2016-10-18 21:57:27 -04:00
Daniel Thayer
6fa9540e47 Fix istate.pybroccoli test on systems using Python 3
Filter out the python 2 "L" suffix on long integers (not valid in Python 3),
and change python 3 "object at" to "instance at" when printing
class instances.
2016-10-14 14:10:40 -05:00
Vlad Grigorescu
70aaffbaac Logic fix for ssh/main.bro when the auth status is indeterminate, and fix a test. Addresses BIT-1641. 2016-10-14 09:14:22 -05:00
Vlad Grigorescu
3e7d143e31 Update baselines for adding a field to ssh.log as part of BIT-1641 2016-10-14 09:14:21 -05:00
Robin Sommer
c9d449e363 Merge remote-tracking branch 'origin/topic/johanna/tls13'
BIT-1727 #merged

* origin/topic/johanna/tls13:
  Better way to deal with overloaded Assign constructors.
  A few tabbing fixes in TLS 1.3 support
  TLS 1.3 support.
2016-10-13 15:48:27 -07:00
Robin Sommer
4477b8a1ab Merge remote-tracking branch 'origin/topic/seth/dce_rpc_fixes'
* origin/topic/seth/dce_rpc_fixes:
  Fixes for DCE_RPC analyzer
2016-10-10 08:29:14 -07:00
Robin Sommer
54191cc390 Merge remote-tracking branch 'origin/topic/dnthayer/ticket1719'
BIT-1719 #merged

* origin/topic/dnthayer/ticket1719:
  Fix httpd.py test script for Py3 compatibility
2016-10-10 08:24:04 -07:00
Seth Hall
029d92183e Fixes for DCE_RPC analyzer
- DCE_RPC fragmentation handling returns!
  - Fixed some general parsing issues
  - Fixed an issue with the DCE_RPC signature not working for IPv6 connections.
2016-10-08 10:00:26 -04:00
Johanna Amann
fdef28ce7c TLS 1.3 support.
Well, at least -draft-16, and we don't quite parse all extensions yet
(not that there is that much left to parse).
2016-10-07 12:51:43 -07:00
Johanna Amann
14c119c7f9 Really fix plugins/hooks test this time 2016-10-06 15:00:48 -07:00
Robin Sommer
d9ba7ea0dd Fixing documentation piece.
The interesting-hostname script has changed.
2016-10-06 14:28:52 -07:00
Daniel Thayer
e780ebb17a Fix httpd.py test script for Py3 compatibility
With these changes the script still works on Python 2.6/2.7.
2016-10-06 15:45:11 -05:00
Johanna Amann
26d9517774 Use the deterministic bro_random in a test, instead of os random().
The previous test stopped working on FreeBSD 11.0, and I am actually not
quite sure why this ever worked as stable as it did.
2016-10-06 12:56:52 -07:00
Johanna Amann
544317fc1e Test output change on FreeBSD 11.0 (changed one tab to space).
Let's just always filter the tab and make it a space on all systems -
with that the comparison should hopefully work everywhere.
2016-10-06 12:37:50 -07:00
Johanna Amann
5bdb282f8a Prevent loading version.bro during plugins.hooks test
versions.bro uses the changing version string, which leads to changing
lines in the output of the hooks plugin, which is difficult to filter.

Hence, let's just @unload it, before it is being used.
2016-10-06 11:59:24 -07:00
Johanna Amann
72a3c2cda2 Add missing path canonifier to version test 2016-10-06 11:41:04 -07:00
Robin Sommer
89ff11ba91 Merge remote-tracking branch 'origin/topic/johanna/version'
One more name change: version_num -> version_number

BIT-1707 #merged

* origin/topic/johanna/version:
  Slight naming changes for Bro version information.
  Add convenient way to access version information to Bro.
2016-10-02 17:48:28 -07:00
Seth Hall
d70f895be3 Merge branch 'J-Gras-topic/jgras/bit-1679'
* J-Gras-topic/jgras/bit-1679:
  Handle removing non-existent intel items.
  Separated file and default info added to matches.
2016-10-02 14:44:43 -04:00
Seth Hall
20fc6398be Merge branch 'topic/jgras/bit-1679' of https://github.com/J-Gras/bro into J-Gras-topic/jgras/bit-1679 2016-10-02 14:21:19 -04:00
Johanna Amann
f66ef7b1e6 Slight naming changes for Bro version information.
Main API now looks like this:

@if ( Version::number >= 20500 )
or
@if ( Version::at_least("2.5") )
2016-09-29 13:36:47 -07:00
Johanna Amann
35465aaf30 Add convenient way to access version information to Bro.
With the introduction of the package manager, it will get more common
that applications are able to get information about the currently
running version of Bro. With this commit, scripts can easily compare
which version of Bro they are running.

Commonly, this probably will either look like this (both lines check if
the current Bro version is greater or equal to 2.5)

@if ( Version::num >= 20500 )
or
@if ( Version::greater_equal("2.5") )

Version::info contains detailed information about the running version of
Bro, including beta flags, etc.
2016-09-29 12:45:48 -07:00
Johanna Amann
038dfa6273 Actually check if the number of fields in a write are equal to the
number of fields required.

Addresses BIT-1683

I do not think this quite fixes the underlying issue of BIT-1683 - it
should not be possible to get to this state in normal operations.

Also fixes a small memory leak for disabled writers.
2016-09-22 16:43:37 -07:00
Jan Grashoefer
8c024ca094 Handle removing non-existent intel items.
The intel framework raises a reporter info on removing non-existent
intel items. An according test case has been added.

Fixes #1679.
2016-09-21 00:37:38 +02:00
Seth Hall
8015e35747 Fix a crash when a user disables DCE_RPC and enabled SMB.
I wasn't accounting for analyzers being disabled and not actually
instantiating when requested.  This includes a test which
verifies there is no crash or problem when a user disables DCE_RPC.
2016-08-28 21:28:57 -04:00
Johanna Amann
058e378ced Update local-compat test for 2.5 2016-08-17 10:38:18 -07:00
Johanna Amann
04fa937129 And update one last test baseline 2016-08-17 09:19:44 -07:00
Johanna Amann
55f99c0da9 Fix sphinx build errors 2016-08-17 09:16:16 -07:00
Johanna Amann
fd54892da3 SMB: fix rounding error due to value truncation when converting timestamps. 2016-08-16 16:02:44 -07:00
Johanna Amann
5d8da0b182 Address coverity errors. 2016-08-16 11:16:50 -07:00
Johanna Amann
0d706bcccd add certificate to external list for debian 8.
The OpenSSL on debian 8 refuses to validate one connection; everyone
else can. The easiest fix is to add the CA certificate to the root list.
Once debian has a newer version of OpenSSL, we should be able to remove
it again.
2016-08-15 16:47:44 -07:00
Johanna Amann
1889f409e9 Change timings of intel expire-item test.
Seems to be stable on slow systems with this.
2016-08-12 13:10:04 -07:00
Johanna Amann
33c85895b8 Make netcontrol cluster test stable.
It now consistently works for me.
2016-08-12 11:39:34 -07:00
Robin Sommer
8b7e8ecf15 Adding missing baseline update. 2016-08-12 08:21:26 -07:00
Robin Sommer
83ff3f8cdc Attempt to make test more stable. 2016-08-12 08:19:51 -07:00
Johanna Amann
0e44b91cd9 Merge remote-tracking branch 'origin/topic/seth/log-framework-ext'
* origin/topic/seth/log-framework-ext:
  Log extensions: series of small fixes and new tests.
  Change the function for log extension to take a path only and update tests.
  Final changes to log framework ext code.
  Add logging framework metadata mechanism.
  Add unrolling separator & field name map to logging framework.
2016-08-11 07:47:13 -07:00
Johanna Amann
5ec2108bc7 Make invalidtext.bro test stable. 2016-08-10 18:28:38 -07:00
Johanna Amann
6e769db23b Log extensions: series of small fixes and new tests.
The extensions now work with optional types, as well with complex types
(like subrecords). Not returning a record in the ext_func no longer
crashes bro.

The default_ext_func was switched to return void in
cases where no extension revord is defined (was bool).

I also got rid of the offsets in the indices - with the rest of the
implementation, that was not really necessary and made the code more
complex.
2016-08-10 14:14:03 -07:00
Seth Hall
79e49e1ab5 Change the function for log extension to take a path only and update tests.
We were having stack overflow issues creep in with the self-referential
field for the log extension function.
2016-08-10 13:53:27 -04:00