Skip to content

Instantly share code, notes, and snippets.

@aeppert
Forked from dcode/extract_smtp_stream.bro
Created February 29, 2016 19:52
Show Gist options
  • Save aeppert/8b9f73bc5fe556d55b0c to your computer and use it in GitHub Desktop.
Save aeppert/8b9f73bc5fe556d55b0c 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