mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
signatures: Fix ISO 9960 signature
This signature only really works when default_file_bof_buffer_size is bumped to a sufficient value (40k).
This commit is contained in:
parent
036bcfe919
commit
d2409dd432
4 changed files with 30 additions and 2 deletions
|
@ -297,8 +297,17 @@ signature file-windows-minidump {
|
||||||
file-magic /^MDMP/
|
file-magic /^MDMP/
|
||||||
}
|
}
|
||||||
|
|
||||||
# ISO 9660 disk image
|
# ISO 9660 disk image: First 16 sectors (2k) are arbitrary data.
|
||||||
|
# The following sector is a volume descriptor with magic string "CD001"
|
||||||
|
# at offset 1: 16 * 2048 + 1 = 32769
|
||||||
signature file-iso9660 {
|
signature file-iso9660 {
|
||||||
file-mime "application/x-iso9660-image", 99
|
file-mime "application/x-iso9660-image", 99
|
||||||
file-magic /CD001/
|
file-magic /^.{32769}CD001/
|
||||||
|
}
|
||||||
|
|
||||||
|
# ISO 9660 disk image, magic string match in next volume descriptor.
|
||||||
|
# 17 * 2048 + 1 = 34817
|
||||||
|
signature file-iso9660-2 {
|
||||||
|
file-mime "application/x-iso9660-image", 99
|
||||||
|
file-magic /^.{34817}CD001/
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
fuid source mime_type filename
|
||||||
|
FbxMVx2s9vO46GnVh2 HTTP application/x-iso9660-image myiso.iso
|
BIN
testing/btest/Traces/http/iso-download.pcap.gz
Normal file
BIN
testing/btest/Traces/http/iso-download.pcap.gz
Normal file
Binary file not shown.
16
testing/btest/scripts/base/files/mime/iso-9660.zeek
Normal file
16
testing/btest/scripts/base/files/mime/iso-9660.zeek
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# @TEST-DOC: Test ISO 9660 mime detection works with increased default_file_bof_buffer_size.
|
||||||
|
#
|
||||||
|
# @TEST-EXEC: zcat <$TRACES/http/iso-download.pcap.gz | zeek -b -r - %INPUT
|
||||||
|
# @TEST-EXEC: zeek-cut -m fuid source mime_type filename < files.log > files.log.cut
|
||||||
|
# @TEST-EXEC: btest-diff files.log.cut
|
||||||
|
|
||||||
|
@load base/protocols/http
|
||||||
|
@load base/frameworks/files
|
||||||
|
|
||||||
|
redef default_file_bof_buffer_size = 40000;
|
||||||
|
|
||||||
|
event file_over_new_connection(f: fa_file, c: connection, is_orig: bool)
|
||||||
|
{
|
||||||
|
if ( f$source == "HTTP" )
|
||||||
|
f$info$filename = split_string(c$http$uri, /\//)[-1];
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue