|
|
| Yahoo's YMSG9 login and packets |
In this tutorial I will explain how to log onto Yahoo's servers using the YMSG9 protocol, I will also list most of the packets for sending IM's, Joining rooms, Posting in chat, etc.
Please note that all packets will be shown using a combination of plaintext and hex. The text shown in "quotes" are plaintext while text without quotes is a description.
OK, first thing we need to do is connect to a Yahoo YMSG server. For the purpose of this tutorial we shall use cs12.msg.sc5.yahoo.com and port 5050 as this is the port used by the YMSG protocol.
Right the first packet we send is to check that the server is a YMSG9 server, and the packet we send is :-
"YMSG" 09 00 00 00 00 00 00 "L" 00 00 00 00 00 00 00 00
If the server is a YMSG server is replies with the same packet. Now we can request the challenge string and session ID. The challenge string is used for encrypting the password while the session ID is sent with every packet.
The packet we send to retrieve these is :-
"YMSG" 09 00 00 00 SIZE 00 "W" 00 00 00 00 00 00 00 00 "1" C0 80 USERNAME C0 80
You will notice the SIZE part of the packet. This is 2 bytes (characters) that represent the size of the packets payload. The payload in laymans terms is the size of the packet - 20. The format for the size is A B where A is the number of times 255 will go into the size of the packet and B is the remainder. Username is self explanatory.
Ok the packet returned by the server contains both the challenge string and our session ID. The challenge string is found at the end of the packet sandwiched between CO 80 and C0 80. The session ID is characters 17 to 20 (4 characters in length, starting at and including character 17)
Now we have our challenge string and the session ID we need to encrypt the password. For this you will need a dll written for this very purpose. I offer 2 dll's for you to consider. The first is by Venkydude and is available from his site www.venkydude.com. The other is available from http://ymsg5.cjb.net.
Once you have got your 2, yes 2, encrypted strings we send them in this packet :-
"YMSG" 09 00 00 00 SIZE 00 "T" 00 00 00 0C "KMND" 00 C0 80 USERNAME C0 80 "6" C0 80 ENCODEDSTRING1 C0 80 "96" C0 80 ENCODEDSTRING2 C0 80 "2" C0 80 "1" C0 80 "1" C0 80 USERNAME C0 80
The packet sent back to us (provided the password is correct and there hasn't been an error in the encryption) contains the accounts usernames, ignore list, buddy list, and cookies.
Now we need to set our status as Available :-
"YMSG" 09 00 00 00 00 00 00 04 00 00 00 0C 00 00 00 00
The server now tells us which of our buddies are online and what their status is. Now we can send and recieve IM's and any other none chat related messenger packets.
Now just to get you started I'll give you the packet to send an Instant Message :-
"YMSG" 09 00 00 00 SIZE 00 06 5A 55 AA 56 SESSIONID "1" CO 80 USERNAME C0 80 "5" C0 80 CO 80 OTHERPERSON C0 80 "14" C0 80 MESSAGE C0 80
Thats all for now. I may get bored and tell you the packets for chatting. Maybe not.
|
|