1 | initial version |
The answer is yes! Wireshark will be happy to decode the bencoding, and interpret those packets as bt-dht. However, you need to tell Wireshark to do it.
Here is what to do:
udp.port == 51413
(or whichever port your client uses) will ensure that the list contains only BitTorrent packets.From there, it's pretty straightforward to explore.
The fields of the BT-DHT are given in the Display Filter Reference pages for BitTorrent DHT Protocol.
From the "Type" column on this page, you can determine how to build display filters for DHT packets. A field which has Type of "Label" cannot be used with ==
or other operators. You can only search for its presence: bt-dht.peer
finds packets which contain Peer fields, probably as a response to a request. A field which has the type of "string" can be compared using quoted strings, or unquoted hex for a binary string value: bt-dht.bencoded.string == 64230fc9afbef7ff8d7986403109b408d1360c15
finds packets containing a binary string which is represented as that hexadecimal value. In my case, it is the infohash of a torrent I want to share.
Using display filter expressions in a similar way, you can colour packets according to different stages in the DHT protocol. But that is a topic for a different note.
This worked for me in both Wireshark 1.2.8, installed from macports and running under X11, and Wireshark 2.6.7, installed as a Mac app downloaded from wireshark.org. In both cases my OS is macOS 10.11 El Capitan.