Ratatouille
Ratatouille

Reputation: 1452

Get weird response for Bittorrent handshake

I been trying to make a Handshake request to the peer and although the I successfully getting the handshake response back.

For some reason data after the handshake response look weird.

Let me explain

Here is the handshake request

\x13BitTorrent protocol\x00\x00\x00\x00\x00\x00\x00\x00\x01G{\x96\er\xDB\x9Cd\x14O\xFCj\r/\x8D\xA7\xAE\xAE\xF166788486352714431784

and I'm getting a handshake response that look like this

\x13BitTorrent protocol\x00\x00\x00\x00\x00\x10\x00\x00\x01G{\x96\er\xDB\x9Cd\x14O\xFCj\r/\x8D\xA7\xAE\xAE\xF1-TR2840-e5rk4p002er6

Now here what making be baffled I read the next 200 bytes from socket

and I see this

\x00\x00\x00-\x14\x00d1:md6:ut_pexi1ee6:yourip4:o}\xD1)4:reqqi255ee\x00\x00\x00\x96\x14\x00d1:ei1e4:ipv616:$\x00a\x80\x01\x00\x00\xD0\x00\x00\x00\x00\x02\xA40\x011:md11:ut_metadatai3e6:ut_pexi1ee13:metadata_sizei166e1:pi51413e4:reqqi512e11:upload_onlyi0e1:v17:Transmission 2.

Assuming \x00\x00\x00- is the length of the (according to message structure of Bittorrent)

and "\x14" is the message_id = 20

But looking at the bittorrent protocol specification I fail to find a message with ID 20

I'm kind of stuck here and don't know where to proceed any help will highly appreciate.

Upvotes: 2

Views: 464

Answers (1)

the8472
the8472

Reputation: 43042

The remote peer is showing non-compliant behavior. It is sending a extended handshake even though you have not signaled the capability in the reserved bitfield.

-TR2840-

This indicates that it is transmission 2.84. If it also occurs with current transmission versions I would report a bug to them. If it only occurs with old versions I would not bother handling this situation and just drop the connection.

Upvotes: 1

Related Questions