Skip to content

Instantly share code, notes, and snippets.

@sethhall
Created April 11, 2013 16:51
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/5365099 to your computer and use it in GitHub Desktop.
Save sethhall/5365099 to your computer and use it in GitHub Desktop.
event file_windows_pe_dosstub(f: fa_file, checksum: count)
{
print fmt("pe header offset: %d", checksum);
}
event file_windows_pe_timestamp(f: fa_file, ts: time)
{
print fmt("timestamp! %D", ts);
print f$mime_type;
}
event file_hash(f: fa_file, kind: string, hash: string)
{
print fmt("%s hash! %s", kind, hash);
}
event file_new(f: fa_file)
{
if ( f?$mime_type && f$mime_type == /application\/x-dosexec.*/ )
{
print "found a windows executable";
FileAnalysis::add_action(f, [$act=FileAnalysis::ACTION_PE_ANALYZER]);
}
FileAnalysis::add_action(f, [$act=FileAnalysis::ACTION_MD5]);
FileAnalysis::add_action(f, [$act=FileAnalysis::ACTION_SHA1]);
FileAnalysis::add_action(f, [$act=FileAnalysis::ACTION_SHA256]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment