|
Carbonize | ||||
| >>>>> Free Cellphone call detector (US Only) |
|||||
| I have been receiving a large amount of infected emails. FREE online virus scan http://housecall.antivirus.com and FREE anti virus software www.grisoft.com |
|||||
Yahoo YCHT LoginI'm about to show you how to log on to Yahoo's YCHT servers, the ones used by Java chat.But first you will require at least a basic understanding of how to use winsock. If you've never used winsock before I recommend reading my winsock tutorial first. Right lets begin. First thing we need to do is retrieve the cookie that the chat server requires. To get our cookie first we have winsock connect to a login or an edit server such as edit.yahoo.com or login.yahoo.com Then we send the following : "GET /config/ncclogin?.src=bl&login=" & USERID & "&passwd=" & PASS & "&n=1 HTTP/1.0" & VbCrLf & "Accept: */*" & vbCrLf & "Accept: text/html" & vbCrLf & vbCrLf Replacing USERID with the ID we are logging in with and PASS with the accounts password. The packet sent back by the server will either contain our cookie or will tell us we made a mistake with the USERID or the PASSWORD. If the packet contains "ERROR: Invalid NCC Login" then either the password is wrong or we mistyped the username. Otherwise we have our cookie. The cookie is made up of two parts, both of which need extracting from the packet we just received. The first part we need starts with Y=v= and ends with, and includes the ; The second part starts with T=z= and ends at the ; and does not include it. The whole cookie is made up as COOKIE = PART1 & " " & PART2. Now we close our winsock before we can go any further. If we have our cookie we can connect to the YCHT servers The server I have chosen for this example is CS7.chat.sc5.yahoo.com and port 8001. Once connected the packet we send to the server is : "YCHT" & Chr(0) & Chr(0) & Chr(1) & Chr(0) & Chr(0) & Chr(0) & Chr(0) & Chr(1) & Chr(0) & Chr(0) & CalcSize(Len(User) + Len(Cookie) + 1) & User & Chr(1) & Cookie Now you're probably looking at that and wondering what the heck CalcSize is so I'll tell you. All yahoo packets contain 2 bytes that tell the server how long the payload of the packet is. The payload being everything that comes after calcsize. Now we need to make the CalcSize function which is this : Public Function CalcSize(PckLen As Integer) As String CalcSize = Chr$(Int(PckLen / 256)) & Chr$(Int(PckLen Mod 256)) End FunctionWhen we receive a packet back from the server the first thing we need to do is get the value of the 12th character. The value of he 12th character tells us what type of packet it is we have just received. When we send the login packet to the chat server it replies with a packet who's 12th character's value is 1. Now we've successfully connected to the chat server and logged in we need to join a room. The join room packet is: "YCHT" & Chr(0) & Chr(0) & Chr(1) & Chr(0) & Chr(0) & Chr(0) & Chr(0)& Chr(17) & Chr(0) & Chr(0) & CalcSize(Len(Room)) & Room Room being the room we wish to join. And that's it. If you want more packets then get my YCHT login source from here. |
||