Commit graph

7932 commits

Author SHA1 Message Date
Jon Siwek
445e5bfc18 Fix (unlikely) memory leak in nb_dns.c 2018-02-05 10:45:02 -06:00
Daniel Thayer
97160b15da Add a .travis.yml file 2018-02-02 15:29:03 -06:00
Seth Hall
c2f35920fd First step of DHCP analyzer rearchitecture.
Old event prototypes have changed and the events are broken right
now and may be removed in favor of the new generic "dhcp_message"
event.

DHCP option parsing is abstracted from the main code base of the
protocol parser and are all now located in their own file.

Documentation, tests, and final code cleanup are still pending.
2018-02-02 10:14:15 -05:00
Johanna Amann
884f47a994 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Remove bro-plugins submodule from .gitmodules file
2018-02-01 13:21:31 -08:00
Daniel Thayer
5de87ce660 Remove bro-plugins submodule from .gitmodules file 2018-02-01 14:44:20 -06:00
Seth Hall
ba49ab8201 Merge branch 'feature/new_dhcp_data' of https://github.com/Mr-Click/bro into topic/seth/merge-121-dhcp-extensions 2018-02-01 10:06:35 -05:00
Jon Siwek
343dbf4100 BIT-1854: improve reassembly overlap checking
It now skips looping over buffered blocks in the common case where the
new block is at the end and so can't possibly overlap anything.
2018-01-31 21:14:45 -06:00
Jon Siwek
c2af3daa9f BIT-1854: fix the 'tcp_excessive_data_without_further_acks' option
This previously checked against the amount of out-of-sequence data
being buffered by the reassembler.  It now checks against the total
size of all blocks being buffered in the reassembler, which, by nature
of still being buffered there, means it's not been acked yet.
2018-01-31 21:09:12 -06:00
Johanna Amann
a8c0580b45 Merge branch 'topic/johanna/openssl-1.1'
* topic/johanna/openssl-1.1:
  Fix recently introduced double free in OpenSSL code.
  Adjust coding style & fix test failures.
  Adapt most of the X509 support to OpenSSL 1.1
2018-01-30 14:33:32 -08:00
Johanna Amann
eb32a44da5 Use port_mgr->Get() in the input framework config changes. 2018-01-29 14:43:39 -08:00
Johanna Amann
ac9fd000e0 Merge remote-tracking branch 'origin/master' into topic/johanna/config 2018-01-29 14:43:20 -08:00
Johanna Amann
196994a48d Allow the empty field separator to be empty; use in config framework.
This small change allows the empty field separator to be empty. This
means that we can represent an empty list by a empty input string, which
was not possible before.

Before, an empty empty field separator meant that there is no empty
field - to get back to this behavior one now has to set the empty field
separator to a string that is guaranteed to not be part of the input
data. Note that we did not use "empty" empty field separators anywhere
and I am not aware of this being used by anyone - the new behavior seems
like it is much more useful in practice.

This also changes the config framework to interpret empty lists as...
empty, instead of interpreting them as lists that have one zero-length
element; this seems like the saner default.
2018-01-29 14:22:59 -08:00
Johanna Amann
01005e99af Fix small bug in config reader.
The configure reader had a small bug that caused the tracking of changed
variables to be incorrect after the second update. This resulted in
change-events for unchanged variables.
2018-01-29 14:22:56 -08:00
Johanna Amann
b0be6c90fe Fix segmentation fault when parsing sets containing invalid elements.
Currently the destructor would try to free unallocated memory. This
could e.g. be triggered by the input framework reading a set with an
invalid element.
2018-01-29 14:22:44 -08:00
Jon Siwek
44175e0992 BIT-1894: fix bad integer casts in BIFs: sort, rand, order, to_int 2018-01-26 15:49:34 -06:00
Johanna Amann
141394ac9b Merge remote-tracking branch 'origin/master' into topic/johanna/ssl_signature_details 2018-01-26 10:33:18 -08:00
Jon Siwek
fd91f58192 Updating submodule(s).
[nomail]
2018-01-26 11:32:03 -06:00
Robin Sommer
419e69f9e4 Updating submodule(s).
[nomail]
2018-01-19 15:17:32 -08:00
Jon Siwek
f25a1453ee Remove TODO comments about using explicit bool operators 2018-01-19 11:40:57 -06:00
Jeffrey Bencteux
015eec8c71 add test for smb1_com_transaction_response event changes 2018-01-19 14:29:31 +01:00
Jeffrey Bencteux
4c0b6e0984 add test for smb1_com_transaction2_secondary_request event changes 2018-01-19 14:29:26 +01:00
Jeffrey Bencteux
4807b7d847 add test for smb1_com_transaction2_request event changes 2018-01-19 14:29:20 +01:00
Jeffrey Bencteux
314e992284 add test for smb1_com_transaction_secondary_request event changes 2018-01-19 14:29:09 +01:00
Johanna Amann
41285abea5 Make nearly all bool operators explicit.
These are a bit dangerous because the casting can happen in quite
unexpected circumstances and lead to undesirable comparison results.
2018-01-18 14:02:03 -08:00
Jon Siwek
3495b2fa9d Fix problems with SumStats non-cluster.bro script
* Add proper namespace scoping to a 'SumStats::process_epoch_result'
  scheduled event.

* Fix iterator invalidation within 'SumStats::process_epoch_result'

* Give 'SumStats::process_epoch_result' a copy of the result table so
  that the SumStats framework can clear the original and move on to the
  next epoch immediately.

* The previous baseline of the basic sumstats unit test did look wrong
  to me and probably was actually indicative of the iterator invalidation
  problem.

Thanks to Jim Mellander for reporting the issues.
2018-01-18 11:14:39 -06:00
Jon Siwek
5ed5587b5c Merge remote-tracking branch 'origin/topic/feature/logging-filter-list'
* origin/topic/feature/logging-filter-list:
  Logging: implement get_filter_names and small fixes.

Removed some superfluous existence checks before deleting table indices.

BIT-1890 #merged
2018-01-17 16:17:43 -06:00
Johanna Amann
a4a9bf4199 Logging: implement get_filter_names and small fixes.
get_filter_names(id: ID) : set[string] returns the names of the current
list of filters for a specified log stream.

Furthermore this commit makes a number of logging functions more robust
by checking existence of values before trying to modify them. This
commit also really implements (and tests) the enable_stream function.
2018-01-17 09:47:20 -08:00
Jon Siwek
fc6e3b4e36 Merge remote-tracking branch 'origin/topic/johanna/recognize-websockets'
* origin/topic/johanna/recognize-websockets:
  HTTP: Recognize and skip upgrade/websocket connections.

BIT-1888 #Merged
2018-01-16 15:45:29 -06:00
Jon Siwek
09438d2d06 Merge remote-tracking branch 'origin/topic/johanna/conn-tunnels-empty'
* origin/topic/johanna/conn-tunnels-empty:
  Make tunnel_parents in conn.log optional.

BIT-1889 #merged
2018-01-16 14:56:15 -06:00
Jon Siwek
4bd066ef4f Updating submodule(s).
[nomail]
2018-01-16 13:01:19 -06:00
Johanna Amann
6f9524e082 Make tunnel_parents in conn.log optional.
This makes conn.logs a bit prettier (and smaller) because all lines that
do not use a tunnel will now have a "-" instead of the "(empty)" for
tunnel_parents.
2018-01-12 13:46:00 -08:00
Johanna Amann
bdb7f62335 Correct include-path in x509Common.h
The file used a relative path which leads to problems if it is included
by an external Plugin. This commit changes this to an absolute path,
like everywhere else.
2018-01-12 10:58:20 -08:00
Johanna Amann
cd345caadb Merge remote-tracking branch 'origin/master' into topic/johanna/websockets 2018-01-12 10:27:23 -08:00
Johanna Amann
cc738544eb Merge remote-tracking branch 'remotes/origin/topic/jsiwek/prealloc-ports'
* remotes/origin/topic/jsiwek/prealloc-ports:
  Clean up PortManager class, mark PortVal ctors deprecated.
  Add BRO_DEPRECATED macro.
  Preallocate all possible PortVals.

BIT-1881 #merged
2018-01-12 10:06:30 -08:00
Johanna Amann
762e3c9f12 Merge remote-tracking branch 'origin/topic/seth/add-file-lookup-functions'
* origin/topic/seth/add-file-lookup-functions:
  Functions for retrieving files by their id.

 BIT-1887 #merged
2018-01-12 09:46:24 -08:00
Jeffrey Bencteux
6d497ea8b0 add test for smb1_com_transaction_request event changes 2018-01-12 13:00:05 +01:00
Jeffrey Bencteux
00be145b1b fix setup field handling in smb1_com_transaction_request messages
This field is an array of 16 bit words and was parsed as an array of
32 bit words. Moreover, one can not assume the format is going to be a
16 bits opcode followed by a 16 bit file ID, the content of the setup
field is different according to its first 16 bits word that defines
the subcommand code. See MS-CIFS section 2.2.4.33.1 :

Setup (variable): An array of two-byte words that provides transaction
context to the server. The size and content of the array are specific
to individual subcommands.
2018-01-12 13:00:01 +01:00
Jeffrey Bencteux
f7a8726ffc fix smb1_com_transaction* messages 2018-01-12 12:59:41 +01:00
Devin Trejo
e529268b0a Format print nfs units tests to improve output readability. Add unit
tests for new NFS events -- nfs_proc_symlink, nfs_proc_link,
nfs_proc_sattr.
2018-01-11 17:02:47 -05:00
Devin Trejo
f6cf4a41ff Add unit tests for new MOUNT events -- mount_proc_mnt, mount_proc_umnt,
mount_proc_umnt_all, mount_proc_not_implemented.
2018-01-11 17:00:15 -05:00
Julien Wallior
f165ff943e Expand smb2 unit test. 2018-01-11 15:33:31 -05:00
Julien Wallior
a76e50d2e1 Change smb2_create_response event arguments to single response struct.
Added disposition and create_action fields.
2018-01-11 15:33:21 -05:00
Julien Wallior
f041c97cdc Change smb2_create_request event arguments to single request struct.
Added disposition and create_option fields.
2018-01-11 15:32:55 -05:00
Jon Siwek
89ef5a7b7d Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix a test that fails in some environments
2018-01-11 11:48:00 -06:00
Devin Trejo
99e411f621 Add mount_proc_null, mount_proc_mnt, mount_proc_umnt,
mount_proc_umnt_all, mount_proc_not_implemented, mount_reply_status.
2018-01-11 11:57:17 -05:00
Daniel Thayer
f7c115a47a Fix a test that fails in some environments
The "coverage/init-default.test" will always fail if there is a
path component named "build" anywhere before the bro install
directory (for example, if the tests are run from home dir of a user
named "build").  Fixed this by making a regex more specific so that
it matches the correct lines in loaded_scripts.log.
2018-01-10 13:23:30 -06:00
Devin Trejo
1981f2406a Bug fix: nfs3_writeargs didn't properly return filehandle. 2018-01-10 12:16:45 -05:00
Devin Trejo
b93691b15c Add nfs_proc_symlink, nfs_proc_link, nfs_proc_sattr. 2018-01-10 12:06:10 -05:00
Seth Hall
7cb6cf24a6 Functions for retrieving files by their id.
There are two new script level functions to query and lookup files
from the core by their IDs.  These are adding feature parity for
similarly named functions for files.  The function prototypes are
as follows:

  Files::file_exists(fuid: string): bool
  Files::lookup_File(fuid: string): fa_file
2018-01-09 12:16:17 -05:00
Valerio G
928e33a7b8 Add .btest scripts for dhck_ack and dhcp_discover messages verifying that new
options are correctly reported in dhcp.log records.
2018-01-08 21:55:24 +01:00