Skip to content

Instantly share code, notes, and snippets.

@mpurzynski
Created February 13, 2020 21:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpurzynski/96a26c42874898447554531b6df9a4bb to your computer and use it in GitHub Desktop.
Save mpurzynski/96a26c42874898447554531b6df9a4bb to your computer and use it in GitHub Desktop.
module Scan;
global whitelist_scan_port: set[port] = {5223/udp, 5223/tcp} &redef;
global ephemeral_start_udp: port = 32768/udp;
global ephemeral_start_tcp: port = 32768/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;
}
module Scan;
type Idx: record {
whitelist_ip: subnet;
};
global whitelist_scan_ip: set[subnet] = {};
event zeek_init()
{
Input::add_table([$source="/etc/zeek/scripts/zeekzilla/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