Commit graph

801 commits

Author SHA1 Message Date
Jon Siwek
b749dda520 Fix SSL scripting error leading to access of unitialized field
Reported by Justin Azoff
2020-05-06 09:52:31 -07:00
Jon Siwek
156686b237 Correct spelling of DCE/RPC operation string NetrLogonSameLogonWithFlags
Fixes GH-952
2020-05-04 18:03:14 -07:00
Vern Paxson
fe46ef06a0 unused variables found via use-def analysis (plus an indentation micro-nit) 2020-04-25 18:06:47 -07:00
Jon Siwek
c8e070b8ee Add default function for Kerberos constant-lookup-tables 2020-04-16 12:34:41 -07:00
Jon Siwek
e66148a13a Merge branch 'topic/ak/rdpeudp'
- Squashed the original commit set
- Cleaned up formatting
- Fixed register_for_ports() for right RDPEUDP analyzer

* topic/ak/rdpeudp:
  Add RDP over UDP analyzer
2020-04-02 18:31:40 -07:00
Anthony Kasza
60644bc85f Add RDP over UDP analyzer 2020-04-02 17:53:47 -07:00
M.Shirk
9cd914b5cf Duplicate smb2_negotiate_response events defined. 2020-03-16 11:47:39 -04:00
Johanna Amann
c20551e48e Update submodule
[nomail]
2020-02-03 13:23:22 -08:00
Seth Hall
d9ed76c90a
Fix warning when reading files from non-network sources
If files are being read from non-network sources, there was a warning in the SSL base scripts about missing the f$conns field.
2020-01-14 10:53:02 -05:00
Justin Azoff
80469a1fde fix NTLM field value access
The fields being checked for existence were not the same as the fields
being accessed.
2020-01-08 11:40:28 -05:00
Jon Siwek
31f60853c9 GH-646: add new "successful_connection_remove" event
And switch Zeek's base scripts over to using it in place of
"connection_state_remove".  The difference between the two is
that "connection_state_remove" is raised for all events while
"successful_connection_remove" excludes TCP connections that were never
established (just SYN packets).  There can be performance benefits
to this change for some use-cases.

There's also a new event called ``connection_successful`` and a new
``connection`` record field named "successful" to help indicate this new
property of connections.
2019-11-11 19:52:59 -08:00
Jon Siwek
872adda5b1 Merge branch 'topic/jsbarber/ftp-cluster-fix-patch' of https://github.com/jsbarber/zeek
Minor cleanup in merge: remove print statements and unnecessary @if
directive.

* 'topic/jsbarber/ftp-cluster-fix-patch' of https://github.com/jsbarber/zeek:
  Publish ftp_data_expected updates to other workers for synchronization
2019-11-04 17:31:59 -08:00
Jeff Barber
d698bddc7d Publish ftp_data_expected updates to other workers for synchronization 2019-10-30 15:50:22 -06:00
Robin Sommer
9d7c9f37d4 Merge branch 'Fix_http_build_url' of ssh://github.com/Olerdrive/zeek
I changed the format string of the port to %d and added a test.
2019-10-28 09:32:32 +00:00
Alexey Mokeev
6ba1d1dcd3 Make http::build_url work correctly 2019-10-27 11:17:53 +03:00
Jon Siwek
81ab0b0d05 Use explicit path name for NTP log stream
For consistency (we do this for all other logs) and just to avoid
the extra path function calls.
2019-10-25 10:38:58 -07:00
Jon Siwek
31d30bb47e GH-535: fix typo of "C_HESIOD" in DNS::classes
Fixes GH-535
2019-08-12 13:32:28 -07:00
Johanna Amann
0f96a9dedf Disable MQTT by default
To enable MQTT, one has to load policy/scripts/mqtt. Like with smb in
2.5, the consts are loaded by default.
2019-08-05 17:04:39 -07:00
Jon Siwek
6bc947a48e GH-474: add MQTT::max_payload_size option
This caps size of payload strings within mqtt_publish events and
mqtt_publish.log files.  A new "payload_len" field in the log file
shows the real payload size in cases where it may have been truncated.
2019-08-02 14:28:55 -07:00
Jon Siwek
c43e809a69 GH-474: use topic vectors for MQTT (un)subscribe events/logs 2019-08-02 13:48:43 -07:00
Johanna Amann
649d9f502b Update Certificate Transparency list 2019-08-02 12:43:43 -07:00
Johanna Amann
6f25125443 Update CA store to NSS 3.45
This also required updating a test that required a root-certificate that
was removed from the Mozilla store - the test now directly includes that
specific root-cert.
2019-08-02 12:36:54 -07:00
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