Thread: The Login Protocol

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31
  1. #1 The Login Protocol 
    Renown Programmer

    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,730
    Thanks
    350
    Thanked 1,317 Times in 551 Posts
    Rep Power
    2953
    The Login Protocol


    Overview

    The RuneScape login protocol of the old engine is very simplistic, but surely does its job. Within it, it securely transmits your private information. In the next few paragraphs I will explain the login protocol.

    Handshake

    Every connection to the RuneScape main 'gateway' server sends a single byte of data, mostly well known as the connection type. The connection type tells the main server which type of connection you wish to initiate. The old engine list consists of:

    • Login request - connection type 14
    • Update - connection type 15
    • New connection login - connection type 16
    • Reconnecting login - connection type 18


    The connection type we will cover in the following paragraphs is the login connection type, 14. After the login handshake initiating connection type, the client writes a small bit of data derived from the logging in player's username. This is believed to help select the appropriate login server. On successful handshake, the server sends back 8 ignored bytes.

    The request

    At this point, the client reads in one byte, called the status code. The status code 0 is expected to start the login protocol correctly. If the status code is 0, the client reads a long, dubbed by many as the server session key. This is used to help generate a unique seed for the client session's packet opcode masking. The client then stores two ints that are the upper and lower ints of the client session key, which has the same purpose as the server's key. The client then starts writing the login block, which is RSA encrypted.

    The login block starts with the byte 10, which is considered a magic number. Following it is the client session key and server session key longs. After the session keys, the session's UID (unique identifier or user identifier) is written to the block. This is used to distinguish between multiple sessions. Trailing behind the UID comes the client's username and password written as modified C-strings that are rather terminated with a 10 byte than a NUL byte. This block is then RSA encrypted and stored for later use.

    Now starts the login request packet. It starts off with a flag telling the server whether or not the client is reconnecting or connecting for the first time. The byte is 18 or 16, respectively. [NOW CLASSIFIED AS A CONNECTION TYPE] Following is the size of the rest of the login response packet, including the login block that trails at the end, to tip the server how much data it should expect. Later comes the magic number byte 255, and right behind it the client revision short. The packet is just about crafted completely. A flag byte that represents if the client is running in low memory or high memory modes is sent, and after the 9 CRC32 checksums of the file system 0 basic archives (this includes versionlist, media, config, etc.). To top it off, the RSA encrypted login block is appended to the end and the packet is sent to the server.

    The ISAAC ciphers are seeded for packet opcode masking after adding 50 to each int of the session keys, and the status code is reread. This finishes the login protocol.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Riedell's Avatar
    Join Date
    Feb 2008
    Age
    20
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    152
    Excellent guide super_. I appreciate it for your work for 317's! . Keep up the good work please!
    ~Riedell
    Reply With Quote  
     

  3. #3  
    Renown Programmer

    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,730
    Thanks
    350
    Thanked 1,317 Times in 551 Posts
    Rep Power
    2953
    Thanks galkon, mind stickying?
    Reply With Quote  
     

  4. #4  
    Renown Programmer

    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,730
    Thanks
    350
    Thanked 1,317 Times in 551 Posts
    Rep Power
    2953
    Defqon I suggest rereading also the last bit i do not consider part of the login sequence
    Reply With Quote  
     

  5. #5  
    Brown
    Guest
    Nice Supa (:
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Dec 2007
    Age
    5
    Posts
    841
    Thanks
    4
    Thanked 11 Times in 8 Posts
    Rep Power
    93
    Super_ how do you know this stuff .

    Reply With Quote  
     

  7. #7  
    [style]Client God[/style]


    Join Date
    Dec 2007
    Age
    19
    Posts
    1,987
    Thanks
    255
    Thanked 323 Times in 141 Posts
    Rep Power
    841
    what about logintype 16 :O


    R-S Admin Response  Numbers
    I like man cocks!

    Reply With Quote  
     

  8. #8  
     

    Vastico's Avatar
    Join Date
    Dec 2006
    Posts
    5,546
    Thanks
    290
    Thanked 646 Times in 381 Posts
    Rep Power
    5000
    Quote Originally Posted by Clienthax View Post
    what about logintype 16 :O
    LoginType 16 is not in the protocolId that is the type of connection, 16 for straight login, 18 for reconnection I think
    Reply With Quote  
     

  9. #9  
    Renown Programmer

    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,730
    Thanks
    350
    Thanked 1,317 Times in 551 Posts
    Rep Power
    2953
    Quote Originally Posted by Clienthax View Post
    what about logintype 16 :O
    connection type 16 isn't used as far as we know in 317.
    Reply With Quote  
     

  10. #10  
    Sub
    Sub is offline
    sυввч
    Sub's Avatar
    Join Date
    Aug 2007
    Age
    13
    Posts
    4,052
    Thanks
    463
    Thanked 253 Times in 184 Posts
    Rep Power
    2400
    intresting.
    Reply With Quote  
     


Page 1 of 4 123 ... LastLast
Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •