Commit graph

30 commits

Author SHA1 Message Date
Arne Welzel
d2314d2666 files.log: Unroll and introduce uid and id fields
This is a script-only change that unrolls File::Info records into
multiple files.log entries if the same file was seen over different
connections by single worker. Consequently, the File::Info record
gets the commonly used uid and id fields added. These fields are
optional for File::Info - a file may be analyzed without relation
to a network connection (e.g by using Input::add_analysis()).

The existing tx_hosts, rx_hosts and conn_uids fields of Files::Info
are not meaningful after this change and removed by default. Therefore,
files.log will have them removed, too.

The tx_hosts, rx_hosts and conn_uids fields can be revived by using the
policy script frameworks/files/deprecated-txhosts-rxhosts-connuids.zeek
included in the distribution. However, with v6.1 this script will be
removed.
2022-08-16 17:22:20 +02:00
Arne Welzel
c4970e6d4a policy: Use literal dots for patterns used against content-type and hostname
The following two patterns were identified while reviewing patterns that
match on any characters. The intention likely was to match actual
literal dots.
2022-07-11 10:34:47 +02:00
Vern Paxson
98cd3f2213 update uses of "when" in base scripts to include captures 2022-01-07 14:53:33 -08:00
Tim Wojtulewicz
a6378531db Remove trailing whitespace from script files 2021-10-20 09:57:09 -07:00
Chris C
ada482c0e3
Update detect-MHR.zeek
Update Virustotal URL to current
option match_sub_url = "https://www.virustotal.com/gui/search/%s";
2021-05-28 14:46:19 -05:00
Jon Siwek
5658a529f0 Update URL for Malware Hash Registry website 2019-12-16 08:22:46 -08:00
Daniel Thayer
18bd74454b Rename all scripts to have ".zeek" file extension 2019-04-11 21:12:40 -05:00
Daniel Thayer
01a899255e Convert more redef-able constants to runtime options 2018-08-24 16:05:44 -05:00
Daniel Thayer
dc0904a7f3 Convert some redef-able constants to runtime options 2018-08-15 10:17:14 -05:00
Robin Sommer
209c8936d1 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix a few incorrect type tags in Bro broker source code
  Update docs and tests of the fmt() function
  Revert "Fix RFB analyzer to build on FreeBSD"
  Fix RFB analyzer to build on FreeBSD
2016-05-03 11:36:52 -07:00
Seth Hall
89b4d79f93 Merge remote-tracking branch 'origin/master' into topic/seth/file-entropy
# Conflicts:
#	scripts/test-all-policy.bro
#	testing/btest/Baseline/coverage.default-load-baseline/canonified_loaded_scripts.log
2016-03-21 11:39:15 -04:00
Richard van den Berg
aa8f56c2bd hash-all-files.bro depends on base/files/hash 2015-09-11 13:01:43 +02:00
Jon Siwek
0b957cbe75 Include timestamp in default extracted file names.
And add a policy script to extract all files.

BIT-1335 #close
2015-03-13 14:25:30 -05:00
Seth Hall
9c692bad39 Update and clean up to file entropy measurement.
- Updated to newer file analyzer api.
2015-02-03 15:04:36 -05:00
Seth Hall
b81510592a Merge remote-tracking branch 'origin/master' into topic/seth/file-entropy 2015-02-03 14:19:57 -05:00
Seth Hall
8e53e719f3 Merge remote-tracking branch 'origin/master' into topic/seth/file-entropy 2015-01-30 00:52:41 -05:00
Jon Siwek
23f04835c6 Deprecate split* family of BIFs.
These functions are now deprecated in favor of alternative versions that
return a vector of strings rather than a table of strings.

Deprecated functions:

- split: use split_string instead.
- split1: use split_string1 instead.
- split_all: use split_string_all instead.
- split_n: use split_string_n instead.
- cat_string_array: see join_string_vec instead.
- cat_string_array_n: see join_string_vec instead.
- join_string_array: see join_string_vec instead.
- sort_string_array: use sort instead instead.
- find_ip_addresses: use extract_ip_addresses instead.

Changed functions:

- has_valid_octets: uses a string_vec parameter instead of string_array.

Addresses BIT-924, BIT-757.
2015-01-21 15:34:42 -06:00
Seth Hall
cafd35e746 Updates the files event api and brings file reassembly up to master. 2014-09-26 00:40:37 -04:00
Jon Siwek
bebedcd873 Merge branch 'master' into topic/jsiwek/file-signatures
Conflicts:
	scripts/policy/frameworks/files/detect-MHR.bro
2014-03-24 14:35:37 -05:00
Jon Siwek
d3f88ba9d1 Improve performance of MHR script, addresses BIT-1139.
The MHR script involves a "when" statement which can be expensive due to
the way it clones frames/vals.  In this case, the fa_file record is
expensive to clone, but this change works around that by unrolling only
the necessary fields from it that are needed to populate a Notice::Info
record.  A drawback to this is that the full fa_file or connection
records aren't available in the Notice::Info record when evaluating
Notice::policy hooks for MHR hit notices (though they can possibly be
recovered by using e.g. the lookup_connection() builtin_function).
2014-03-11 13:18:14 -05:00
Jon Siwek
095a68b2ec Various minor changes related to file mime type detection.
- Improve or just remove some file magic signatures ported from libmagic
  that were too general and matched incorrectly too often.

- Fix MHR script's use of fa_file$mime_type before checking if it's
  initialized.  It may be uninitialized if no signatures match.

- The "fa_file" record now contains a "mime_types" field that contains
  all magic signatures that matched the file content (where the
  "mime_type" field is just a shortcut for the strongest match).
2014-03-06 11:41:10 -06:00
Vlad Grigorescu
8ad2ab44e2 Change MHR notice sub message URL to a redef. 2013-11-05 17:10:19 -05:00
Vlad Grigorescu
09779836cb Update VirusTotal URL to work with changes to their website. 2013-11-05 12:06:33 -05:00
Daniel Thayer
24da7ab839 Fix typos and formatting in the policy/frameworks docs
Also updated some tests related to these changes.
2013-10-21 01:23:08 -05:00
Seth Hall
b7877792c9 First commit of file entropy analyzer.
- Code comments need cleaned up still.
2013-08-05 00:02:48 -04:00
Seth Hall
f098b17429 A few test updates. 2013-07-23 11:18:49 -04:00
Seth Hall
3d5c17e9e0 Add jar files to the default MHR lookups. 2013-07-10 23:46:01 -04:00
Seth Hall
be8c947c04 Adding CAB files for MHR checking. 2013-07-10 17:04:09 -04:00
Seth Hall
bf4f57383f Improve malware hash registry script.
- Include a link to a virustotal search in the notice sub message field.

 - Give all information returned from Team Cymru in the notice message.

 - Add more file types to match on to the default set.
2013-07-10 16:52:39 -04:00
Seth Hall
df2841458d Large overhaul in name and appearance for file analysis. 2013-07-05 02:00:14 -04:00