In the process of Threat Hunting or even as a SOC Analyst, it is crucial to know your assets. You have to know which are the SSH Servers, the DNS Server, the Domain Controllers, and other systems in order to be able to understand which assets are the most valuable and which of them have the greater risk. Also if you know the purpose of its system it will be easier for you to detect abnormal things. This can be done by utilizing a CMDB and connecting it with your threat-hunting tool or your SIEM/SOAR. In that way, you can enrich your logs with hostnames, the operating system, and maybe the versions of the applications that run on these systems.

But many times if you work on an MSSP (and the client doesn’t have implemented a CMDB) or you are asked to monitor an unknown network (maybe for incident response purposes) or even if your company allows BYOD, most of the time you don’t have the option to enrich your logs through such asset management systems.

For that purpose, I decided to create a Zeek Module that utilizes the DHCP Protocol to enrich the Zeek logs with the hostname of the machine. The only requirement is for the machine to get its IP with DHCP. As so for systems with static IP assignment, you have to load the hostnames through a file which I will analyze in another post.

So the thing that actually the module does is monitor the DHCP Protocol communication and when a client asks for an IP from the DHCP Server, Zeek will check if the host_name field in the DHCP::Info record is set. If this is true, it will save it in a table along with the IP and the MAC address of the host. Also in the module you have the option to save the table only in memory, in cases, you don’t these data to persist. In case of persistence, you can change Passive_Entities::entities_store_persistency to Broker::SQLITE and the table will be saved in an SQLITE database. The table is also used the Broker Framework so the table will be synchronized in all the Zeek nodes. Hence the data will be in all the nodes of your Zeek Cluster even when you restart it.

Also, the module, every time a new DHCP log is created by Zeek, checks if the IP is taken from another host and updates the table in order to keep the table consistent with what happening on the network. Another feature is it tries to detect if the host changed its hostname and does the update.

At last, the module checks if the domain field also has a value, and if so it adds it to the enriched field. The enrichment with the hostname is being made on all the produced Zeek logs.

Below is a sample of an enriched conn.log. The first record has only the detected asset’s hostname and in the second one it has also detected the domain in which the system belongs.



More information about my Zeek Module can be found on my GitHub account (