Last active
May 8, 2023 12:12
-
-
Save rsatrio/c53408a0af221ab2da57bddebbe01ffe to your computer and use it in GitHub Desktop.
Zeek Script Example
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 DDosAttacks; | |
@load base / protocols / dns | |
redef enum Notice::Type += { | |
DNSDDoSAmplification | |
}; | |
function generate_ddos_notice(c: connection, query: string) { | |
local query1: string = strip(query); | |
if (query1 == "peacecorps.gov" || query1 == "pizzaseo.com") { | |
NOTICE([$note = DNSDDoSAmplification, | |
$msg = fmt("Possible DNS DDoS Amplification Attack"), | |
$conn = c, | |
$uid = c$uid | |
]); | |
} | |
} | |
event dns_request(c: connection, msg: dns_msg, query: string, qtype: count, qclass: count, original_query: string) { | |
generate_ddos_notice(c, query); | |
} | |
event dns_query_reply(c: connection, msg: dns_msg, query: string, qtype: count, qclass: count, original_query: string) { | |
generate_ddos_notice(c, query); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment