ZEEK EXERCISES
ANOMALOUS DNS
Investigate the dns-tunneling.pcap file. Investigate the dns.log file. What is the number of DNS records linked to the IPv6 address?
root@thm:~$ cd Desktop/Exercise-Files/anomalous-dns
root@thm:~$ ls
clear-logs.sh dns-tunneling.pcap
root@thm:~$ zeek -C -r dns-tunneling.pcap
root@thm:~$ ls
clear-logs.sh dns-tunneling.pcap http.log packet_filter.log
conn.log dns.log ntp.log
root@thm:~$ head dns.log
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto trans_idrtt query qclass qclass_name qtype qtype_name rcode rcode_name AA TC RD RA Z answers TTLs rejected
#types time string addr port addr port enum count interval string count string count string count string bool bool bool bool count vector[string] vector[interval] bool
1623212924.825154 CcJ7pk2dFfkLv8WXfe 10.20.57.3 59580 10.10.2.22 53 udp 5374 0.855652 e7f1018ea0310f25bba0610936fd1cc2af.cisco-update.com 1 C_INTERNET 15 MX 0 NOERROR F F T T 0 3591018ea0f08b48069ca0ffff640c1cfb.cisco-update.com 58.000000 F
root@thm:~$ cat dns.log | zeek-cut qtype_name
TXT
CNAME
MX
AAAA
...
root@thm:~$ cat dns.log | zeek-cut qtype_name | grep AAAA | wc -l
320Investigate the dns-tunneling.pcap file. Investigate the conn.log file. What is the longest connection duration?
root@thm:~$ cd Desktop/Exercise-Files/anomalous-dns
root@thm:~$ ls
clear-logs.sh dns-tunneling.pcap
root@thm:~$ zeek -C -r dns-tunneling.pcap
root@thm:~$ ls
clear-logs.sh dns-tunneling.pcap http.log packet_filter.log
conn.log dns.log ntp.log
root@thm:~$ head conn.log
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes resp_bytes conn_state local_orig local_resp missed_bytes history orig_pkts orig_ip_bytes resp_pkts resp_ip_bytes tunnel_parents
#types time string addr port addr port enum string interval count count string bool bool count string count count count count set[string]
1623212924.825154 CcJ7pk2dFfkLv8WXfe 10.20.57.3 59580 10.10.2.22 53 udp dns 0.855652 80 175 SF - - 0 Dd 1 108 1 203-
1623212925.678141 CglDT21NBa0XUHywyl 10.20.57.3 47888 10.10.2.22 53 udp dns 0.158643 80 175 SF - - 0 Dd 1 108 1 203-
root@thm:~$ cat conn.log | zeek-cut duration
0.658508
0.360476
0.039498
...
root@thm:~$ cat conn.log | zeek-cut duration | sort -n
3.445874
4.238265
7.835490
9.420791Investigate the dns-tunneling.pcap file. Investigate the dns.log file. Filter all unique DNS queries. What is the number of unique domain queries?
root@thm:~$ cd Desktop/Exercise-Files/anomalous-dns
root@thm:~$ ls
clear-logs.sh dns-tunneling.pcap
root@thm:~$ zeek -C -r dns-tunneling.pcap
root@thm:~$ ls
clear-logs.sh dns-tunneling.pcap http.log packet_filter.log
conn.log dns.log ntp.log
root@thm:~$ head dns.log
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto trans_idrtt query qclass qclass_name qtype qtype_name rcode rcode_name AA TC RD RA Z answers TTLs rejected
#types time string addr port addr port enum count interval string count string count string count string bool bool bool bool count vector[string] vector[interval] bool
1623212924.825154 CcJ7pk2dFfkLv8WXfe 10.20.57.3 59580 10.10.2.22 53 udp 5374 0.855652 e7f1018ea0310f25bba0610936fd1cc2af.cisco-update.com 1 C_INTERNET 15 MX 0 NOERROR F F T T 0 3591018ea0f08b48069ca0ffff640c1cfb.cisco-update.com 58.000000 F
root@thm:~$ cat dns.log | zeek-cut query
db.rhodes.edu
4542016cb16eb15fd56e1b16c4545111d7.cisco-update.com
...
root@thm:~$ cat dns.log | zeek-cut query |rev | cut -d '.' -f 1-2 | rev | sort | uniq
_tcp.local
cisco-update.com
in-addr.arpa
ip6.arpa
rhodes.edu
ubuntu.com
root@thm:~$ cat dns.log | zeek-cut query |rev | cut -d '.' -f 1-2 | rev | sort | uniq | wc -l
6Investigate the dns-tunneling.pcap file. There are a massive amount of DNS queries sent to the same domain. This is abnormal. Let's find out which hosts are involved in this activity. Investigate the conn.log file. What is the IP address of the source host?
root@thm:~$ cd Desktop/Exercise-Files/anomalous-dns
root@thm:~$ ls
clear-logs.sh dns-tunneling.pcap
root@thm:~$ zeek -C -r dns-tunneling.pcap
root@thm:~$ ls
clear-logs.sh dns-tunneling.pcap http.log packet_filter.log
conn.log dns.log ntp.log
root@thm:~$ head conn.log
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes resp_bytes conn_state local_orig local_resp missed_bytes history orig_pkts orig_ip_bytes resp_pkts resp_ip_bytes tunnel_parents
#types time string addr port addr port enum string interval count count string bool bool count string count count count count set[string]
1623212924.825154 CcJ7pk2dFfkLv8WXfe 10.20.57.3 59580 10.10.2.22 53 udp dns 0.855652 80 175 SF - - 0 Dd 1 108 1 203-
1623212925.678141 CglDT21NBa0XUHywyl 10.20.57.3 47888 10.10.2.22 53 udp dns 0.158643 80 175 SF - - 0 Dd 1 108 1 203-
root@thm:~$ cat conn.log | zeek-cut id.orig_h
10.20.57.3
10.20.57.3
...
root@thm:~$ cat conn.log | zeek-cut id.orig_h | sort | uniq
10.20.57.3
fe80::202a:f0b1:7d9c:bd9ePHISHING
Investigate the http.log file. Which domain address were the malicious files downloaded from? Enter your answer in defanged format.
Investigate the malicious document in VirusTotal. What kind of file is associated with the malicious document?
Investigate the malicious .exe file in VirusTotal. What is the contacted domain name? Enter your answer in defanged format.
LOG4J
Investigate the log4shell.pcapng file with detection-log4j.zeek script. Investigate the signature.log file. What is the number of signature hits?
Investigate the log4shell.pcapng file with detection-log4j.zeek script. Investigate the http.log file. Which tool is used for scanning?
Last updated