mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Update docs and tests for a recent change to detect-MHR.bro
This commit is contained in:
parent
9ed5f8bae8
commit
85d8653bce
7 changed files with 26 additions and 6 deletions
|
@ -66,7 +66,7 @@ are ensuring the Files framework, the Notice framework and the script to hash al
|
|||
been loaded by Bro.
|
||||
|
||||
.. btest-include:: ${BRO_SRC_ROOT}/scripts/policy/frameworks/files/detect-MHR.bro
|
||||
:lines: 10-31
|
||||
:lines: 10-36
|
||||
|
||||
The export section redefines an enumerable constant that describes the
|
||||
type of notice we will generate with the Notice framework. Bro
|
||||
|
@ -87,7 +87,7 @@ Up until this point, the script has merely done some basic setup. With the next
|
|||
the script starts to define instructions to take in a given event.
|
||||
|
||||
.. btest-include:: ${BRO_SRC_ROOT}/scripts/policy/frameworks/files/detect-MHR.bro
|
||||
:lines: 33-57
|
||||
:lines: 38-62
|
||||
|
||||
The workhorse of the script is contained in the event handler for
|
||||
``file_hash``. The :bro:see:`file_hash` event allows scripts to access
|
||||
|
|
|
@ -27,6 +27,11 @@ export {
|
|||
/application\/jar/ |
|
||||
/video\/mp4/ &redef;
|
||||
|
||||
## The Match notice has a sub message with a URL where you can get more
|
||||
## information about the file. The %s will be replaced with the SHA-1
|
||||
## hash of the file.
|
||||
const match_sub_url = "https://www.virustotal.com/en/search/?query=%s" &redef;
|
||||
|
||||
## The malware hash registry runs each malware sample through several
|
||||
## A/V engines. Team Cymru returns a percentage to indicate how
|
||||
## many A/V engines flagged the sample as malicious. This threshold
|
||||
|
@ -52,7 +57,7 @@ event file_hash(f: fa_file, kind: string, hash: string)
|
|||
if ( mhr_detect_rate >= notice_threshold )
|
||||
{
|
||||
local message = fmt("Malware Hash Registry Detection rate: %d%% Last seen: %s", mhr_detect_rate, readable_first_detected);
|
||||
local virustotal_url = fmt("https://www.virustotal.com/en/file/%s/analysis/", hash);
|
||||
local virustotal_url = fmt(match_sub_url, hash);
|
||||
NOTICE([$note=Match, $msg=message, $sub=virustotal_url, $f=f]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,11 @@ export {
|
|||
/application\/jar/ |
|
||||
/video\/mp4/ &redef;
|
||||
|
||||
## The Match notice has a sub message with a URL where you can get more
|
||||
## information about the file. The %s will be replaced with the SHA-1
|
||||
## hash of the file.
|
||||
const match_sub_url = "https://www.virustotal.com/en/search/?query=%s" &redef;
|
||||
|
||||
## The malware hash registry runs each malware sample through several
|
||||
## A/V engines. Team Cymru returns a percentage to indicate how
|
||||
## many A/V engines flagged the sample as malicious. This threshold
|
||||
|
|
|
@ -20,7 +20,7 @@ event file_hash(f: fa_file, kind: string, hash: string)
|
|||
if ( mhr_detect_rate >= notice_threshold )
|
||||
{
|
||||
local message = fmt("Malware Hash Registry Detection rate: %d%% Last seen: %s", mhr_detect_rate, readable_first_detected);
|
||||
local virustotal_url = fmt("https://www.virustotal.com/en/file/%s/analysis/", hash);
|
||||
local virustotal_url = fmt(match_sub_url, hash);
|
||||
NOTICE([$note=Match, $msg=message, $sub=virustotal_url, $f=f]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,11 @@ export {
|
|||
/application\/jar/ |
|
||||
/video\/mp4/ &redef;
|
||||
|
||||
## The Match notice has a sub message with a URL where you can get more
|
||||
## information about the file. The %s will be replaced with the SHA-1
|
||||
## hash of the file.
|
||||
const match_sub_url = "https://www.virustotal.com/en/search/?query=%s" &redef;
|
||||
|
||||
## The malware hash registry runs each malware sample through several
|
||||
## A/V engines. Team Cymru returns a percentage to indicate how
|
||||
## many A/V engines flagged the sample as malicious. This threshold
|
||||
|
@ -52,7 +57,7 @@ event file_hash(f: fa_file, kind: string, hash: string)
|
|||
if ( mhr_detect_rate >= notice_threshold )
|
||||
{
|
||||
local message = fmt("Malware Hash Registry Detection rate: %d%% Last seen: %s", mhr_detect_rate, readable_first_detected);
|
||||
local virustotal_url = fmt("https://www.virustotal.com/en/file/%s/analysis/", hash);
|
||||
local virustotal_url = fmt(match_sub_url, hash);
|
||||
NOTICE([$note=Match, $msg=message, $sub=virustotal_url, $f=f]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,11 @@ export {
|
|||
/application\/jar/ |
|
||||
/video\/mp4/ &redef;
|
||||
|
||||
## The Match notice has a sub message with a URL where you can get more
|
||||
## information about the file. The %s will be replaced with the SHA-1
|
||||
## hash of the file.
|
||||
const match_sub_url = "https://www.virustotal.com/en/search/?query=%s" &redef;
|
||||
|
||||
## The malware hash registry runs each malware sample through several
|
||||
## A/V engines. Team Cymru returns a percentage to indicate how
|
||||
## many A/V engines flagged the sample as malicious. This threshold
|
||||
|
|
|
@ -20,7 +20,7 @@ event file_hash(f: fa_file, kind: string, hash: string)
|
|||
if ( mhr_detect_rate >= notice_threshold )
|
||||
{
|
||||
local message = fmt("Malware Hash Registry Detection rate: %d%% Last seen: %s", mhr_detect_rate, readable_first_detected);
|
||||
local virustotal_url = fmt("https://www.virustotal.com/en/file/%s/analysis/", hash);
|
||||
local virustotal_url = fmt(match_sub_url, hash);
|
||||
NOTICE([$note=Match, $msg=message, $sub=virustotal_url, $f=f]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue