Zeek PDF Guide
Zeek PDF Guide
Sareena K P
RISE Lab
What is Bro?
Facilitates broader
spectrum of very
different approaches to
find malicious activity
● semantic misuse
detection
● anomaly detection
● behavioral analysis.
Source: https://www.zeek.org/documentation/slides/index.html
Architecture
What can Bro do?
BRO Logs
Logs Generated
Built-in functionality
● Conn.log
for a range of analysis ● SSH.log
● HTTP.log
and detection tasks ● DNS.log
● Files.log
sudo bro -i wlan0 ● Software.log
Source: https://www.zeek.org/documentation/slides/index.html
What Can it Do?
Zeek - Syntax
● Static type system (i.e., the type of data a variable holds is fixed)
● Regular expression using flex's syntax
#pattern matching
print /one|two|three/ == "two"; # T
print /one|two|three/ == "ones"; # F (exact matching)
print /one|two|three/ in "ones"; # T (embedded matching)
print /[123].*/ == "2 two"; # T
● Set of domain-specific types : Examples are time, interval, port, addr, and subnet.
event bro_init() {
priority 10 myhook handler, hi local ret: bool = hook myhook("hi");
break out of myhook handling, hi if ( ret ) {
print "all handlers ran"; }}
Scan Detector
Membership operato
Excessive DNS Requests
Track the number of DNS Requests - SumStats
local r1 = SumStats::Reducer($stream="dns.lookup",apply=set(SumStats::UNIQUE));
SumStats::Result) = ….]);
Filtering Packets
event NetControl::init() {
NetControl::activate(debug_plugin, 0);
if ( n$note == DNSEXCESS::ExcessiveRequests )
add n$actions[Notice::ACTION_DROP]; }
Filtering Packets
event NetControl::init() {
NetControl::activate(debug_plugin, 0);
Notified by
}
Notice
hook Notice::policy(n: Notice::Info){
Actions
if ( n$note == DNSEXCESS::ExcessiveRequests )
add n$actions[Notice::ACTION_DROP]; }
Stateful filters
DoS/DDoS TCP Scan UDP Scan
Stateful filters
DoS/DDoS TCP Scan UDP Scan
Persistent
communication from
any host to a
destination that does
not provide replies