Commit Graph

90536 Commits

Author SHA1 Message Date
Niels Widger 8989c732fc sharkd: Increase JSON buffer size from 2048 to 8192 bytes
This commit increases the maximum size for the JSON commands processed
by `sharkd` from 2048 to 8192 bytes.  The primary reason for this
change is to allow larger filters in `filter0`...`filter9` arguments
which, combined with the outer JSON boilerplate, can cause a command
to quickly hit the existing 2048-byte limit.
2024-02-27 08:42:53 +00:00
John Thacker d22842f662 Qt: Add case sensitive find to Follow Stream and Show Packet Bytes
Add a check box for case sensitivity when finding in follow stream
and show packet bytes.

Note that QPlainTextEdit::find() has a bit unexpected behavior with
QRegularExpression (https://bugreports.qt.io/browse/QTBUG-88721).
Searches are case-insensitive by default there too, respecting
the default options. This is a change from the older QRegExp, where
the option to find was ignored, and only the regex option was used,
so for the last few releases regexp searches have been case-insensitive
as well by default. (?-i) has been available to mode switch.

We might want to move the various keyboard handling from
FollowStreamDialog and ShowPacketBytesDialog and instead have
FindLineEdit install shortcuts on the parents when constructed.
That would be a little cleaner separation.

We might also want to move the buttons and label to a separate
composite widget class, that signals the parent to start a
find.

Fix #3784
2024-02-26 22:16:41 +00:00
John Thacker 3540bbc969 GSSAPI: Avoid dissecting checksum in signed-only KRB_TOKEN_CFX_WRAP
In KRB_TOKEN_CFX_WRAP (RFC 4121), for signed-only Wrap tokens
("Wrap tokens without confidentiality"), the plaintext is followed
by the checksum, unlike in other implementations where the all
the GSSAPI bits, including the checksum, precede the plaintext.

For those cases, the calling dissector cannot simply dissect
the entire original tvb after the returned offset, as it's not
all plaintext. Instead, place the plaintext without checksum
subset in gssapi_decrypted_tvb and return it to the caller.
In these cases, gssapi_data_encrypted will be set to FALSE, to
allow dissectors that wish to distinguished signed-and-sealed
from signed-only. For dissectors that do not care to distinguish
the cases, this requires no change.

Update the documentation in the GSSAPI header to describe this.

Fix #9398.
2024-02-26 16:58:09 +00:00
John Thacker 09f6a3aaa6 Qt: copy correct hidden state to device
The IFTREE_COL_HIDDEN is in fact a "Show" column (should the
names be changed?) so when saving the data the hidden state
is the opposite of the checked status.

We were doing the inverted logic when writing to the preferences,
but not when changing the device interface_t struct directly.
However, before 6e12e504b9
we always re-read the hidden state from the preferences after
changing it in the Manage Interfaces Dialog, so this bug wasn't
exposed until we stopped doing that and used the current status.

Fix #19672
2024-02-26 16:27:15 +00:00
Stefan Metzmacher 4d6941caa6 hipercontracer: don't consume LDAP/SASL/KRB_TOKEN_CFX_WRAP messages
See the capture in #9398 for an example.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2024-02-26 13:40:42 +00:00
Zoran Bošnjak 33c9657365 asterix: adjust to upstream change
Structure change in asterix-specs, revision 3ab3bb3.
Rule type is generalized and it now also includes a default value.
2024-02-26 09:22:51 +01:00
Martin Mathieson e0300eaed8 Fix lots of spellings 2024-02-25 22:46:47 +00:00
Gerald Combs eb706e9b84 [Automatic update for 2024-02-25]
Update manuf, services enterprise numbers, translations, and other items.
2024-02-25 17:08:05 +00:00
Eugène Adell 2744c7e7d0 doc: remove redundant section 2024-02-25 16:38:38 +00:00
Patrik Thunström 30c0ab964f CSV Export: Last column no longer exported when hidden.
Prior to fix the last column no matter if hidden or not was
always included when exporting packet dissections to CSV.

Fixes #19666.
2024-02-25 00:07:45 +01:00
John Thacker c0288ca829 Qt: Only set Packet List style sheet when relevant prefs change
Add a colorsChanged signal/slot, more precise than the generic
preferencesChanged signal, and only call it when one of the
color related preferences have changed. Connect it to the
packetList::colorsChanged() function, instead of calling that
whenever preferencesChanged() is called. We could eventually
move the signals and slots some of the other GUI widgets to this.

Send that signal before handling preferences that change
dissection and freeze the packet list, so that when we
restore the column widths due to Qt bug 122109 it takes effect.

The packet_list_hover_style preference affects colors, not
the layout, despite its presence in the GUI layout module.
2024-02-24 11:59:05 -05:00
John Thacker ea38f142e8 Qt: Work around QTBUG-122109 when applying packet list style sheet
https://bugreports.qt.io/browse/QTBUG-122109

A bug introduced by the fix for https://bugreports.qt.io/browse/QTBUG-116013
causes all visible sections to reset to the default section size whenever a
style sheet is applied (even if defaultSectionSize didn't change.)

Make sure that before applying a style sheet we prevent our recent
column widths from being updated, and then restore column widths
from the recent values afterwards.

This affects versions 6.5.4 (commercial only, 6.5.3 is the last free
release) and 6.6.1 and 6.6.2.
2024-02-24 09:59:25 -05:00
John Thacker e5e0797bd5 Qt: If no preferences have changed, don't signal
Enforce the requirement, already mentioned in the headers,
that preference and preference module effect flags must be
nonzero so that the application knows that a preference has changed.
(Lua, for example, needs this.)

Use this and avoid sending the PreferencesChanged signal when
preferences have not changed.
2024-02-24 08:37:08 -05:00
Martin Mathieson 63d6edbd3e thrift: make some functions static 2024-02-23 22:44:16 +00:00
John Thacker 92573aad71 RNSAP: Dissect IMSI 2024-02-23 20:08:41 +00:00
John Thacker 62e8882701 SCCP: Use register_dissector_preference
Switch SCCP's default payload preference from a string to validated
dissector name preference, added in 2f1392169a
2024-02-23 14:50:50 +00:00
John Thacker e5168435b5 dfilter: Add functions to override field base
Add field expression functions to convert unsigned integer
and char fields to hex or decimal. (BASE_OCT is handled
somewhat different currently now, presumably because it
can't be used in filters, so leave that commented until
it is handled as a display representation.)

Currently string() always converts unsigned integers to their
decimal representation so it is the same as dec(), but possibly in
the future string() might use the native base.

These can be used in columns thanks to the fix for #15990

Fix #5308
2024-02-23 13:31:44 +00:00
John Thacker ac90d8c834 Inject TLS Secrets: Check for NULL used secrets map
The GUI menu item should probably be disabled without a capture file
too.

Fix #19667
2024-02-23 07:56:18 -05:00
Martin Mathieson 5239b6bc8d Look into some items where VALS doesn't fit in mask 2024-02-23 11:52:11 +00:00
Uli Heilmeier 54b52063c5 falcodump: add missing AWS regions 2024-02-23 09:48:43 +00:00
hidd3ncod3s Sec a5dee645cf DNSCrypt: Add support to parse DNSCrypt Initial DNS request 2024-02-23 09:00:32 +00:00
John Thacker a65cce3c70 extcap: Use extcap.cfg as extcap config file name
"extcap" by itself can be the name of a directory that stores
extcap programs, especially if the default profile is being
used. Add an extension to the default file name so it doesn't clash.

Follow up to 4fb2ef8af8
2024-02-23 08:18:20 +00:00
Gerald Combs 0eb0d6fdb4 ICMPv6: Add a recursion check
Fix

```
wireshark/epan/dissectors/packet-icmpv6.c:1709:1: warning: function 'dissect_icmpv6_nd_opt' is within a recursive call chain [misc-no-recursion]
 1709 | dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
      | ^
wireshark/epan/dissectors/packet-icmpv6.c:1709:1: note: example recursive call chain, starting from function 'dissect_icmpv6_nd_opt'
wireshark/epan/dissectors/packet-icmpv6.c:2247:30: note: Frame #1: function 'dissect_icmpv6_nd_opt' calls function 'dissect_icmpv6_nd_opt' here:
 2247 |                 opt_offset = dissect_icmpv6_nd_opt(tvb, opt_offset, pinfo, icmp6opt_tree);
      |                              ^
wireshark/epan/dissectors/packet-icmpv6.c:2247:30: note: ... which was the starting point of the recursive call chain; there may be other cycles
```
2024-02-23 03:36:20 +00:00
Gerald Combs 5a04c4ecee DHCPv6: Add a recursion check
Fix

```
wireshark/epan/dissectors/packet-dhcpv6.c:1846:1: warning: function 'dhcpv6_option' is within a recursive call chain [misc-no-recursion]
 1846 | dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
      | ^
wireshark/epan/dissectors/packet-dhcpv6.c:1846:1: note: example recursive call chain, starting from function 'dhcpv6_option'
wireshark/epan/dissectors/packet-dhcpv6.c:2052:28: note: Frame #1: function 'dhcpv6_option' calls function 'dhcpv6_option' here:
 2052 |             temp_optlen += dhcpv6_option(tvb, pinfo, subtree,
      |                            ^
wireshark/epan/dissectors/packet-dhcpv6.c:2052:28: note: ... which was the starting point of the recursive call chain; there may be other cycles
wireshark/epan/dissectors/packet-dhcpv6.c:2958:1: warning: function 'dissect_dhcpv6' is within a recursive call chain [misc-no-recursion]
 2958 | dissect_dhcpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
      | ^
```
2024-02-23 03:26:34 +00:00
Gerald Combs 1515b211e2 SMB2: Add recursion checks 2024-02-22 18:50:24 -08:00
Brian Sipos 40b210e1d6 cose: Peek ahead for map principal value before dissecting map items
This change updates references to obsoleted RFCs and I-Ds,
provides human-readable interpretation of kid values, and fixes
the text encoding type in proto_tree_add_cbor_tstr().

Fixes #19659
2024-02-23 00:12:00 +00:00
Patrik Thunström 8f49a831cf ptp: Corrected data type for cumulativeScaledRateOffset.
Aligning the data type with the 802.1AS specs the data type is
now INT32 instead of UINT32.
Also added a generated field where the scale and offset is removed
to easier interpret the actual accumulated rate ratio.
2024-02-22 23:19:59 +00:00
Martin Mathieson c72fc5b163 Fix some spelling errors 2024-02-22 20:28:19 +00:00
John Thacker b5ffe3deac QUIC: Handle early 1-RTT data from server
For our test in check_dcid_on_coalesced_packet, check the *last*
QUIC packet in the frame so far, not the first packet in the
frame.

Only create the quic_packet structure after checking for a coalesced
packet, so that the last QUIC packet in the frame is the previous
one, not the current one.

What happens if 0-RTT packets are lost and resent?  There's an
alternative suggestion featuring checking if the ciphers are
initialized on the first pass that might work too, but if we
did that, what happens if the server Handshake is fragmented,
reassembled, and the server sent some "0.5-RTT" data after the
last fragment but then had to resend a different Handshake fragment
later? We'd still get some 1-RTT data before the handshake was done.

Fix #19665 while still not upsetting #19503.
2024-02-22 19:20:28 +00:00
John Thacker 00c938b7a9 OSITP: Pass ED-TPDU to subdissectors
Fix #7393
2024-02-22 09:49:55 -05:00
Jaap Keuter ff23d579de SNMP: Add support for RFC 5343
Add identification of the 'local engine' format.
2024-02-22 04:54:44 +00:00
marmonier_c 25487eceef feat(#19647): decode Datum enum and Ver field
Use RFC 6225 (obsoletes RFC 3825)
2024-02-22 04:52:56 +00:00
marmonier_c 1703eea653 feat(#19647): decode resolution fields 2024-02-22 04:52:56 +00:00
marmonier_c f501c57fc3 feat(#19647): check longitude and latitude max value 2024-02-22 04:52:56 +00:00
marmonier_c 5e9e75537a fix(#19647): correction of fractional calculations
Altitude dissector added
2024-02-22 04:52:56 +00:00
Anders Broman ac9ff53c7a LUA: Pickup LUA 5.3 or 5.4 if available and use it. 2024-02-22 04:48:23 +00:00
Gerald Combs 8b0e90d62e AllJoyn: Add recursion checks 2024-02-22 00:27:48 +00:00
Gerald Combs 34c90f7a3d 6LoWPAN: Add recursion checks 2024-02-21 14:36:18 -08:00
John Thacker 302eb58770 GTP: Fix filtering of UL/DL items
The uplink and downlink bit rate items, and the maximum SDU size,
are contained in a single octet but added to the tree using
proto_tree_add_uint_format[_value] after multiplying by various factors,
so the values don't actually fit in a FT_UINT8. The fields need
to be large enough to fit the largest value added after transformation.

The filter engine won't allow filters for values outside the field
range, e.g.

$ ./run/dftest -s 'gtp.qos_max_sdu_size == 1500'
Filter:
 gtp.qos_max_sdu_size == 1500

Error: "1500" too big for this field, maximum 255.
  gtp.qos_max_sdu_size == 1500
                          ^~~~

After:

$ ./run/dftest -s 'gtp.qos_max_sdu_size == 1500'
Filter:
 gtp.qos_max_sdu_size == 1500

Syntax tree:
 0 TEST_ANY_EQ:
   1 FIELD(gtp.qos_max_sdu_size <FT_UINT16>)
   1 FVALUE(1500 <FT_UINT16>)

Instructions:
 0000 READ_TREE        gtp.qos_max_sdu_size -> R0
 0001 IF_FALSE_GOTO    3
 0002 ANY_EQ           R0 == 1500
 0003 RETURN
2024-02-21 21:07:22 +00:00
Anders Broman f9e052b88e LUA: Make it compile with LUA 5.4 2024-02-21 21:06:00 +00:00
Anders Broman 926344c16c LUA bitop: Convery our lua_bitop.c to work with 5.3 and 5.4
The code is written by Andrew Engelbrecht and found here:
https://github.com/LuaJIT/LuaJIT/issues/384
2024-02-21 21:01:34 +00:00
Gerald Combs 282bd19e88 TN5250: Add a recursion check 2024-02-21 20:27:07 +00:00
Gerald Combs f8af3cd410 Add Clang-Tidy suppressions to various dissectors
Add NOLINTNEXTLINE suppressions for some existing recursion checks.
2024-02-21 11:41:01 -08:00
Gerald Combs 7183ac40da MONGO: Add a recursion check 2024-02-21 11:09:13 -08:00
John Thacker 722816c68e dfilter: Handle 64-bit extended value strings
Allow matching against 64-bit extended value strings the same
way as other value strings.

The IAX2 sample capture on the Wiki is a good test of this. Previously
the matches operator would never match, and comparison operators we not
allowed.

Before:

$ ./run/dftest -s 'iax2.voice.codec == "GSM compression"'
Filter:
 iax2.voice.codec == "GSM compression"

Error: "GSM compression" cannot be found among the possible values for iax2.voice.codec.
  iax2.voice.codec == "GSM compression"
                      ^~~~~~~~~~~~~~~~~

After:

$ ./run/dftest -s 'iax2.voice.codec == "GSM compression"'
Filter:
 iax2.voice.codec == "GSM compression"

Syntax tree:
 0 TEST_ANY_EQ:
   1 FIELD(iax2.voice.codec <FT_UINT64>)
   1 FVALUE(2 <FT_UINT64>)

Instructions:
 0000 READ_TREE        iax2.voice.codec -> R0
 0001 IF_FALSE_GOTO    3
 0002 ANY_EQ           R0 == 2
 0003 RETURN
2024-02-21 09:25:14 -05:00
winprotocolwireshark 2f6833b5f7 SMB2: Update reserved field and add new dissection
Added dissection for FSCTL_REFS_STREAM_SNAPSHOT_MANAGEMENT Request
Add FileFullEaInformation flags
Update SMB2 lock response field unknown to reserved.
Update flush request/response reserved fields.
2024-02-21 12:47:06 +01:00
John Thacker fea3d36a7b extcap: Allow starting from extcap config
Rework the changes from 428f222853
a little bit to restore the ability to start a capture from
the extcap options dialog.

When the the dialog is opened for configuration, present both the
Save and the Start button. Continue to only have Start when the
dialog was spawned because the user wanted to start a capture
but a mandatory parameter was not configured.

Use the default QDialogButtonBox "Discard/Close without Saving"
button when closing the dialog without saving the user input
for new preferences.

Fix #19199
2024-02-21 08:02:15 +00:00
John Thacker 942d7f4b41 R-GOOSE: Strengthen heuristic for CLTP on UDP
Reduce false positives of the CLTP on UDP dissector (RFC 1240)
by looking at the parameters as well and also ruling out length
indicator zero.
See https://ask.wireshark.org/question/31455/i-see-a-malformed-packet-in-wireshark-from-a-google-ip-address-on-port-2400-using-r-goose-protocol-what-could-this-be/

RFC 1240 was rendered Historic by RFC 2556, which noted that
"at this time there do not seem to be any implementations" and
recommended TPKT (ISO on TCP) instead.

However, R-GOOSE does use RFC 1240. In practice, it seems like
R-GOOSE uses the IANA registered port for ISO-TSAP, 102, just like
TPKT does on TCP. Perhaps we should register the dissector to that
port instead of a heuristic dissector if someone can confirm that.

Move the dissector from goose to ositp. This doesn't cause any
preference issues because heuristic dissectors are saved in the
preference file by name and the name won't change.
2024-02-21 07:59:55 +00:00
John Thacker 339d6d4aba text2pcap: Set encapsulation to WIRESHARK_UPPER_PDU with -P
The documentation, both man page and help, claims that text2pcap
automatically sets the encapsulation to WIRESHARK_UPPER_PDU if
-P is given. Make the behavior match the documentation.
2024-02-20 23:01:04 -05:00
Darius Davis c99e37131b TPNCP: Fix two potential array overruns.
The TPNCP dissector depends upon a resource file, tpncp.dat, being loaded
during initialization.  If a non-default tpncp.dat was used, the TPNCP
dissector could potentially perform some operations beyond the bounds of a
fixed-size array while loading tpncp.dat.

If a non-default tpncp.dat was used and an attempt was made to dissect
malformed TPNCP traffic, the TPNCP dissector could potentially perform a read
beyond the end of an array.

This change adds explicit bounds-checks to eliminate these possible OOB
accesses.

There is zero chance of this being triggered in a default unmodified
installation of Wireshark: Loading of the tpncp.dat file is conditional on a
preference setting which defaults to FALSE, and even if it is configured to
TRUE, the included tpncp.dat does not trigger either of these OOB operations.
It still seems worthwhile to make the parser and dissector generally more
robust.
2024-02-21 12:45:19 +10:00