Created
June 25, 2019 22:14
-
-
Save mpurzynski/07d8983ac259d990e6ed4269ca7cd313 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Scan; | |
global whitelist_scan_port: set[port] = { } &redef; | |
global ephemeral_start_udp: port = secret/udp; | |
global ephemeral_start_tcp: port = secret/tcp; | |
hook scan_policy(scanner: addr, victim: addr, scanned_port: port) | |
{ | |
if (( victim in whitelist_scan_ip) || ( scanner in whitelist_scan_ip ) || ( scanned_port in whitelist_scan_port) || ( scanned_port > ephemeral_start_udp ) || ( scanned_port > ephemeral_start_tcp )) | |
break; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Scan; | |
type Idx: record { | |
whitelist_ip: subnet; | |
}; | |
global whitelist_scan_ip: set[subnet] = {} &synchronized; | |
event bro_init() | |
{ | |
Input::add_table([$source="/etc/bro/scripts/brozilla/whitelist_scan_ip.txt", | |
$name="whitelist_scan_ip", | |
$idx=Idx, | |
$destination=whitelist_scan_ip, | |
$mode=Input::REREAD]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment