I'm using Wireshark Packet analyzer & when I filter for all Websocket packets I see what I am sending to a host & receiving from the host. When I check individual packets mine always show as [MASKED], but it does have a 'Umask Payload' which shows my data in clear text that looks like:

<IC sid="52ccc752-6080-4668-8f55-662020d83979" msqid="120l93l9l114l30l104"/>

However, if I 'Follow TCP stream & look at that same packet, the data shows up as encoded like this:

....K#....../...y@..|...}...f...s...~...}...{G..r...kN.."G..z...r...'...'...z...d.

The problem is all the websocket packets I receive from the host come as encoded & I can't figure out any way to decode them, I have no idea what they are even encoded as (but my browser understands them).

I'm assuming (I may be wrong) that whatever method they are coming back to me as encoded data is the same encoding that my data looks like when I 'Follow TCP stream' Can someome please help me with what is being used to encode/decode this so I can understand the data the host is sending me?

eg:

~.^jVpZc9y4Ef4ryFQ5+yJpeB+JJJdmNPI6G++mrN249kkFkuChIQmG5Fgj//p0AyAJypzxyi5T6P76
QKPRuHz9cUu6IrlZuVYcx75rXXpGYFw6nhdcBqnrXnqeZVhGEtihH65Id7NKWEoPZb8iVfc/FDQt
owztMixN0yltozQNZ3V7ncZkbxrAXZE8vFkZK2g66msJchLIjyuoiWQmvvyApGUY+JsJKPGLkrIF
IHcFALVJNXtTWsl9adMDPlAtQ1AZME0XvoFsShDz5McVn0J6y2z5ceTHlB9pnEltheQVEllIXiGR
z7Ifz6Cz4c2h6XkDLTDUFlkOQYuk/5EUimTnIykUyc5HoeTJjlHVMgWPwifv++Yf6/XLy8uVadlp
Sbs8zml/FfMKAKA4Z2WzLuqEHa/yviqBCEZXJJXeUzC25c2rcIhAEM1LyzBt8jtvtp8+kUee9i+0
ZWTL2+aKkLuyJJ8R2pHPrGPtV5ZcgRIXNVLoF6vh62tpkToy9LIzexnxvRydWEY8lhGPZRxjGccY
IDBEezkMsZSLlRZLtmQQYhm8WCBvr2lAMhFVyDqPpKDmPy1Pi5KtSGaM4Xrlh/aFRV3Rs3Uj+VdN
3rw/QJ9u3v3xuPv8DhSsUw/+ocHtdeKRDNz0wF4GfjpesJrM+CQDx5AC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bFMMeT
9CTwyOgcZdpLqEaew3SgFSwAN5wqxyL4bQHwiVHop4RU4vclc3A2Ge11srEIg0nPaJwPQNVc8usV
X0/J2NuO0a5ImI4UVwuPv3z89enu8+ffvpCvFKYgFJq2nXyc2LiG3l7H+R6yH/9PjGGw0LfTyLGN
0Ehdzw4DM6apZaXM8pMA/+NMfLNyXc+IAwcgIaNBEDhmStPYMSPT9izHSMA5QCUA8tMoCFxGHWpa
phn5lhVYNAlTljoueiItwy8ft7f/Bw==

Most web traffic now is encrypted with SSL. It's nice that Wireshark can determine the decryption certificate to use from the stream, which is why it can turn it into plain text (unmask it). That is also how your browser knows what to do to decode it into a real web page. When your browser makes a connection with an https url, it sends it's public key to the site, which uses that to encrypt the page data before sending it to you. Then your browser uses your private key to decrypt it. Without your private key, no one should be able to see what you are doing! That's what malware trojans do to compromise you - they can steal your private keys!

commented: It's not ssl, so i reposted because you didn't give me the right answer. +0

The https protocols use the secure sockets library (ssl) to do the encryption. What did YOU think the answer was? Read this article, and cancel your downvote: https://en.wikipedia.org/wiki/HTTPS - and fyi, this IS my business and career.

commented: The website in question does NOT use https, so I dont see why you keep saying https? What makes you so sure it is ssl encoded? U gave 2 downvotes +0

The website in question does NOT use https, so I dont see why you keep saying https? What makes you so sure it is ssl encoded?

If you are talking to a web site, and the data stream is encoded (encrypted), then it is likely using https (ssl/tls). Why do you say it isn't? You have not said anything to change my mind about that.

Ok. We are having an argument that is going nowhere, mostly because you have not told me anything to change my mind about the use of ssl/https/tls for these so-called "web sockets". You either need to be much more forthcoming, or find some other sucker to punch... :-(

So, don't bother me with this any further. Find another sucker, or figure it out on your own!

I'm very late to the discussion, but I think I should clarify this for anybody else who finds this - this is not SSL encryption! WebSockets uses a simple cipher (an XOR mask) on some packets for legacy reasons, so the payload is not in cleartext if you look at the raw packet data. But the cipher key is stored in the packet itself (the "Masking-Key" field in the WebSocket header) so Wireshark is easily able to decipher that and display the unmasked payload when looking at individual packets.

However, when using the "Follow TCP Stream" feature, Wireshark will only show the raw packet data for masked packets (and still does, 7 years later), so unfortunately you cannot see the unmasked packet data in that window.
I haven't found a way to do that yet, but it is certainly possible to contribute it as a new feature, since Wireshark is open-source!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.