Skip to content

Instantly share code, notes, and snippets.

@dcode
Created November 4, 2015 17:59
Show Gist options
  • Save dcode/e1c61a279927fcd61b9d to your computer and use it in GitHub Desktop.
Save dcode/e1c61a279927fcd61b9d to your computer and use it in GitHub Desktop.
Extracts SMTP stream going both directions using Bro. Similar to "Follow TCP Stream" in Wireshark.
event protocol_confirmation (c: connection, atype: Analyzer::Tag, aid: count)
{
if ( atype == Analyzer::ANALYZER_SMTP )
{
local both_file = generate_extraction_filename(Conn::extraction_prefix, c, "both.dat");
local both_f = open(both_file);
set_contents_file(c$id, CONTENTS_BOTH, both_f);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment