Created
October 6, 2014 17:31
-
-
Save sethhall/cede395db75ac3efa47d to your computer and use it in GitHub Desktop.
File identification script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DIR="" &redef; | |
@load base/utils/dir | |
@load frameworks/files/hash-all-files | |
redef exit_only_after_terminate=T; | |
event bro_init() | |
{ | |
if ( DIR == "" ) | |
{ | |
print "you need to define a DIR"; | |
exit(-1); | |
} | |
Dir::monitor(DIR, function(fname: string) | |
{ | |
print fmt("File: %s", fname); | |
Input::add_analysis([$source=fname, $name=fname]); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment