Commit graph

779 commits

Author SHA1 Message Date
Jon Siwek
d2eed166bd GH-517: fix MQTT suback/unsuback accessing non-existent index 2019-08-02 11:57:46 -07:00
Johanna Amann
6fa0f4ac49 Merge remote-tracking branch 'origin/topic/johanna/conn-duration-thresholds'
* origin/topic/johanna/conn-duration-thresholds:
  Add duration thresholding to the conn-size analyzer.
2019-08-01 14:20:49 -07:00
Johanna Amann
9d489cde20 Add duration thresholding to the conn-size analyzer.
Now, in addition to setting thresholds for bytes and packet, one can set
a threshold for connection duration. Note that the threshold event is
only raised once the next packet in the connection is seen.

This also fixes a small pre-existing bug, in which a bunch of warnings
were raised if someone just used the lower-level functions without going
through the higher-level scripting API.
2019-08-01 11:57:40 -07:00
Jon Siwek
ee28e9e9f3 Merge remote-tracking branch 'origin/topic/seth/mqtt'
* origin/topic/seth/mqtt:
  Bug fixes and test baseline updates
  Fix an issue with bro_init -> zeek_init
  MQTT Analyzer heavily updated and ported from the analyzer originally by Supriya Kumar

Adjustments during merge:

* Minor whitespace cleanups
* Some bro to zeek renaming
* Fixed the parsing of unsubscribe messages to generate an event for each topic
2019-07-31 21:29:38 -07:00
Seth Hall
7626344122 Tiny tweaks to try and address ticket #506 2019-07-31 11:17:53 -04:00
Seth Hall
0ed274b081 Fix an issue with bro_init -> zeek_init 2019-07-29 13:51:39 -04:00
Seth Hall
a42b3a1d63 MQTT Analyzer heavily updated and ported from the analyzer originally by Supriya Kumar
This analyzer generates three logs to fully display what is happening over the MQTT connection.
  - mqtt_connect.log
  - mqtt_subscribe.log
  - mqtt_publish.log

At this time it only supports MQTT 3.1 and 3.1.1
2019-07-29 13:45:10 -04:00
Jon Siwek
8cf9c41c12 GH-485: fix cases where DHCP log omits MAC field
The field is populated in this order of preference:

  (1) Use a client-identifier option sent by client
  (2) Use the server's CHADDR field
  (3) Use the client's CHADDR field

Case (3) did not exist before this patch.
2019-07-26 20:05:15 -07:00
Johanna Amann
c0e3b8c66f Deprecate rfb_event.
Fixes GH-446
2019-07-03 02:15:34 -07:00
Jon Siwek
e2dc0092f3 Merge branch 'ntp-rewrite' of https://github.com/mauropalumbo75/zeek
* 'ntp-rewrite' of https://github.com/mauropalumbo75/zeek: (25 commits)
  update tests baseline
  Apply requested changes: - file dpd.sig and TODO comments for signature protocol detection removed - missing doc field filled in events.bif - rename OpCode and ReqCode fields into op_code and req_code respectively - removed unnecessary child method in NTP.h/.cc - main.zeek and ntp-protocol.pac reformatted
  minor changes in the documentation
  fix some initializations
  fix wrong assignment of control key_id/crypto_checksum
  code clean up
  add extension fields parsing
  add extended mac field with 20 byte digest (+4 byte key id)
  update tests and add a new one for key_id and mac
  fix auth field (key_id and mac) in standard and control msg
  remove old NTP record in init-bare.zeek
  fix key_id and digest (WIP)
  fix wrong Assign with reference_id
  add tests for ntp protocol (finished)
  add tests for ntp protocol (WIP)
  fix problem with time vals
  add ntp records to init-bare.zeek
  update ntp analyzer to val_mgr
  extend and refact script-side of NTP analyzer
  extend and refactor several fields
  ...
2019-06-15 19:11:34 -07:00
Vlad Grigorescu
5f0023b3b0 DNS: Add support for SPF response records
SPF response records are identical to TXT records in structure, and
can be parsed and interpreted the same way. However, they have a
different RR type, so they would generate weird events and not be
parsed by Zeek before this change.

Even though they're the same as TXT records from a protocol stance, I
created a new event type (dns_SPF_reply), and call the records out as
SPF in the logs, instead of as TXT records, since the distinction
could be important for detection purposes.

SPF records have been obsoleted, but continue to be seen in the wild.
2019-06-14 10:18:37 -05:00
Mauro Palumbo
32663cec04 Apply requested changes:
- file dpd.sig and TODO comments for signature protocol detection removed
- missing doc field filled in events.bif
- rename OpCode and ReqCode fields into op_code and req_code respectively
- removed unnecessary child method in NTP.h/.cc
- main.zeek and ntp-protocol.pac reformatted
2019-06-14 12:30:29 +02:00
Johanna Amann
05e519439e Merge remote-tracking branch 'origin/topic/jsiwek/gh-209-radius-attr-66'
* origin/topic/jsiwek/gh-209-radius-attr-66:
  GH-209: replace "remote_ip" field of radius.log with "tunnel_client"
2019-06-07 17:43:27 +10:00
Mauro Palumbo
2cd2c65fe3 fix auth field (key_id and mac) in standard and control msg 2019-06-06 16:38:05 +02:00
Jon Siwek
dfed213f31 Deprecate functions with "bro" in them.
* "bro_is_terminating" is now "zeek_is_terminating"

* "bro_version" is now "zeek_version"

The old function names still exist for now, but are deprecated.
2019-06-05 16:18:57 -07:00
Jon Siwek
ed113918e7 GH-209: replace "remote_ip" field of radius.log with "tunnel_client"
The type of the field also changed from "addr" to "string" because the
former cannot represent all possible values of the
Tunnel-Client-Endpoint attribute, which may include FQDNs, not just IP
addresses.
2019-06-05 11:11:49 -07:00
Palumbo Mauro
ce07b10aa8 extend and refact script-side of NTP analyzer 2019-06-03 17:50:32 +02:00
Palumbo Mauro
145c7f9a25 Merge remote-tracking branch 'origin/topic/vlad/ntp_rewrite' into ntp2 2019-06-03 17:04:17 +02:00
Jon Siwek
c3725a5e3f Merge remote-tracking branch 'origin/topic/vlad/rdp_bluekeep'
* origin/topic/vlad/rdp_bluekeep:
  RDP: Add weird if specification violated for max channels allowed.
2019-05-29 09:48:31 -07:00
Vlad Grigorescu
2005a76896 WIP: BinPAC NTP analyzer 2019-05-29 09:37:55 -05:00
Vlad Grigorescu
be4f6eae0e Ran binpac_quickstart for NTP (UDP, not buffered) 2019-05-29 09:04:48 -05:00
Vlad Grigorescu
10109b6b93 RDP: Add weird if specification violated for max channels allowed. 2019-05-29 08:25:08 -05:00
Jon Siwek
7bc9a3934d Merge remote-tracking branch 'origin/topic/vlad/rdp_bluekeep'
* origin/topic/vlad/rdp_bluekeep:
  RDP: Update existing baselines with new client_channels field
  RDP: Add parsing and logging of channels requested by the client. Can determine capabilities requested by the client, as well as attacks such as CVE-2019-0708
2019-05-28 11:33:20 -07:00
Vlad Grigorescu
8eb14fcb83 RDP: Add parsing and logging of channels requested by the client. Can determine capabilities requested by the client, as well as attacks such as CVE-2019-0708 2019-05-28 09:25:50 -05:00
Johanna Amann
0080c5ea09 Merge remote-tracking branch 'origin/topic/jsiwek/krb-optional-fields'
* origin/topic/jsiwek/krb-optional-fields:
  Add missing &optional attr to KRB record fields
2019-05-20 09:33:13 -07:00
Jon Siwek
f8d7aa2387 Add missing &optional attr to KRB record fields
The KRB parser allowed for the following types/fields to be left
uninitialized, so an &optional attribute was added to reflect that:

  - KRB::Error_Msg
    - pvno
    - msg_type
    - server_time
    - service_realm
    - service_name

  - KRB::KDC_Request
    - kdc_options
    - service_realm
    - till
    - nonce
    - encryption_types

Usages have also been adapted to perform existence checks.
2019-05-16 08:52:04 -07:00
Daniel Thayer
be182aac83 More bro-to-zeek renaming in scripts and other files 2019-05-16 02:36:41 -05:00
Jon Siwek
aebcb1415d GH-234: rename Broxygen to Zeexygen along with roles/directives
* All "Broxygen" usages have been replaced in
  code, documentation, filenames, etc.

* Sphinx roles/directives like ":bro:see" are now ":zeek:see"

* The "--broxygen" command-line option is now "--zeexygen"
2019-04-22 19:45:50 -07:00
Johanna Amann
5ba46eaa71 update SSL consts from TLS 1.3 2019-04-22 22:57:45 +02:00
Jon Siwek
d5803d7047 Merge remote-tracking branch 'origin/topic/vern/content-gap-history'
* origin/topic/vern/content-gap-history:
  Refined state machine update placement to (1) properly deal with gaps capped by clean FIN handshakes, and (1) fix failure to detect split routing.
  added 'g' $history character for content gaps
2019-04-22 12:40:40 -07:00
Jon Siwek
a994be9eeb Merge remote-tracking branch 'origin/topic/seth/zeek_init'
* origin/topic/seth/zeek_init:
  Some more testing fixes.
  Update docs and tests for bro_(init|done) -> zeek_(init|done)
  Implement the zeek_init handler.
2019-04-19 11:24:29 -07:00
Vern Paxson
915189a06a added 'g' $history character for content gaps 2019-04-17 14:20:48 -07:00
Seth Hall
8cefb9be42 Implement the zeek_init handler.
Implements the change and a test.
2019-04-14 08:37:35 -04:00
Daniel Thayer
9cbeb44986 Merge remote-tracking branch 'upstream/master' 2019-04-14 01:35:50 -05:00
Daniel Thayer
18bd74454b Rename all scripts to have ".zeek" file extension 2019-04-11 21:12:40 -05:00
Johanna Amann
210a4361fa Merge remote-tracking branch 'origin/topic/jsiwek/syslog-missing-pri'
* origin/topic/jsiwek/syslog-missing-pri:
  Make Syslog analyzer accept messages that omit Priority
2019-04-03 09:25:52 -07:00
Daniel Thayer
bff8392ad4 Remove unnecessary ".bro" from @load directives
Removed ".bro" file extensions from "@load" directives because
they are not needed.
2019-03-31 02:24:47 -05:00
Jon Siwek
2d8acab664 Merge branch 'smb2-fix' of https://github.com/mauropalumbo75/zeek
* 'smb2-fix' of https://github.com/mauropalumbo75/zeek:
  added test and pcap files for smb_files.log fix
  fixing some missing log lines in smb_files.log
2019-03-20 18:01:35 -07:00
Jon Siwek
01d303b480 Migrate table-based for-loops to key-value iteration 2019-03-15 19:54:44 -07:00
Jon Siwek
be7110f6c0 Make Syslog analyzer accept messages that omit Priority
Essentially, it will now process/parse priority values if they are
there, or else just accept whatever remaining data/text is there as the
syslog message.  Reasoning is that there's syslog producers out there
that may have simply forgotten/neglected to send the priority value
and technically won't conform to what the standard says, though we can
infer the intent (some syslog consumers already may do similarly, but
I didn't verify).
2019-03-14 18:47:32 -07:00
Jon Siwek
1239a286e2 Merge branch 'patch-1' of https://github.com/neu5ron/bro
* 'patch-1' of https://github.com/neu5ron/bro:
  Update main.bro
  Update main.bro
2019-03-13 13:49:17 -07:00
Robin Sommer
56da70c148 Merge remote-tracking branch 'origin/topic/jsiwek/gh-289'
* origin/topic/jsiwek/gh-289:
  GH-289: Add options to limit entries in http.log file fields
2019-03-13 18:23:06 +00:00
Jon Siwek
a36ac12e88 Improve DNS query queuing logic
Related to https://github.com/zeek/zeek/pull/276
2019-03-08 18:38:41 -08:00
Jon Siwek
011b6e10bf Merge remote-tracking branch 'origin/topic/jazoff/dns-perf'
* origin/topic/jazoff/dns-perf:
  update baselines
  Use more efficient method to grab the protocol.
  improve performance of dns policy
2019-03-08 16:23:30 -08:00
Jon Siwek
92b6656bad GH-289: Add options to limit entries in http.log file fields
The "orig_fuids", "orig_filenames", "orig_mime_types" http.log fields as
well as their "resp" counterparts are now limited to having
"HTTP::max_files_orig" or "HTTP::max_files_resp" entries, which are 15
by default.  The limit can also be ignored case-by-case via the
"HTTP::max_files_policy" hook.

Fixes GH-289
2019-02-27 14:25:15 -06:00
Nate Guagenti
3d4dd2ea67
Update main.bro
added back user agent
2019-02-26 16:56:10 -05:00
Justin Azoff
a5ad864e13 Use more efficient method to grab the protocol.
get_conn_transport_proto needs to use sessions->FindConnection and do a
hash lookup to find the connection while get_port_transport_proto just
looks at the port directly.
2019-02-17 12:39:01 -05:00
Justin Azoff
a97cf10d03 improve performance of dns policy
defer allocating various tables until at least 2 pending queries are
seen.
2019-02-17 12:39:01 -05:00
Jon Siwek
8e9dc3c789 Improve format of conn_state docs 2019-02-13 16:15:13 -08:00
mauro
328ab79025 fixing some missing log lines in smb_files.log 2019-02-13 18:03:17 +01:00