mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge remote-tracking branch 'origin/topic/johanna/tcp-padding'
* origin/topic/johanna/tcp-padding: Do not forward padding to downstream TCP packet analyzer
This commit is contained in:
commit
81ce83590d
8 changed files with 45 additions and 3 deletions
9
CHANGES
9
CHANGES
|
@ -1,3 +1,12 @@
|
||||||
|
6.1.0-dev.258 | 2023-08-03 07:18:21 +0100
|
||||||
|
|
||||||
|
* Do not forward padding to downstream TCP packet analyzer (Johanna Amann, Corelight)
|
||||||
|
|
||||||
|
This is similar to GH-3206. There do not seem to be practical
|
||||||
|
consequences - but we should still fix it.
|
||||||
|
|
||||||
|
This also includes the udp-testcase that was forgotten in GH-3206.
|
||||||
|
|
||||||
6.1.0-dev.256 | 2023-08-02 10:11:22 -0700
|
6.1.0-dev.256 | 2023-08-02 10:11:22 -0700
|
||||||
|
|
||||||
* Rename magic __bro_plugin__ file to __zeek_plugin__ (Tim Wojtulewicz, Corelight)
|
* Rename magic __bro_plugin__ file to __zeek_plugin__ (Tim Wojtulewicz, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
6.1.0-dev.256
|
6.1.0-dev.258
|
||||||
|
|
|
@ -130,8 +130,8 @@ void TCPAnalyzer::DeliverPacket(Connection* c, double t, bool is_orig, int remai
|
||||||
// Call DeliverPacket on the adapter directly here. Normally we'd call ForwardPacket
|
// Call DeliverPacket on the adapter directly here. Normally we'd call ForwardPacket
|
||||||
// but this adapter does some other things in its DeliverPacket with the packet children
|
// but this adapter does some other things in its DeliverPacket with the packet children
|
||||||
// analyzers.
|
// analyzers.
|
||||||
adapter->DeliverPacket(remaining, data, is_orig, adapter->LastRelDataSeq(), ip.get(),
|
adapter->DeliverPacket(std::min(len, remaining), data, is_orig, adapter->LastRelDataSeq(),
|
||||||
pkt->cap_len);
|
ip.get(), pkt->cap_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct tcphdr* TCPAnalyzer::ExtractTCP_Header(const u_char*& data, int& len, int& remaining,
|
const struct tcphdr* TCPAnalyzer::ExtractTCP_Header(const u_char*& data, int& len, int& remaining,
|
||||||
|
|
11
testing/btest/Baseline/core.tcp-padding/conn.log
Normal file
11
testing/btest/Baseline/core.tcp-padding/conn.log
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
#separator \x09
|
||||||
|
#set_separator ,
|
||||||
|
#empty_field (empty)
|
||||||
|
#unset_field -
|
||||||
|
#path conn
|
||||||
|
#open XXXX-XX-XX-XX-XX-XX
|
||||||
|
#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]
|
||||||
|
XXXXXXXXXX.XXXXXX CHhAvVGS1DHFjwGM9 167.221.30.181 59406 217.207.159.63 27272 tcp http 10.914549 16 191 SF F F 0 ShADadfF 13 704 12 823 -
|
||||||
|
#close XXXX-XX-XX-XX-XX-XX
|
11
testing/btest/Baseline/core.tcp-padding/http.log
Normal file
11
testing/btest/Baseline/core.tcp-padding/http.log
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
#separator \x09
|
||||||
|
#set_separator ,
|
||||||
|
#empty_field (empty)
|
||||||
|
#unset_field -
|
||||||
|
#path http
|
||||||
|
#open XXXX-XX-XX-XX-XX-XX
|
||||||
|
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p trans_depth method host uri referrer version user_agent origin request_body_len response_body_len status_code status_msg info_code info_msg tags username password proxied orig_fuids orig_filenames orig_mime_types resp_fuids resp_filenames resp_mime_types
|
||||||
|
#types time string addr port addr port count string string string string string string string count count count string count string set[enum] string string set[string] vector[string] vector[string] vector[string] vector[string] vector[string] vector[string]
|
||||||
|
XXXXXXXXXX.XXXXXX CHhAvVGS1DHFjwGM9 167.221.30.181 59406 217.207.159.63 27272 1 GET - / - 1.0 - - 0 6 200 OK - - (empty) - - - - - - Fftt1g15aiP3OV7YTf - -
|
||||||
|
#close XXXX-XX-XX-XX-XX-XX
|
BIN
testing/btest/Traces/tcp-http-with-padding.pcap
Normal file
BIN
testing/btest/Traces/tcp-http-with-padding.pcap
Normal file
Binary file not shown.
6
testing/btest/core/tcp-padding.zeek
Normal file
6
testing/btest/core/tcp-padding.zeek
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# Check that data contained in the ethernet padding does not make it into protocol analysis
|
||||||
|
|
||||||
|
# @TEST-EXEC: zeek -C -r $TRACES/tcp-http-with-padding.pcap %INPUT >out
|
||||||
|
# @TEST-EXEC: btest-diff conn.log
|
||||||
|
# @TEST-EXEC: btest-diff http.log
|
||||||
|
|
5
testing/btest/core/udp-padding.zeek
Normal file
5
testing/btest/core/udp-padding.zeek
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Check that data contained in the UDP padding does not make it into protocol analysis
|
||||||
|
|
||||||
|
# @TEST-EXEC: zeek -r $TRACES/fake-syslog-with-padding.pcap %INPUT >out
|
||||||
|
# @TEST-EXEC: btest-diff syslog.log
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue