Fixes for zeekctl error loading dhcp-fp.zeek; dhcp_unknown.py updated for python3; standalone kyd.py working;#1
Fixes for zeekctl error loading dhcp-fp.zeek; dhcp_unknown.py updated for python3; standalone kyd.py working;#1fubar2 wants to merge 30 commits intofatemabw:masterfrom
Conversation
trawls through all log subdirectories looking for every dhcpfp log file, compressed or not, to locate unique hash/fingerprint combinations for lookup, bypassing the need to make a file at the expense of repeated lookups.
…bunch of lines had a bogus tab before the newline and this may be causing the file to never be read properly
|
Sorry for all the commits but I had to use zkg locally and it insists on the repo being in sync. It took me a while to figure out that the two copies of dhcp-db.txt in your repository are different. The one in the zeek folder had some records with a bogus tab before the newline so loading the file into the table in zeek failed for me. Debugging this stuff is tricky. |
|
Hi Ross, Thank you for fixing the Python scripts and apologies for the syntax error in zeek script. I have to review more the python script changes to be able to merge it into the master branch. Fatema |
|
Hi Fatema, updated: your fix does not work here for me - my current fork has the absolute path and works in my setup as described above. No idea if it's just me and my setup but if I just use the filename, I get a reporter.log with a message about failing to load. |
fixed dhcp-unknown.py to not create an empty output file of newly identified fingerprints if none found.
The dhcp-db.txt file has to be in the current folder where your dhcp-fp.zeek file is. And if not, you have to provide the absolute path as mentioned in the comment in the script. If you have installed this plugin, both - the zeek script (dhcp-fp.zeek) and the DHCP db input file (dhcp-db.txt) should be residing under ~kyd/zeek/ folder. |
They are! However, I did install/uninstall it dozens of times with and without zkg so I'll try again with a fresh zeek installation and let you know - I may well have done something silly in the process of testing... update:
If I adjust the path in /usr/local/zeek/spool/installed-scripts-do-not-touch/site/packages/kyd/dhcp-fp.zeek to the full path it loads and works fine. |
|
Hi Fatema, |
… seen devices even if the hash and fingerprint are the same in dhcp-fp.zeek Also to output of kyd.py
Fixed argparse param for source file
Thanks very much for creating this zeke plugin - it's exactly what I need.
This PR fixes things for me, but
Those disclosures notwithstanding, using ZeekControl Version 2.0.0-25 and zeek version 3.1.0-dev.314-debug compiled from current git repo today, after
No installation problems but check throws an error:
Of course it doesn't load and no dhcp-fp.log appeared.
After the change in this PR, I see:
and now I see that the script has been loaded in loaded scripts and I am seeing dhcp-fp.log at last!
I also adjusted kyd.py so it runs standalone - "filename" was not being defined anywhere. Also dhcp-unknown now works (for me) in python3. Goodbye python2. Print statements and use of "unicode" have been updated and if no input file is provided on the CL, it will trawl through every zeek log directory - path is hardcoded :( parsing all the dhcpfp logs compressed or not.
Finally, a cosmetic fix to the metadata.
TODO: fix dhcp-unknown so it checks the local database and updates where new signatures are found.
I hope this works for everyone else. Thanks again!