Commit graph

109 commits

Author SHA1 Message Date
Vlad Grigorescu
5e021f7d3c Add a TODO to return a correct status for ParseRR_WKS 2021-07-15 13:03:38 -05:00
Vlad Grigorescu
5f3fa57298 Remove unnecessary if 2021-07-15 13:02:23 -05:00
Vlad Grigorescu
8b4c2a88a5 Generate dns_WKS_reply event 2021-07-15 10:11:48 -05:00
Vlad Grigorescu
15b294098c dns_HINFO_reply event was never being generated.
On top of that, I modified the event to pass the relevant fields from the DNS message.
2021-07-15 09:56:38 -05:00
Tim Wojtulewicz
0b7ca5e7bc Remove Session prefix from some session-related classes and files 2021-04-29 11:09:35 -07:00
Tim Wojtulewicz
18c6aaaa33 Move session code into new directory and into zeek::session namespace 2021-04-29 11:09:35 -07:00
Tim Wojtulewicz
db1d753b35 Rename NetSessions to SessionManager
This also includes:
- Deprecating the NetSessions name.
- Renaming the zeek::sessions global to zeek::session_mgr and deprecating the old name.
- Renaming Sessions.{h,cc} to SessionManager.{h,cc}.
2021-04-29 10:24:45 -07:00
Vern Paxson
245108e86e remove unnecessary casts, and change necessary ones to use static_cast<> 2021-03-18 13:24:25 -07:00
Vern Paxson
62bab66114 migration to using new differentiated methods for setting record fields 2021-02-25 16:59:26 -08:00
Jon Siwek
c44cbe1feb Prefix #includes of .bif.h files with zeek/
This enables locating the headers within the install-tree using the
dirs provided by `zeek-config --include_dir`.

To enable locating these headers within the build-tree, this change also
creates a 'build/src/include/zeek -> ..' symlink.
2021-02-02 19:15:05 -08:00
Jon Siwek
8a8a983c49 Add missing zeek/ to header includes
Related to https://github.com/zeek/zeek/pull/1377
2021-01-29 19:16:29 -08:00
Jon Siwek
abb4f0be03 Fix EDNS ECS option parsing bugs
* The parsing of IPv6 addresses tried to fill a stack-buffer with as
  much data as supplied in the Option even if it was in excess of the
  desired prefix or maximum IPv6 address size.  This could result in an
  overflow of that stack-buffer.

* The parsing of IPv4 addresses would overwrite the storage used for
  that address as many times as there were bytes in the Option in excess
  of the desired prefix length or maximum IPv4 address size.  This could
  cause the resulting IPv4 address to be derived from the incorrect
  data.

* Upon encountering unexpected/excessive option-length or source-prefix
  parameters, the data pointer used for parsing was also not always
  advanced to the start of the next alleged option's data.  Assuming all
  other parsing code correctly guards against invalid input, there's no
  further harm from that other than the subsequent parsing being more
  likely to encounter unexpected values and emitting more Weirds.

Credit to OSS-Fuzz for discovery
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28336
(Link to details becomes public 30 days after patch release)
2020-12-07 13:35:17 -08:00
Tim Wojtulewicz
5589484f26 Fix includes of bif.h and _pac.h files to use full paths inside build directory 2020-11-12 12:15:26 -07:00
Tim Wojtulewicz
96d9115360 GH-1079: Use full paths starting with zeek/ when including files 2020-11-12 12:15:26 -07:00
Tim Wojtulewicz
a6a4b976ec Support for additional DNS RR Type: LOC[29], SSHFP[44], NSEC3PARAM[51], custom BIND9 signaling[65534] 2020-11-11 13:35:51 -07:00
Tim Wojtulewicz
70c2397f69 Plugins: Clean up explicit uses of namespaces in places where they're not necessary.
This commit covers all of the plugin classes.
2020-08-24 12:07:03 -07:00
Tim Wojtulewicz
0ac3fafe13 Move zeek::net namespace to zeek::run_state namespace.
This also moves all of the code from Net.{h,cc} to RunState.{h,cc} and marks Net.h as deprecated
2020-08-20 16:11:47 -07:00
Tim Wojtulewicz
a34e632eef Move NetVar from zeek to zeek::detail namespace 2020-08-20 16:11:46 -07:00
Tim Wojtulewicz
8d2d867a65 Move everything in util.h to zeek::util namespace.
This commit includes renaming a number of methods prefixed with bro_ to be prefixed with zeek_.
2020-08-20 16:00:33 -07:00
Tim Wojtulewicz
e7c6d51ae7 Move the functions and variables in Net.h to the zeek::net namespace. This includes moving network_time out of util.h. 2020-08-20 15:55:17 -07:00
Tim Wojtulewicz
715ca6549b Move the remainder of the analyzers to zeek namespaces 2020-08-20 15:55:17 -07:00
Tim Wojtulewicz
914ffcadae Move arp, tcp, udp, pia, and stepping stone analyzers 2020-08-20 15:55:17 -07:00
FlyingWithJerome
3b3197106d add data+=option_len to skip unknown bytes 2020-08-20 09:04:56 -04:00
FlyingWithJerome
d75a385f8f remove data+=option_len error in cookie and keepalive 2020-08-20 09:04:56 -04:00
FlyingWithJerome
74efbd0abc add EDNS cookie parsing 2020-08-20 09:04:56 -04:00
FlyingWithJerome
c5b4311a82 lazy commit 2020-08-20 09:04:56 -04:00
FlyingWithJerome
89af7d6d4e lazy commit 2020-08-20 09:04:56 -04:00
FlyingWithJerome
e121d89d4e lazy commit 2020-08-20 09:04:56 -04:00
FlyingWithJerome
84d609b333 add testcases 2020-08-20 09:04:56 -04:00
FlyingWithJerome
7dcf974daf add units (100ms) to comments 2020-08-20 09:04:56 -04:00
FlyingWithJerome
1d2b531062 initial adding EDNS TCP keepalive 2020-08-20 09:04:56 -04:00
Tim Wojtulewicz
7fefdd97af Move Conn and related types to zeek namespace 2020-07-31 16:25:54 -04:00
Tim Wojtulewicz
e3ee1860b8 Move Session code to namespaces 2020-07-31 16:25:54 -04:00
Tim Wojtulewicz
93948b4d19 Move all of the Packet-related classes to namespaces 2020-07-31 16:23:34 -04:00
Tim Wojtulewicz
45b5a98420 Move EventMgr, EventHandler, and EventRegistry code to zeek namespace. Rename mgr to event_mgr. 2020-07-31 16:23:32 -04:00
Tim Wojtulewicz
1c17700c48 Move Timer and PriorityQueue classes to namespaces 2020-07-31 16:23:02 -04:00
Tim Wojtulewicz
25c0fc7ab2 Move IP Addr/Prefix/Header classes into namespaces 2020-07-31 16:22:04 -04:00
Tim Wojtulewicz
9400b863ea Move all base analyzer classes to zeek::analyzer namespace 2020-07-31 16:21:46 -04:00
Jon Siwek
fad3edae5b Merge remote-tracking branch
* Fix potential DNS analyzer stack overflow
2020-07-27 11:34:34 -07:00
ronwellman
7f130e9e16 Avoid typecast to int& in EDNS parsing. 2020-07-24 10:21:42 -04:00
ronwellman
19e91292e8 Validate option_len in EDNS packets. 2020-07-24 09:26:09 -04:00
Jon Siwek
a66533f41a Fix potential DNS analyzer stack overflow
The Contents_DNS analyzer used a recursive message parsing function that
determined the size of the next message from the input packet-data
itself.  A packet containing a sequence of many small messages could
cause a stack overflow since a recursion happenened after processing
each message.

Credit to OSS-Fuzz for discovery
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24272
2020-07-20 11:48:23 -07:00
ronwellman
b17ec6bf93 Adjust for zeek namespace. 2020-07-06 22:59:43 -04:00
Ron Wellman
e7146c2a6b Implement EDNS Client Subnet Option 2020-07-06 15:09:03 -04:00
Tim Wojtulewicz
45d2c96643 Rename BroString files to ZeekString 2020-07-02 17:24:22 -07:00
Tim Wojtulewicz
736a3f53d4 Rename BroString to zeek::String 2020-07-02 16:15:01 -07:00
Tim Wojtulewicz
86fdf0eaa9 Mark global val_mgr as deprecated and fix uses of it to use namespaced version 2020-07-02 16:15:00 -07:00
Tim Wojtulewicz
58c6e10b62 Move BroString to zeek namespace 2020-06-30 21:12:26 -07:00
Tim Wojtulewicz
64332ca22c Move all Val classes to the zeek namespaces 2020-06-30 20:48:09 -07:00
Tim Wojtulewicz
ec9eff0bd5 Use type aliases for IntrusivePtr definitions 2020-06-30 20:37:30 -07:00