Commit Graph

84270 Commits

Author SHA1 Message Date
Alexis La Goutte 83959f77e3 dfvm: Fix Dead Store found by Clang Analyzer 2022-04-16 18:15:45 +00:00
Matthias Dietrich 86bc544fd3 PROFINET: Fix count of IO data objects and IOCS
Split the counts of IO data objects and IOCS between
input and output. Remove increment of IO data objects
in station information, sometimes leading to extremely
high and invalid number of IO data objects.
2022-04-16 13:57:16 +00:00
Matthias Dietrich dcffa0303a PROFINET: Split number of IOCS between in and out
Currently a single counter is used, but the number of
IOCS is not necessarily the same for input and output
CRs.
2022-04-16 13:57:16 +00:00
Arne Schwabe c2c20a6f2d Implement parsing of OpenVPN tls-crypt packets
This implements parsing the packets in tls-crypt mode. Parsing is very
limited since tls-crypt encrypts the packets. Since detecting tls-crypt
is not easy apart from two tls-crypt-v2 specific opcodes, it is preference
that needs explicitly set.
2022-04-16 13:40:15 +00:00
Dylan Ulis 88719f0884 CIP Safety: Minor Refactoring, Part 2 2022-04-16 06:57:13 +00:00
João Valverde af878388fe dfilter: Fix scanning of strings
The code was ignoring a SCAN_FAILED return value.
2022-04-15 22:51:15 +01:00
Gerald Combs e364444b24 wslua: Update the menu group documentation.
Update to match ca04f4c8cb.
2022-04-15 21:30:50 +00:00
easonweii b4a15f8be3 BER: Add the length check of dissecting BER integers, int64, and booleans
Add the length check of dissecting BER integers, int64, and booleans, the expert info is added for bad lengths, includes the name of the field and actual length.
Related to #18005
2022-04-15 11:56:17 +00:00
Chuck Craft 98793186b9 CQL: format timestamp as microseconds (ENC_TIME_USECS)
Closes #18038
2022-04-14 19:08:55 +00:00
Gerald Combs b51a635bce BACapp: Fix a recusion check.
Make sure fAbstractSyntaxNType() always decrements its proto_depth on
exit. Fixes #18039.

Remove a no-longer-needed p_add_proto_data() call.
2022-04-14 18:16:42 +00:00
Chuck Craft 4e0cd3dbd2 epan: add ENC_TIME_USECS timestamp encoding
Needed to format timestamp in #18038 - packet-cql.c
Mirrors changes made in !1924 - Add ENC_TIME_NSECS timestamp encoding
Documentation in README.dissector, proto.c, proto.h - could use
refresh in a different merge request.
2022-04-14 15:18:30 +00:00
João Valverde cef02cc3a0 dfilter: Add max()/min() tests and documentation 2022-04-14 13:07:41 +00:00
João Valverde 827d143e6e dfilter: Allow function arguments to be non-existent.
Instead of not calling the function if an argument is non-existent
(read tree fails), call the function and let the function handle
the condition.
2022-04-14 13:07:41 +00:00
João Valverde cb2f085f14 dfilter: Add max() and min() functions
Changes the function calling convention to pass the first register
number plus the number of registers after that sequentially. This
allows function with any number of arguments. Functions can still
only return one value.

Adds max() and min() function to select the maximum/minimum value
from any number of arguments, all of the same type. The functions
accept literals too. The return type is the same as the first argument
(cannot be a literal).
2022-04-14 13:07:41 +00:00
John Thacker a372497a85 hierarchy stats: Include appendix length in byte counts
The byte counts in Protocol Hierarchy Stats should include
the appendix length. Fix #17913.
2022-04-14 12:26:04 +00:00
Gerald Combs 62a2fe28c2 wiretap: Try opening systemd journal files before IxVeriWave.
The Ixia IxVeriWave .vwr file reader's heuristics matched a journal file
here, so place the systemd journal before it in the list.
2022-04-13 17:04:25 -07:00
Gerald Combs 8528fca055 Falco Bridge: Misc cleanup.
Remove unused header definitions in packet-falco-bridge.h and move the
remaining content to packet-falco-bridge.c and conversation-macros.h.
Explicitly set our header files in CMakeLists.txt.
2022-04-13 13:51:06 -07:00
Dylan Ulis 943c38d606 CIP Safety: Minor Refactoring, Part 1 2022-04-13 20:48:41 +00:00
Dylan Ulis 3c25b69ff6 CIP: Correct DATE, DATE_AND_TIME type handling, Part 2 2022-04-13 20:22:29 +00:00
Dylan Ulis 234db3b48f CIP Safety: Display human readable timestamps 2022-04-13 20:04:40 +00:00
Pascal Quantin 50ada3d65c NGAP: workaround a gcc 10.2.1 compilation issue
Fixes #17858
2022-04-13 16:58:54 +02:00
Chuck Craft 55f7b27b35 tshark.adoc: update -z conv/endpoints descriptions 2022-04-13 12:58:14 +00:00
John Thacker 01239eb59d whois: Assume UTF-8, add an expert info
Move the assumption for WHOIS responses to UTF-8 (which is backwards
compatible with ASCII), and add an expert info regarding that
assumption. There is no indication for encoding in the protocol.
Using Show Packet Bytes is sufficient for most purposes, but someone
could add a preference if desired.
2022-04-13 12:29:12 +00:00
Moshe Kaplan 1e352c3e7b manpage: Fix grammar errors and improve phrasing
Quickly review of fixing common grammatical errors in
the man pages.
2022-04-13 03:39:56 +00:00
João Valverde 0dba7456aa tests: Remove leftover debug print 2022-04-13 01:15:11 +01:00
Gerald Combs bcc286f341 UI: Rename the qt_logwolf directory to logwolf.
We might want to split the Wireshark-specific UI code into ui/wireshark,
but that can be done at another time.
2022-04-12 19:37:30 +00:00
Gerald Combs ca04f4c8cb Qt: Update our dynamic menu groups.
Add log-specific statistics groups, and use them to limit the dynamic
menu items in Wireshark and Logwolf.
2022-04-12 12:14:03 -07:00
João Valverde 8746eea297 dfilter: Try to resolve field reference instead of using a heuristic
Instead of using a heuristic to decide whether the form ${...} is
a macro or not, try to resolve the name to a registered protocol
field and use that instead.

This increases somewhat the surface for clobbering existing macro
names with new field registrations but we'll cross that bridge when
we get to it.

Rejecting protocol field types reduces this probability again but it
may not be intuitive to the user trying to mistakenly use a reference
to a protocol why it is parsed as a macro. The reasons for rejecting
FT_PROTOCOL types as not interesting field references are not
very strong but it seems reasonable.

$ dftest 'frame.number != ${frame.number}'
Filter: frame.number != ${frame.number}

Instructions:
00000 READ_TREE		frame.number -> reg#0
00001 IF_FALSE_GOTO	5
00002 READ_REFERENCE	${frame.number} -> reg#1
00003 IF_FALSE_GOTO	5
00004 ALL_NE		reg#0 != reg#1
00005 RETURN

$ dftest 'frame != ${frame}'
dftest: macro 'frame' does not exist
2022-04-12 14:03:18 +00:00
João Valverde 8355e96858 tests: Add test for display filter field reference 2022-04-12 14:03:18 +00:00
João Valverde 04c42eace3 tshark: Add a --selected-frame option
Add a selected frame option that does pretty much what the name
indicates.

This is not meaningful in the CLI but is useful to simulate the
selected frame action in the GUI for unit testing purposes. The
option is not documented for that reason.

A selected frame is used in display filters with field references.

$ tshark  -r ../test/captures/dhcp.pcap
    1   0.000000      0.0.0.0 → 255.255.255.255 DHCP 314 DHCP Discover - Transaction ID 0x3d1d
    2   0.000295  192.168.0.1 → 192.168.0.10 DHCP 342 DHCP Offer    - Transaction ID 0x3d1d
    3   0.070031      0.0.0.0 → 255.255.255.255 DHCP 314 DHCP Request  - Transaction ID 0x3d1e
    4   0.070345  192.168.0.1 → 192.168.0.10 DHCP 342 DHCP ACK      - Transaction ID 0x3d1e

$ tshark --selected-frame=2 -2 -Y 'frame.number <= ${frame.number}' -r ../test/captures/dhcp.pcap
    1   0.000000      0.0.0.0 → 255.255.255.255 DHCP 314 DHCP Discover - Transaction ID 0x3d1d
    2   0.000295  192.168.0.1 → 192.168.0.10 DHCP 342 DHCP Offer    - Transaction ID 0x3d1d
2022-04-12 14:03:18 +00:00
John Thacker 7a3c2252f5 hierarchy stats: Only increment the total packet count once per frame
The same hierarchy of protocols can appear multiple times in a frame,
for example if there are multiple PDUs for a protocol that begin in
that frame. Keep track of the last frame where we incremented our
stat node and use that to only increment it once per frame.

Add a "total number of PDUs with this hierarchy" statistic and
display it as a new final column in the GUI. Update the User Guide.

In the purpose of doing this, get rid of temporary variables and
increment the ph_stats_t members directly, since we pass that
into our functions already, and thus have access to the current
packet count.

Fix #17553. Fix #18034. Fix #12565.
2022-04-12 13:38:33 +00:00
John Thacker 4c7865c81b whois, finger: Dissect at FIN (or after) on first pass
The WHOIS and finger dissectors wait to dissect at FIN, but they
need to actually dissect at FIN (or at reassembled out of order
segments after FIN) on the first pass instead of returning without
dissecting.

Only add data reassembled at FIN to the tree if it was actually
reassembled at the FIN frame; if it was reassembled in the first pass
at a later frame due to out of order segments, it will be added there.

In addition to fixing first pass dissection, this also fixes the
case where the FIN segment is the first segment with data. Fix #18037.
2022-04-12 08:29:48 -04:00
Chuck Craft 3aee6ce9d6 ACN/rdmnet: add protocol check to TCP heuristic 2022-04-12 09:29:47 +00:00
João Valverde 03e41d4950 ftypes: Fix a macro argument 2022-04-12 09:41:58 +01:00
Anders Broman 096947337e PER:Add function to add "PER encoded lable" to the tree. 2022-04-12 08:33:36 +02:00
João Valverde 09696f1762 Try to fix a narrowing warning
"C:\Development\wsbuild64\Wireshark.sln" (default target) (1) ->
"C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj.metaproj" (default target) (18) ->
"C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj" (default target) (108) ->
       (ClCompile target) ->
C:/Development/wireshark/epan/dfilter/scanner.l(463,54): warning C4267: '+=': conversion from 'size_t' to 'int
       ', possible loss of data [C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj]
C:/Development/wireshark/epan/dfilter/scanner.l(463,54): warning C4267:         state->location.col_start += sta
       te->location.col_len; [C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj]
C:/Development/wireshark/epan/dfilter/scanner.l(463,54): warning C4267:
                           ^ (compiling source file C:\Development\wsbuild64\epan\dfilter\scanner.c) [C:\Development\ws
       build64\epan\dfilter\dfilter.vcxproj]
2022-04-11 22:23:13 +01:00
João Valverde 2f02cd6e19 dfilter: Handle missing error location more gracefully
If we don't have an offset, don't print anything with underline.

Also it can underline filters using macros correctly now.

$ tshark -Y 'ip and ${private_ipv4:ip.sr}' -r /dev/null
tshark: Left side of "==" expression must be a field or function, not "ip.sr".
    ip and ip.sr == 192.168.0.0/16 or ip.sr == 172.16.0.0/12 or ip.sr == 10.0.0.0/8
           ^~~~~
2022-04-11 21:03:06 +00:00
Yu Gao ceef8aa8ee fix the indent 2022-04-11 19:39:11 +00:00
João Valverde 24443fa33a tshark: Add underline to dfilter errors
$ tshark -Y 'frame.number == 123foobar and ip' -r /dev/null
tshark: "123foobar" is not a valid number.
    frame.number == 123foobar and ip
                    ^~~~~~~~~
2022-04-11 19:25:37 +00:00
Gerald Combs fb3bdffaba Logwolf: Remove a bunch of packet-specific menu items.
Remove the following statistics and utility menu items and dialogs:

- 29West / lbmr
- ANCP
- BACnet / BACapp
- Credentials
- DCCP
- DNS
- Firewall rules
- HART-IP
- HPFEEDS
- HTTP
- HTTP2
- QUIC
- RSerPool
- SOME/IP
- Sametime
- Service response time
- TCP
- UDP
- UDP Multicast
2022-04-11 19:10:01 +00:00
Gerald Combs 3b8ea97731 Debian: Add missing symbols. 2022-04-11 11:41:17 -07:00
Gerald Combs 4b556d6bc6 Qt+epan: Get log conversation filters working.
In conversation_filter.h, add a separate log_conv_filter_list. Use it in
register_log_conversation_filter and add conversation_filter_from_log.
It looks like we no longer use find_conversation_filter externally, so
remove it from the API.
2022-04-11 17:26:50 +00:00
Gerald Combs 58e31a2e77 Qt: Try to fix missing translations.
After splitting MainWindow into WiresharkMainWindow and
LogwolfMainWindow, a bunch of translations were marked "vanished". Do
the following in an attempt to restore them:

$ grep -c vanished ui/qt/*.ts
ui/qt/wireshark_de.ts:534
ui/qt/wireshark_en.ts:7
ui/qt/wireshark_es.ts:407
ui/qt/wireshark_fr.ts:367
ui/qt/wireshark_it.ts:534
ui/qt/wireshark_ja_JP.ts:534
ui/qt/wireshark_pl.ts:414
ui/qt/wireshark_ru.ts:513
ui/qt/wireshark_sv.ts:526
ui/qt/wireshark_tr_TR.ts:534
ui/qt/wireshark_uk.ts:264
ui/qt/wireshark_zh_CN.ts:455

$ git checkout 1c9538624f^ -- ui/qt/*.ts

$ sed -i -e 's,<name>MainWindow</name>,<name>WiresharkMainWindow</name>,g' ui/qt/*.ts

[ comment out `tx pull -f` in tools/update-tx ]

$ ./tools/update-tx -n

$ grep -c vanished ui/qt/*.ts
ui/qt/wireshark_de.ts:7
ui/qt/wireshark_en.ts:7
ui/qt/wireshark_es.ts:0
ui/qt/wireshark_fr.ts:5
ui/qt/wireshark_it.ts:7
ui/qt/wireshark_ja_JP.ts:7
ui/qt/wireshark_pl.ts:6
ui/qt/wireshark_ru.ts:7
ui/qt/wireshark_sv.ts:7
ui/qt/wireshark_tr_TR.ts:7
ui/qt/wireshark_uk.ts:2
ui/qt/wireshark_zh_CN.ts:6

$ ./tools update-tx

[ uncomment `tx pull -f` in tools/update-tx ]
2022-04-11 17:01:17 +00:00
Gerald Combs bd6ee4479f Tools: Make the Debian and RPM setup scripts more strict.
We use debian-setup.sh and rpm-setup.sh to build the containers in
https://gitlab.com/wireshark/wireshark-containers/. Make sure they fail
with a nonzero exit status, otherwise we might end up with an invalid
container image.

Make sure OPTIONS is defined in all of the setup scripts that use it.
2022-04-10 16:05:42 -07:00
Dylan Ulis 3890d822ba macOS Homebrew: Install PCRE2 2022-04-10 22:09:55 +00:00
Gerald Combs 1c9538624f [Automatic update for 2022-04-10]
Update manuf, services enterprise numbers, translations, and other items.
2022-04-10 19:23:47 +00:00
João Valverde 4d9470e7dd dfilter: Add location tracking to scanner and use it to report errors
Add location tracking as a column offset and length from offset
to the scanner. Our input is a single line only so we don't need
to track line offset.

Record that information in the syntax tree. Return the error location
in dfilter_compile(). Use it in dftest to mark the location of the
error in the filter string. Later it would be nice to use the location
in the GUI as well.

$ dftest "ip.proto == aaaaaa and tcp.port == 123"
Filter: ip.proto == aaaaaa and tcp.port == 123
dftest: "aaaaaa" cannot be found among the possible values for ip.proto.
	ip.proto == aaaaaa and tcp.port == 123
	            ^~~~~~
2022-04-10 10:09:51 +01:00
João Valverde da19379eb5 dfilter: Create the syntax node in the scanner and pass that
Revert to passing a syntax node from the lexical scanner to the grammar
parser. Using a union is not having a discernible advantage and requires
duplicating a lot of properties of syntax nodes.
2022-04-10 09:54:03 +01:00
Matthias Ringwald d23fec2116 bluetooth: show packet status in info column 2022-04-09 22:57:34 +02:00
Matthias Ringwald 50de7dd6ca bluetooth: show SCO packet type in col_protocol 2022-04-09 19:10:44 +02:00