mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Moved DPD signatures into script specific directories.
- This caused us to lose signatures for POP3 and Bittorrent. These will need discovered in the repository again when we add scripts for those analyzers.
This commit is contained in:
parent
841604bebe
commit
39444b5af7
19 changed files with 181 additions and 216 deletions
|
@ -1,212 +0,0 @@
|
||||||
# Signatures to initiate dynamic protocol detection.
|
|
||||||
|
|
||||||
signature dpd_ftp_client {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /(|.*[\n\r]) *[uU][sS][eE][rR] /
|
|
||||||
tcp-state originator
|
|
||||||
}
|
|
||||||
|
|
||||||
# Match for server greeting (220, 120) and for login or passwd
|
|
||||||
# required (230, 331).
|
|
||||||
signature dpd_ftp_server {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /[\n\r ]*(120|220)[^0-9].*[\n\r] *(230|331)[^0-9]/
|
|
||||||
tcp-state responder
|
|
||||||
requires-reverse-signature dpd_ftp_client
|
|
||||||
enable "ftp"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_http_client {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^[[:space:]]*(GET|HEAD|POST)[[:space:]]*/
|
|
||||||
tcp-state originator
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_http_server {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^HTTP\/[0-9]/
|
|
||||||
tcp-state responder
|
|
||||||
requires-reverse-signature dpd_http_client
|
|
||||||
enable "http"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_bittorrenttracker_client {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^.*\/announce\?.*info_hash/
|
|
||||||
tcp-state originator
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_bittorrenttracker_server {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^HTTP\/[0-9]/
|
|
||||||
tcp-state responder
|
|
||||||
requires-reverse-signature dpd_bittorrenttracker_client
|
|
||||||
enable "bittorrenttracker"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_bittorrent_peer1 {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^\x13BitTorrent protocol/
|
|
||||||
tcp-state originator
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_bittorrent_peer2 {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^\x13BitTorrent protocol/
|
|
||||||
tcp-state responder
|
|
||||||
requires-reverse-signature dpd_bittorrent_peer1
|
|
||||||
enable "bittorrent"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature irc_client1 {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /(|.*[\r\n]) *[Uu][Ss][Ee][Rr] +.+[\n\r]+ *[Nn][Ii][Cc][Kk] +.*[\r\n]/
|
|
||||||
requires-reverse-signature irc_server_reply
|
|
||||||
tcp-state originator
|
|
||||||
enable "irc"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature irc_client2 {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /(|.*[\r\n]) *[Nn][Ii][Cc][Kk] +.+[\r\n]+ *[Uu][Ss][Ee][Rr] +.+[\r\n]/
|
|
||||||
requires-reverse-signature irc_server_reply
|
|
||||||
tcp-state originator
|
|
||||||
enable "irc"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature irc_server_reply {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^(|.*[\n\r])(:[^ \n\r]+ )?[0-9][0-9][0-9] /
|
|
||||||
tcp-state responder
|
|
||||||
}
|
|
||||||
|
|
||||||
signature irc_server_to_server1 {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /(|.*[\r\n]) *[Ss][Ee][Rr][Vv][Ee][Rr] +[^ ]+ +[0-9]+ +:.+[\r\n]/
|
|
||||||
}
|
|
||||||
|
|
||||||
signature irc_server_to_server2 {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /(|.*[\r\n]) *[Ss][Ee][Rr][Vv][Ee][Rr] +[^ ]+ +[0-9]+ +:.+[\r\n]/
|
|
||||||
requires-reverse-signature irc_server_to_server1
|
|
||||||
enable "irc"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_smtp_client {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /(|.*[\n\r])[[:space:]]*([hH][eE][lL][oO]|[eE][hH][lL][oO])/
|
|
||||||
requires-reverse-signature dpd_smtp_server
|
|
||||||
enable "smtp"
|
|
||||||
tcp-state originator
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_smtp_server {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^[[:space:]]*220[[:space:]-]/
|
|
||||||
tcp-state responder
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_ssh_client {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^[sS][sS][hH]-/
|
|
||||||
requires-reverse-signature dpd_ssh_server
|
|
||||||
enable "ssh"
|
|
||||||
tcp-state originator
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_ssh_server {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^[sS][sS][hH]-/
|
|
||||||
tcp-state responder
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_pop3_server {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /^\+OK/
|
|
||||||
requires-reverse-signature dpd_pop3_client
|
|
||||||
enable "pop3"
|
|
||||||
tcp-state responder
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_pop3_client {
|
|
||||||
ip-proto == tcp
|
|
||||||
payload /(|.*[\r\n])[[:space:]]*([uU][sS][eE][rR][[:space:]]|[aA][pP][oO][pP][[:space:]]|[cC][aA][pP][aA]|[aA][uU][tT][hH])/
|
|
||||||
tcp-state originator
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_ssl_server {
|
|
||||||
ip-proto == tcp
|
|
||||||
# Server hello.
|
|
||||||
payload /^(\x16\x03[\x00\x01\x02]..\x02...\x03[\x00\x01\x02]|...?\x04..\x00\x02).*/
|
|
||||||
requires-reverse-signature dpd_ssl_client
|
|
||||||
enable "ssl"
|
|
||||||
tcp-state responder
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_ssl_client {
|
|
||||||
ip-proto == tcp
|
|
||||||
# Client hello.
|
|
||||||
payload /^(\x16\x03[\x00\x01\x02]..\x01...\x03[\x00\x01\x02]|...?\x01[\x00\x01\x02][\x02\x03]).*/
|
|
||||||
tcp-state originator
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_ayiya {
|
|
||||||
ip-proto = udp
|
|
||||||
payload /^..\x11\x29/
|
|
||||||
enable "ayiya"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_teredo {
|
|
||||||
ip-proto = udp
|
|
||||||
payload /^(\x00\x00)|(\x00\x01)|([\x60-\x6f])/
|
|
||||||
enable "teredo"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_socks4_client {
|
|
||||||
ip-proto == tcp
|
|
||||||
# '32' is a rather arbitrary max length for the user name.
|
|
||||||
payload /^\x04[\x01\x02].{0,32}\x00/
|
|
||||||
tcp-state originator
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_socks4_server {
|
|
||||||
ip-proto == tcp
|
|
||||||
requires-reverse-signature dpd_socks4_client
|
|
||||||
payload /^\x00[\x5a\x5b\x5c\x5d]/
|
|
||||||
tcp-state responder
|
|
||||||
enable "socks"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_socks4_reverse_client {
|
|
||||||
ip-proto == tcp
|
|
||||||
# '32' is a rather arbitrary max length for the user name.
|
|
||||||
payload /^\x04[\x01\x02].{0,32}\x00/
|
|
||||||
tcp-state responder
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_socks4_reverse_server {
|
|
||||||
ip-proto == tcp
|
|
||||||
requires-reverse-signature dpd_socks4_reverse_client
|
|
||||||
payload /^\x00[\x5a\x5b\x5c\x5d]/
|
|
||||||
tcp-state originator
|
|
||||||
enable "socks"
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_socks5_client {
|
|
||||||
ip-proto == tcp
|
|
||||||
# Watch for a few authentication methods to reduce false positives.
|
|
||||||
payload /^\x05.[\x00\x01\x02]/
|
|
||||||
tcp-state originator
|
|
||||||
}
|
|
||||||
|
|
||||||
signature dpd_socks5_server {
|
|
||||||
ip-proto == tcp
|
|
||||||
requires-reverse-signature dpd_socks5_client
|
|
||||||
# Watch for a single authentication method to be chosen by the server or
|
|
||||||
# the server to indicate the no authentication is required.
|
|
||||||
payload /^\x05(\x00|\x01[\x00\x01\x02])/
|
|
||||||
tcp-state responder
|
|
||||||
enable "socks"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
module DPD;
|
module DPD;
|
||||||
|
|
||||||
@load-sigs ./dpd.sig
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
## Add the DPD logging stream identifier.
|
## Add the DPD logging stream identifier.
|
||||||
redef enum Log::ID += { LOG };
|
redef enum Log::ID += { LOG };
|
||||||
|
|
|
@ -46,5 +46,6 @@
|
||||||
@load base/protocols/ssh
|
@load base/protocols/ssh
|
||||||
@load base/protocols/ssl
|
@load base/protocols/ssl
|
||||||
@load base/protocols/syslog
|
@load base/protocols/syslog
|
||||||
|
@load base/protocols/tunnels
|
||||||
|
|
||||||
@load base/misc/find-checksum-offloading
|
@load base/misc/find-checksum-offloading
|
||||||
|
|
|
@ -3,3 +3,5 @@
|
||||||
@load ./file-analysis
|
@load ./file-analysis
|
||||||
@load ./file-extract
|
@load ./file-extract
|
||||||
@load ./gridftp
|
@load ./gridftp
|
||||||
|
|
||||||
|
@load-sigs ./dpd.sig
|
15
scripts/base/protocols/ftp/dpd.sig
Normal file
15
scripts/base/protocols/ftp/dpd.sig
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
signature dpd_ftp_client {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /(|.*[\n\r]) *[uU][sS][eE][rR] /
|
||||||
|
tcp-state originator
|
||||||
|
}
|
||||||
|
|
||||||
|
# Match for server greeting (220, 120) and for login or passwd
|
||||||
|
# required (230, 331).
|
||||||
|
signature dpd_ftp_server {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /[\n\r ]*(120|220)[^0-9].*[\n\r] *(230|331)[^0-9]/
|
||||||
|
tcp-state responder
|
||||||
|
requires-reverse-signature dpd_ftp_client
|
||||||
|
enable "ftp"
|
||||||
|
}
|
|
@ -4,3 +4,5 @@
|
||||||
@load ./file-ident
|
@load ./file-ident
|
||||||
@load ./file-hash
|
@load ./file-hash
|
||||||
@load ./file-extract
|
@load ./file-extract
|
||||||
|
|
||||||
|
@load-sigs ./dpd.sig
|
13
scripts/base/protocols/http/dpd.sig
Normal file
13
scripts/base/protocols/http/dpd.sig
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
signature dpd_http_client {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /^[[:space:]]*(GET|HEAD|POST)[[:space:]]*/
|
||||||
|
tcp-state originator
|
||||||
|
}
|
||||||
|
|
||||||
|
signature dpd_http_server {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /^HTTP\/[0-9]/
|
||||||
|
tcp-state responder
|
||||||
|
requires-reverse-signature dpd_http_client
|
||||||
|
enable "http"
|
||||||
|
}
|
|
@ -1,3 +1,5 @@
|
||||||
@load ./main
|
@load ./main
|
||||||
@load ./dcc-send
|
@load ./dcc-send
|
||||||
@load ./file-analysis
|
@load ./file-analysis
|
||||||
|
|
||||||
|
@load-sigs ./dpd.sig
|
33
scripts/base/protocols/irc/dpd.sig
Normal file
33
scripts/base/protocols/irc/dpd.sig
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
signature irc_client1 {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /(|.*[\r\n]) *[Uu][Ss][Ee][Rr] +.+[\n\r]+ *[Nn][Ii][Cc][Kk] +.*[\r\n]/
|
||||||
|
requires-reverse-signature irc_server_reply
|
||||||
|
tcp-state originator
|
||||||
|
enable "irc"
|
||||||
|
}
|
||||||
|
|
||||||
|
signature irc_client2 {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /(|.*[\r\n]) *[Nn][Ii][Cc][Kk] +.+[\r\n]+ *[Uu][Ss][Ee][Rr] +.+[\r\n]/
|
||||||
|
requires-reverse-signature irc_server_reply
|
||||||
|
tcp-state originator
|
||||||
|
enable "irc"
|
||||||
|
}
|
||||||
|
|
||||||
|
signature irc_server_reply {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /^(|.*[\n\r])(:[^ \n\r]+ )?[0-9][0-9][0-9] /
|
||||||
|
tcp-state responder
|
||||||
|
}
|
||||||
|
|
||||||
|
signature irc_server_to_server1 {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /(|.*[\r\n]) *[Ss][Ee][Rr][Vv][Ee][Rr] +[^ ]+ +[0-9]+ +:.+[\r\n]/
|
||||||
|
}
|
||||||
|
|
||||||
|
signature irc_server_to_server2 {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /(|.*[\r\n]) *[Ss][Ee][Rr][Vv][Ee][Rr] +[^ ]+ +[0-9]+ +:.+[\r\n]/
|
||||||
|
requires-reverse-signature irc_server_to_server1
|
||||||
|
enable "irc"
|
||||||
|
}
|
|
@ -2,3 +2,5 @@
|
||||||
@load ./entities
|
@load ./entities
|
||||||
@load ./entities-excerpt
|
@load ./entities-excerpt
|
||||||
@load ./file-analysis
|
@load ./file-analysis
|
||||||
|
|
||||||
|
@load-sigs ./dpd.sig
|
12
scripts/base/protocols/smtp/dpd.sig
Normal file
12
scripts/base/protocols/smtp/dpd.sig
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
signature dpd_smtp_client {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /(|.*[\n\r])[[:space:]]*([hH][eE][lL][oO]|[eE][hH][lL][oO])/
|
||||||
|
requires-reverse-signature dpd_smtp_server
|
||||||
|
enable "smtp"
|
||||||
|
tcp-state originator
|
||||||
|
}
|
||||||
|
|
||||||
|
signature dpd_smtp_server {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /^[[:space:]]*220[[:space:]-]/
|
||||||
|
tcp-state responder
|
|
@ -1,2 +1,4 @@
|
||||||
@load ./consts
|
@load ./consts
|
||||||
@load ./main
|
@load ./main
|
||||||
|
|
||||||
|
@load-sigs ./dpd.sig
|
48
scripts/base/protocols/socks/dpd.sig
Normal file
48
scripts/base/protocols/socks/dpd.sig
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
signature dpd_socks4_client {
|
||||||
|
ip-proto == tcp
|
||||||
|
# '32' is a rather arbitrary max length for the user name.
|
||||||
|
payload /^\x04[\x01\x02].{0,32}\x00/
|
||||||
|
tcp-state originator
|
||||||
|
}
|
||||||
|
|
||||||
|
signature dpd_socks4_server {
|
||||||
|
ip-proto == tcp
|
||||||
|
requires-reverse-signature dpd_socks4_client
|
||||||
|
payload /^\x00[\x5a\x5b\x5c\x5d]/
|
||||||
|
tcp-state responder
|
||||||
|
enable "socks"
|
||||||
|
}
|
||||||
|
|
||||||
|
signature dpd_socks4_reverse_client {
|
||||||
|
ip-proto == tcp
|
||||||
|
# '32' is a rather arbitrary max length for the user name.
|
||||||
|
payload /^\x04[\x01\x02].{0,32}\x00/
|
||||||
|
tcp-state responder
|
||||||
|
}
|
||||||
|
|
||||||
|
signature dpd_socks4_reverse_server {
|
||||||
|
ip-proto == tcp
|
||||||
|
requires-reverse-signature dpd_socks4_reverse_client
|
||||||
|
payload /^\x00[\x5a\x5b\x5c\x5d]/
|
||||||
|
tcp-state originator
|
||||||
|
enable "socks"
|
||||||
|
}
|
||||||
|
|
||||||
|
signature dpd_socks5_client {
|
||||||
|
ip-proto == tcp
|
||||||
|
# Watch for a few authentication methods to reduce false positives.
|
||||||
|
payload /^\x05.[\x00\x01\x02]/
|
||||||
|
tcp-state originator
|
||||||
|
}
|
||||||
|
|
||||||
|
signature dpd_socks5_server {
|
||||||
|
ip-proto == tcp
|
||||||
|
requires-reverse-signature dpd_socks5_client
|
||||||
|
# Watch for a single authentication method to be chosen by the server or
|
||||||
|
# the server to indicate the no authentication is required.
|
||||||
|
payload /^\x05(\x00|\x01[\x00\x01\x02])/
|
||||||
|
tcp-state responder
|
||||||
|
enable "socks"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
@load ./main
|
@load ./main
|
||||||
|
|
||||||
|
@load-sigs ./dpd.sig
|
13
scripts/base/protocols/ssh/dpd.sig
Normal file
13
scripts/base/protocols/ssh/dpd.sig
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
signature dpd_ssh_client {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /^[sS][sS][hH]-/
|
||||||
|
requires-reverse-signature dpd_ssh_server
|
||||||
|
enable "ssh"
|
||||||
|
tcp-state originator
|
||||||
|
}
|
||||||
|
|
||||||
|
signature dpd_ssh_server {
|
||||||
|
ip-proto == tcp
|
||||||
|
payload /^[sS][sS][hH]-/
|
||||||
|
tcp-state responder
|
||||||
|
}
|
|
@ -1,3 +1,5 @@
|
||||||
@load ./consts
|
@load ./consts
|
||||||
@load ./main
|
@load ./main
|
||||||
@load ./mozilla-ca-list
|
@load ./mozilla-ca-list
|
||||||
|
|
||||||
|
@load-sigs ./dpd.sig
|
15
scripts/base/protocols/ssl/dpd.sig
Normal file
15
scripts/base/protocols/ssl/dpd.sig
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
signature dpd_ssl_server {
|
||||||
|
ip-proto == tcp
|
||||||
|
# Server hello.
|
||||||
|
payload /^(\x16\x03[\x00\x01\x02]..\x02...\x03[\x00\x01\x02]|...?\x04..\x00\x02).*/
|
||||||
|
requires-reverse-signature dpd_ssl_client
|
||||||
|
enable "ssl"
|
||||||
|
tcp-state responder
|
||||||
|
}
|
||||||
|
|
||||||
|
signature dpd_ssl_client {
|
||||||
|
ip-proto == tcp
|
||||||
|
# Client hello.
|
||||||
|
payload /^(\x16\x03[\x00\x01\x02]..\x01...\x03[\x00\x01\x02]|...?\x01[\x00\x01\x02][\x02\x03]).*/
|
||||||
|
tcp-state originator
|
||||||
|
}
|
1
scripts/base/protocols/tunnels/__load__.bro
Normal file
1
scripts/base/protocols/tunnels/__load__.bro
Normal file
|
@ -0,0 +1 @@
|
||||||
|
@load-sigs ./dpd.sig
|
14
scripts/base/protocols/tunnels/dpd.sig
Normal file
14
scripts/base/protocols/tunnels/dpd.sig
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Provide DPD signatures for tunneling protocols that otherwise
|
||||||
|
# wouldn't be detected at all.
|
||||||
|
|
||||||
|
signature dpd_ayiya {
|
||||||
|
ip-proto = udp
|
||||||
|
payload /^..\x11\x29/
|
||||||
|
enable "ayiya"
|
||||||
|
}
|
||||||
|
|
||||||
|
signature dpd_teredo {
|
||||||
|
ip-proto = udp
|
||||||
|
payload /^(\x00\x00)|(\x00\x01)|([\x60-\x6f])/
|
||||||
|
enable "teredo"
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue