mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Add GTPv1 packet analyzer, disable old analyzer
This commit is contained in:
parent
dc0ecf9811
commit
2044fbe53b
28 changed files with 1661 additions and 42 deletions
1
scripts/base/packet-protocols/gtpv1/__load__.zeek
Normal file
1
scripts/base/packet-protocols/gtpv1/__load__.zeek
Normal file
|
@ -0,0 +1 @@
|
|||
@load ./main
|
28
scripts/base/packet-protocols/gtpv1/main.zeek
Normal file
28
scripts/base/packet-protocols/gtpv1/main.zeek
Normal file
|
@ -0,0 +1,28 @@
|
|||
module PacketAnalyzer::GTPV1;
|
||||
|
||||
# This needs to be loaded here so the function is available. Function BIFs normally aren't
|
||||
# loaded until after the packet analysis init scripts are run, and then zeek complains it
|
||||
# can't find the function.
|
||||
@load base/bif/plugins/Zeek_GTPv1.functions.bif
|
||||
|
||||
# Needed for port registration for BPF
|
||||
@load base/frameworks/analyzer/main
|
||||
|
||||
export {
|
||||
## Default analyzer
|
||||
const default_analyzer: PacketAnalyzer::Tag = PacketAnalyzer::ANALYZER_IP &redef;
|
||||
}
|
||||
|
||||
const gtpv1_ports = { 2152/udp, 2123/udp };
|
||||
redef likely_server_ports += { gtpv1_ports };
|
||||
|
||||
event zeek_init() &priority=20
|
||||
{
|
||||
PacketAnalyzer::register_protocol_detection(PacketAnalyzer::ANALYZER_UDP, PacketAnalyzer::ANALYZER_GTPV1);
|
||||
PacketAnalyzer::register_for_ports(PacketAnalyzer::ANALYZER_UDP, PacketAnalyzer::ANALYZER_GTPV1, gtpv1_ports);
|
||||
}
|
||||
|
||||
event connection_state_remove(c: connection)
|
||||
{
|
||||
remove_gtpv1_connection(c$id);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue