This page has been robot translated, sorry for typos if any. Original content here.

Basics of Java chat.

The information is related only to Volano's Java chat, other vendors' chats may work using a different protocol, although the principle of data exchange is probably the same. This information was not obtained from the documentation but by the method of tracking connections and TCP packets. Used tools such as IP-Tools v2.07 and Network Spy v2.0

HTML snippet embed applet:

<code>&lt;base href=http://www.zerkalo.com/vcclient/ /&gt;&lt;br&gt; &lt;applet codebase=. archive=COM/volano/VolanoChat.jar code=COM.volano.VolanoChat.class width=150 height=60&gt;&lt;br&gt; &lt;param name=cabbase value=COM/volano/VolanoChat.cab&gt;&lt;br&gt; &lt;param name=color value=#ffffff&gt;&lt;br&gt; &lt;param name=group value="MTR Chat Server"&gt;&lt;br&gt; &lt;param name=text value=english.txt&gt;&lt;br&gt; Извините ваш браузер не поддерживает JAVA или она увас отключена.&lt;br&gt; &lt;/applet&gt;</code>

As you can see, the name of the MTR Chat Server chat group is passed as a parameter. In addition, the resource file is loaded from the server english.txt ( see ). The server also has a French-language analogue french.txt ( see ). These files contain applet settings and string constants.

After reviewing the settings file, I found several more files (listed in english.txt ), the contents of which may also seem interesting: BannerPlayer.txt (a list of banners that will be loaded into the applet), LogoPlayer.txt (link to the logo displayed on the front panel of the applet ), version.html , help.html , inde.htm , unable.html , document.html , host.html (user manuals, chat versions, error message, etc.).

Well, the most interesting file is of course password.html . Unfortunately, you just can not access it. If I can read it, I’ll post a link to it here.

Based on the analysis of the english.txt file, it can be concluded that there are users with admin rights in the chat, and such operations as deleting and blocking users, and also probably deleting messages, are available to them. This is evident from the following fragment of the english.txt file:

text.menu.people.remove = Remove% 0
text.menu.people.kick = Kick% 0
text.menu.people.ban = Ban% 0

In addition, it is clear that in the chat there is a registration and registered nicknames password protected.
Registered users have a profile.

After launch, the chat applet communicates with the host where the chat server is located (for this chat it is 193.124.133.54 ). Communication is carried out by TCP protocol. The socket opens once when the applet is launched and closes when it completes. Thus, the local and remote ports remain constant throughout the session. The applet opens a socket on port 8000 of the server.

I will give a dump of the main packet of the request for entry into the chat group (this packet is sent by the applet to port 8000 of the server):

 0000 20 53 52 43 00 00 44 45 53 54 00 00 08 00 45 00 .SRC..DEST .... E.
 
  0010 00 EB 11 11 40 00 80 06 E9 70 D4 09 E4 CE C1 7C .... @ .... p ..... |
 
  0020 85 36 04 72 1F 40 00 2A 83 F5 AA E8 56 5A 50 18 .6.r @. * .... VZP.
 
  0030 08 60 81 8C 00 00 00 11 43 4F 4D 2E 76 6F 6C 61. `.... .. COM.vola
 0040 6E 6F 2E 41 63 63 65 73 73 00 00 00 01 00 0F 4D no.Access .... .. M
 0050 54 52 20 43 68 61 74 20 53 65 72 76 65 72 00 05 TR.Chat.Server ..

 0060 32 2E 31 2E 30 00 20 68 74 74 70 3A 2F 2F 77 77 2.1.0 .. http: // ww
 0070 77 2E 7A 65 72 6B 61 6C 6F 2E 63 6F 6D 2F 76 63 w.zerkalo.com/vc
 0080 63 6C 69 65 6E 74 2F 00 20 68 74 74 70 3A 2F 2F client / .. http: //
 0090 77 77 77 2E 7A 65 72 6B 61 6C 6F 2E 63 6F 6D 2F www.zerkalo.com/
 00A0 76 63 63 6C 69 65 6E 74 2F 00 0F 4D 69 63 72 6F vcclient / .. Micro
 00B0 73 6F 66 74 20 43 6F 72 70 2E 00 19 68 74 74 70 soft.Corp.  .. http
 00C0 3A 2F 2F 77 77 77 2E 6D 69 63 72 6F 73 6F 66 74: //www.microsoft
 00D0 2E 63 6F 6D 2F 00 05 31 2E 31 2E 34 00 04 34 35 .com / .. 1.1.4 .. 45
 00E0 2E 33 00 0A 57 69 6E 64 6F 77 73 20 39 38 00 04 .3 .. Windows.98 ..

 00F0 34 2E 31 30 00 03 78 38 36 4.10 .. x86

Gray is the package header. Next comes the package body. The body consists of text strings in an unencrypted form. Each line begins with a string length indicator (marked in pink). The white bytes are marked, the purpose of which I did not understand.

As we see when initializing the connection, the applet sends the following information:

1. COM.volano.Access - this is probably a request for user access to the chat. All applet requests begin with COM.volano. , and then the point is followed by the command that the applet calls (in this case Access).

2. MTR.Chat.Server - the name of the group of chats to which we are joining (this line was indicated in the parameters of the applet, when calling it from the HTML page - see above)

In response to this request, the server sends a response packet, the main content of which is a list of active chat rooms:

 0000 44 45 53 54 00 00 20 53 52 43 00 00 08 00 45 00 DEST ... SRC .... E.
 
  0010 02 28 72 82 40 00 2E 06 D8 C2 C1 7C 85 36 D4 09. (R. @ ...... | .6 ..
 
  0020 E4 CE 1F 40 04 72 AA E8 56 5A 00 2A 84 B8 50 18 ... @. R..VZ. * .. P.
 
  0030 40 E8 94 95 00 00 00 11 43 4F 4D 2E 76 6F 6C 61 @ ..... .. COM.vola
 0040 6E 6F 2E 41 63 63 65 73 73 00 00 00 00 00 00 00 no.Access ....

 0050 01 00 00 00 32 00 10 4D 41 49 4E 20 4D 54 52 20.  ... 2 .. MAIN.MTR.
 0060 43 48 41 54 C3 90 5F 00 0F 45 4E 47 4C 49 53 48 CHAT .._ .. ENGLISH
 0070 20 43 48 41 54 C3 90 5F 00 1E 42 55 53 49 4E 45 .CHAT .._ .. BUSINE
 0080 53 53 2C 46 49 4E 41 4E 43 45 2C 53 54 4F 43 4B SS, FINANCE, STOCK
 0090 20 43 48 41 54 C3 90 5F 00 10 50 4F 4C 49 54 49 .CHAT .._ .. POLITI
 00A0 43 53 20 43 48 41 54 C3 90 5F 00 10 52 4F 4D 41 CS.CHAT .._ .. ROMA
 00B0 4E 54 49 43 20 43 48 41 54 C3 90 5F 00 0D 49 4E NTIC.CHAT .._ .. IN
 00C0 54 49 4D 20 43 48 41 54 C3 90 5F 00 15 45 52 4F TIM.CHAT .._ .. ERO
 00D0 54 49 43 20 44 52 45 41 4D 53 20 43 48 41 54 C3 TIC.DREAMS.CHAT.
 00E0 90 5F 00 10 49 53 50 4F 56 45 44 41 4C 60 4E 49 ._ .. ISPOVEDAL`NI
 00F0 41 C3 90 5F 00 10 4B 4F 4D 4E 41 54 41 20 50 49 A .._ .. KOMNATA.PI
 0100 54 4F 4B C3 90 5F 00 0D 48 55 4D 4F 52 20 43 48 TOK .._ .. HUMOR.CH
 0110 41 54 C3 90 5F 00 0D 4A 55 4C 49 41 20 43 48 41 AT .._ .. JULIA.CHA
 0120 54 C3 90 5F 00 16 4E 45 55 50 52 41 56 4C 49 41 T .._ .. NEUPRAVLIA
 0130 45 4D 49 49 20 43 48 41 54 C3 90 5F 00 1A 41 52 EMII.CHAT .._ .. AR
 0140 54 20 41 4E 44 20 50 48 49 4C 4F 53 4F 50 48 59 T.AND.PHILOSOPHY
 0150 20 43 48 41 54 C3 90 5F 00 0D 53 50 4F 52 54 20 .CHAT .._ .. SPORT.
 0160 43 48 41 54 C3 90 5F 00 0D 4D 55 53 49 43 20 43 CHAT .._ .. MUSIC.C
 0170 48 41 54 C3 90 5F 00 13 48 41 52 44 20 26 20 53 HAT .._ .. HARD. &. S
 0180 4F 46 54 20 43 48 41 54 C3 90 5F OFT.CHAT .._

The names of the rooms are listed in the same format as described above: a two-byte string is long and the string itself. However, at the end of each room name there are three bytes C3 90 5F whose purpose is not clear.

After the user has "poked" into one of the chat rooms (but has not yet entered it), the applet sends the following packet to the server:

 0000 20 53 52 43 00 00 44 45 53 54 00 00 08 00 45 00 .SRC..DEST .... E.
 
  0010 00 4C 21 11 40 00 80 06 DA 0F D4 09 E4 CE C1 7C .L .. @ .......... |
 
  0020 85 36 04 72 1F 40 00 2A 84 B8 AA E8 5B 2D 50 18 .6.r. @. * .... [- P.
 
  0030 07 A5 36 DB 00 00 00 0D 43 4F 4D 2E 76 6F 6C 61 ..6 ... .. COM.vola
 0040 6E 6F 2E 62 67 00 00 00 01 00 0F 45 4E 47 4C 49 no.bg .... .. ENGLI
 0050 53 48 20 43 48 41 54 C3 90 5F SH.CHAT .._

Where COM.volano.bg is probably the command to give a list of users from the ENGLISH.CHAT room, or a hint to the server that the user is about to enter the room.

In response to this request, the server sends the applet a list of users in this room:

 0000 44 45 53 54 00 00 20 53 52 43 00 00 08 00 45 00 DEST ... SRC .... E.
 
  0010 00 BE 77 56 40 00 2E 06 D5 58 C1 7C 85 36 D4 09 ..wV @ .... X. | .6 ..
 
  0020 E4 CE 1F 40 04 72 AA E8 5B 2D 00 2A 84 DC 50 18 ... @. R .. [-. * .. P.
 
  0030 40 E8 1D 74 00 00 00 0D 43 4F 4D 2E 76 6F 6C 61 @ .. t .. .. COM.vola
 0040 6E 6F 2E 62 67 00 00 00 04 00 0F 45 4E 47 4C 49 no.bg .... .. ENGLI
 0050 53 48 20 43 48 41 54 C3 90 5F 00 00 00 01 00 00 SH.CHAT .._ .. ....

 0060 00 01 00 00 00 00 00 02 00 06 45 64 77 61 72 64 ........ .. Edward
 0070 00 16 43 6F 6F 6B 69 6E 67 20 6D 6F 72 65 20 61 .. Cooking.more.a
 0080 70 70 6C 65 20 70 69 65 00 0D 36 34 2E 32 30 39 pple.pie .. 64.209
 0090 2E 39 39 2E 31 33 39 00 05 66 61 6C 73 65 00 05 .99.139 .. false ..

 00A0 66 61 6C 73 65 00 05 47 6C 6F 63 6B 00 00 00 0E false .. Glock ....

 00B0 31 34 31 2E 31 35 35 2E 31 38 37 2E 32 31 00 05 141.155.187.21 ..

 00C0 66 61 6C 73 65 00 05 66 61 6C 73 65 false .. false

As you can see, the list contains a lot of interesting information, including chatlan IP addresses. Let's sort everything in order:

1. COM.volano.bg - the name of the command that the applet sent. Probably the server simply duplicates the command that was invoked so that the client knew in response to exactly which request the packet came.

2. 00 00 00 04 - again it is not clear what it is. Most likely this is sent to a counter (a 4-byte integer). Note that all 4 bytes are present in all packets, but the value of the latter is proportional to the amount of information sent to the user. When the applet sent the name of the room where the user wants to enter, this counter was 1, when the server sent a list of two chatlans in the room — the counter is 4, and when the server sent a list of rooms (there are about 40), the counter was equal to 32h .

3. ENGLISH.CHAT - the name of the room is a list of users of which we get plus incomprehensible bytes C3 90 5F .

4. 00 01 00 00 00 01 00 00 00 00 00 02 - again it is not clear that, although the last number probably means the number of users in the room.

5. Edward - user nickname, Cooking more apple pie - the so-called user profile (entered when the user logs in to the chat), 64.209.99.139 - the user's IP address (it is not clear why the applet needs it, because the information still goes through the server) further two values ​​are false, the purpose of which is not clear, maybe it’s some user settings or its status.

6. Glock , etc. - user nickname and everything is the same as the first one, except that the profile line is empty (it is not necessary to enter the profile).

To be continued ...