Commit graph

6667 commits

Author SHA1 Message Date
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
Vern Paxson
58ffd61dcc test suite for bitwise operators
brief NEWS blurb
allow for "counter" operands (does anyone still use these?) for one (but not both) of the bitwise operands
2018-04-26 13:25:04 -07:00
Vern Paxson
1658931af1 bitwise operations for "count" types implemented 2018-04-26 12:38:24 -07:00
Vern Paxson
d9dc8d69d7 Starting branch for supporting bit operations on count's.
This check-in just adds the operators to the lexer and migrates the existing
operator names internally.
2018-04-26 10:51:43 -07: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
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
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
Jon Siwek
8152508330 BIT-1909: fix invalid redef'd record field accesses 2018-04-11 16:23:26 -05:00
Johanna Amann
46a87f741b Merge remote-tracking branch 'origin/topic/dnthayer/fix-for-gcc48'
* origin/topic/dnthayer/fix-for-gcc48:
  Fix config input reader on systems with gcc 4.8

BIT-1917 #merged
2018-04-11 07:22:35 +09:00
Jon Siwek
b55c78917a Updating submodule(s).
[nomail]
2018-04-10 10:25:21 -05:00
Daniel Thayer
6e933199dc Fix config input reader on systems with gcc 4.8
Systems that have gcc 4.8 (such as RHEL 7 or ubuntu 14.04 LTS) have a
version of libstdc++ that doesn't implement the C++11 regex functions
(the header and functions exist, but calling them results in the process
being terminated).  On those systems, the following tests fail:
scripts.base.frameworks.config.basic ... failed
scripts.base.frameworks.config.read_config ... failed
scripts.base.frameworks.config.several-files ... failed
scripts.base.frameworks.config.updates ... failed
scripts.base.frameworks.input.config.basic ... failed
scripts.base.frameworks.input.config.errors ... failed

As a workaround, this commit switches to using the POSIX regex.h
functions.
2018-04-06 13:58:23 -05:00
Robin Sommer
281c9a5ba3 Merge branch 'master' of https://github.com/nnovzver/bro 2018-04-06 10:50:38 -07:00
Seth Hall
9c85d3f3a9 On rare occasions the server doesn't return the tree id on read responses.
This tracks the tree id given by the request

This also addresses BIT-1862 with code submitted by Stefano Rinaldi
and took some hints from his changes in other areas of the code.
2018-04-05 17:12:33 -04:00
Devin Trejo
868cb5838d Add smb2_file_sattr 2018-04-04 14:40:43 -04:00
Seth Hall
f6e5f0b1a5 A small fix for the last merge related to fixing Kerberos in GSSAPI.
We really need to figure out some way to expand our public tests
for SMB.  This problem crept in due to not having a test for
this particular case.
2018-04-03 02:58:54 -04:00
Seth Hall
3131952762 Cleaned up and moved parsing to binpac.
Too much parsing was being done in C++ so I moved more of
it into binpac.  Also, fixed up a bunch of the whitespace
(the new code was indented with spaces).
2018-04-03 01:56:34 -04:00
Seth Hall
5b07bbe0a5 Merge branch 'gssapi-krb-fix' of https://github.com/jrolli/bro into jrolli-gssapi-krb-fix 2018-04-02 22:28:11 -04:00
Seth Hall
68d0085d35 Merge branch 'smb_changes' of https://github.com/jwallior/bro into jwallior-smb_changes 2018-04-02 17:06:30 -04:00
Robin Sommer
aec449cccc Merge remote-tracking branch 'origin/topic/johanna/cleanup'
Good stuff!

Closes BIT-1915

* origin/topic/johanna/cleanup:
  Mark one-parameter constructors as explicit & use override where possible
  Remove unimplemented & unused functions from header files.
  Make data flow more explicit for complilers.
2018-03-29 13:43:01 -07:00
Johanna Amann
f39efd0317 Recognize TLS 1.3 negotiation correctly.
The way in which TLS 1.3 is negotiated was changed slightly in later
revisions of the standard. The final version is only sent in an
extension - while the version field in the server hello still shows TLS
1.2.

This patch makes ssl.log show the correct version again.
2018-03-27 14:58:06 -07:00
Vladimir Ruzanov
5145b5cb4e Fix NETBIOSSSN analyzer name 2018-03-27 23:32:06 +03:00
Johanna Amann
6d612ced3d Mark one-parameter constructors as explicit & use override where possible
This commit marks (hopefully) ever one-parameter constructor as explicit.

It also uses override in (hopefully) all circumstances where a virtual
method is overridden.

There are a very few other minor changes - most of them were necessary
to get everything to compile (like one additional constructor). In one
case I changed an implicit operation to an explicit string conversion -
I think the automatically chosen conversion was much more convoluted.

This took longer than I want to admit but not as long as I feared :)
2018-03-27 07:17:32 -07:00
Philippe Antoine
ecf2788740 Better reporter for Brostring with embedded NUL
Can be reproduced with something like
curl 127.0.0.1:8002/readme.html%00lol
2018-03-23 10:10:01 +01:00
Robin Sommer
288fcd0039 Merge remote-tracking branch 'origin/topic/seth/smb-mapping-memleak-fix'
Closes BIT-1911.

* origin/topic/seth/smb-mapping-memleak-fix:
  Fix a memory leak in SMBv1 share mapping
2018-03-21 13:57:26 -07:00
Seth Hall
551f57ea97 Fix a memory leak in SMBv1 share mapping 2018-03-21 16:29:59 -04:00
Johanna Amann
1f2bf50b49 Remove unimplemented & unused functions from header files.
All of these functions were defined in header files without ever being
implemented or used.
2018-03-16 18:38:04 -07:00
Johanna Amann
911018347f Make data flow more explicit for complilers.
gcc likes complaining about ev potentially not being initialized. Make
it clear that this cannot happen by marking the default case as
unreachable after the error output.
2018-03-16 14:36:13 -07:00
Daniel Thayer
f3e42874b8 Improve config framework documentation comments
Fixed typos and formatting.
2018-03-15 14:16:00 -05:00
Seth Hall
e76b56ce53 Rework to the DHCP analyzer.
Highlights:
 - Reduced all DHCP events into a single dhcp_message event. (removed legacy events since they weren't widely used anyway)
 - Support many more DHCP options.
 - DHCP log is completely reworked and now represents DHCP sessions
   based on the transaction ID (and works on clusters).
 - Removed the known-devices-and-hostnames script since it's generally
   less relevant now with the updated log.
2018-03-01 08:36:32 -08:00
Jon Siwek
c54b607de1 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix another warning when building the documentation
  Fix a warning when building documentation
  Fix the config framework several-files.bro test
2018-02-18 17:37:34 -06:00
Johanna Amann
9bc42385f3 Update submodule
[nomail]
2018-02-16 09:02:21 -08:00
Daniel Thayer
d0c29e81e1 Fix a warning when building documentation 2018-02-14 17:01:04 -06:00
Jon Siwek
85b5c6ffbd Fix pessimizing-move compiler warning.
Returning via move() should never be needed and may result in a compiler
warning: "moving a local object in a return statement prevents copy
elision".
2018-02-12 11:13:04 -06:00
Jon Siwek
6766f52cdd Add limit to number of auth flavors parsed out of MNT replies 2018-02-12 11:01:25 -06:00
Xiaogrill
cbe585dd87 Treat LibreSSL as an older OpenSSL 2018-02-11 09:07:22 -08:00
Robin Sommer
fff4db5145 Merge remote-tracking branch 'origin/topic/johanna/config'
Closes BIT-1900.

* origin/topic/johanna/config:
  Use port_mgr->Get() in the input framework config changes.
  Allow the empty field separator to be empty; use in config framework.
  Fix small bug in config reader.
  Fix segmentation fault when parsing sets containing invalid elements.
  Add config framework.
2018-02-07 14:10:48 -08:00
Robin Sommer
c0aab7cf15 Fix compile.
One final change hadn't made it in.
2018-02-06 17:05:09 -08:00
Robin Sommer
cbd96a65cf Merge remote-tracking branch 'origin/topic/jsiwek/bit-1854-reassembler-improvements'
Includes small readability tweaks, see BIT-1854.

Closes BIT-1854.

* origin/topic/jsiwek/bit-1854-reassembler-improvements:
  BIT-1854: improve reassembly overlap checking
  BIT-1854: fix the 'tcp_excessive_data_without_further_acks' option
2018-02-06 08:42:29 -08:00
Robin Sommer
2ecfae8810 Merge remote-tracking branch 'origin/topic/johanna/ssl_signature_details'
Closes BIT-1897.

* origin/topic/johanna/ssl_signature_details:
  Make parsing of ServerKeyExchange work for D(TLS) < 1.2.
  Add more details to ssl_server_signature.
2018-02-05 15:21:28 -08:00
Jon Siwek
4cd9f0edf9 Merge branch 'smb-transaction-messages' of https://github.com/jbencteux/bro
* 'smb-transaction-messages' of https://github.com/jbencteux/bro:
  add test for smb1_com_transaction_response event changes
  add test for smb1_com_transaction2_secondary_request event changes
  add test for smb1_com_transaction2_request event changes
  add test for smb1_com_transaction_secondary_request event changes
  add test for smb1_com_transaction_request event changes
  fix setup field handling in smb1_com_transaction_request messages
  fix smb1_com_transaction* messages
  add smb1_transaction2_secondary_request event
  add smb1_transaction_secondary_request event
  add parameters and data to smb1_transaction_request/response messages
  add SMB_Parameters.Words to smb1_transaction2_request event
2018-02-05 16:33:25 -06:00
Jon Siwek
7bdbcfc568 Fix warnings when building sphinx docs 2018-02-05 15:19:08 -06:00
Jon Siwek
9603deeb64 Merge branch 'nfs-updates' of https://github.com/dtrejod/bro
* 'nfs-updates' of https://github.com/dtrejod/bro:
  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.
  Bug fix: nfs3_writeargs didn't properly return filehandle.
  Add nfs_proc_symlink, nfs_proc_link, nfs_proc_sattr.
2018-02-05 14:15:18 -06:00
Jon Siwek
35fa1261f3 Merge branch 'mount-protocol' of https://github.com/dtrejod/bro
* 'mount-protocol' of https://github.com/dtrejod/bro:
  Add unit tests for new MOUNT events -- mount_proc_mnt, mount_proc_umnt, mount_proc_umnt_all, mount_proc_not_implemented.
  Add mount_proc_null, mount_proc_mnt, mount_proc_umnt, mount_proc_umnt_all, mount_proc_not_implemented, mount_reply_status.
2018-02-05 13:32:36 -06:00
Jon Siwek
445e5bfc18 Fix (unlikely) memory leak in nb_dns.c 2018-02-05 10:45:02 -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
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