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

Basics of Java chat.

Information refers only to the Java chat of Volano, chats from other manufacturers may work on a different protocol, although the principle of data exchange is probably the same. The information given is not extracted from the documentation but by the connection tracking method and TCP packets. Tools such as IP-Tools v2.07 and Network Spy v2.0 were used

Fragment of HTML code embedding 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 transferred as a parameter. In addition, the english.txt resource file is downloaded from the server ( see ). The server also has a French-language equivalent of french.txt ( see ). These files contain the settings and the string constants of the applet.

After reviewing the settings file, I found several more files (specified in english.txt ), the content of which might also seem interesting: BannerPlayer.txt (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 messages, etc.).

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

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

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

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

After startup, the chat applet communicates with the host on which the chat server is located (for this chat it is 193.124.133.54 ). Communication is carried out on the TCP protocol. The socket is opened once when the applet is started and closes when it finishes. Thus, local and remote ports remain constant throughout the session. The applet opens the socket on the server's 8000 port.

Here is the dump of the main request packet to enter the chat group (this packet is sent by the applet to the 8000 server port):

  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

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

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

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

2. MTR.Chat.Server - The name of the group of chat rooms to which we join (this line was specified in the applet parameters, 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 the 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 04 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 rooms are listed in the same format as described above: the two-byte length of the string and the string itself. However, at the end of each room name there are three bytes of C3 90 5F whose purpose is not clear.

After the user "poked" in 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.. .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 a command to give a list of users from the room ENGLISH.CHAT , or a hint to the server that the user is going to enter the room.

In response to this request, the server sends an applet to the list of users in the 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 IP addresses chatlan. We will analyze everything in order:

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

2. 00 00 00 04 - again it is not clear what is. Most likely it is sent some counter (the whole 4-byte number). 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 out the name of the room where the user wants to enter, this counter was 1 when the server sends a list of two chatlains in the room - the counter is 4, and when the server sent a list of rooms (about 40 of them) - the counter was equal to 32h .

3. ENGLISH.CHAT - the name of the room whose list of users we get plus the 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 next number probably means the number of users in the room.

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

6. Glock , etc. - the nickname of the user and all the same as the first, except that the profile line is empty (you do not need to enter the profile).

To be continued ...