Good afternoon.
I find myself trying to create an inventory with all the computers in the network. For this I not only need to get the computers that have to make TCP connections as are the data we get in known_hosts, so I rely on getting all the computers found in the event: event new_connection(c: connection).
Is this the correct way?
Then I find myself with another doubt, I need that besides having an inventory with the equipments these have data like the ones that zeek already obtains by default in the logs of software, services and ntml.
I have the doubt of how to obtain this data, since I can think of the following ways:
- by accessing the module tables, which contain the final results.
- Reading the logs already generated (known_services.log, software.log, ntml.log).
- Importing script configuration to obtain the final result of these.
I am going to indicate which I think are the best options in order of priority and justify why.
- Accessing the tables of the modules, which contain the final results.
- Conclusion: I think this way is the most convenient because it is very direct and could be worked in memory without waiting for the logs to be written.
- Reading the logs already generated (known_services.log, software.log, ntml.log)
- Conclusion: I see this as a good option but I find two disadvantages, the first one is that we would have to wait for the data to be written to read them, so they would not be as accessible as the first option. Also as second disadvantage is to have possible errors of reading because they are writing data at the same time that they are reading others.
- Importing script configuration to obtain the final result of these.
-Conclusion: I definitely think this is the worst option because I have tried to import the Known::log_known_services event, even though the data does not match with the logs generated for example in the known services script. I think it is because in addition to this event, there are other important parts such as checking the services obtained with the parsers found, ie you must have a very good view of the script from which you want to import the functionality and also not enough to import only one part, but you have to import many parts of the script.
I hope you can guide me and thank you in advance!