Skip to content

Instantly share code, notes, and snippets.

@sethhall
Created October 6, 2014 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethhall/cede395db75ac3efa47d to your computer and use it in GitHub Desktop.
Save sethhall/cede395db75ac3efa47d to your computer and use it in GitHub Desktop.
File identification script.
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