Jump to content

MSN Protocol


Dampe
 Share

Recommended Posts

Hey all,

I was bored and started having a crack at the MSN protocol.

Ref: http://www.hypothetic.org/docs/msn/notific...hentication.php

Local $MSNConnectServer = TCPNameToIP ("messenger.hotmail.com")
Local $MSNConnectPort = 1863
Local $MSNCurrentID = 0, $TCPMainSocket

_MSNStart("emailhere@hotmail.com", "passwordhere")



Func _MSNStart($tEmail, $tPassword)
    
;//Start connection
    While 1
        $TCPMainSocket = TCPConnect ($MSNConnectServer, $MSNConnectPort)
        If $TCPMainSocket <> - 1 Then
            ExitLoop
        EndIf
    WEnd
    ConsoleWrite ("Connected to " & $MSNConnectServer & @CRLF)
    
    _MSNVer($MSNCurrentID)
    $MSNCurrentID +=1
    _MSNCvr($MSNCurrentID, $tEmail)
    $MSNCurrentID +=1
    _MSNUsr($MSNCurrentID, $tEmail)
    
;//Connect to new server
    While 1
        $TCPMainSocket = TCPConnect ("207.46.111.72", 1863)
        If $TCPMainSocket <> - 1 Then
            ExitLoop
        EndIf
    WEnd
    
    $MSNCurrentID = 0

    _MSNVer($MSNCurrentID)
    $MSNCurrentID +=1
    _MSNCvr($MSNCurrentID, $tEmail)
    $MSNCurrentID +=1
    _MSNUsr($MSNCurrentID, $tEmail)
    
EndFunc

Func _MSNCvr($tID, $tEmail)
    
    $tVersionString = "CVR " & $tID & " 0x0409 win 4.10 i386 MSNMSGR 5.0.0544 MSMSGS " & $tEmail & @CRLF
    TCPSend ($TCPMainSocket, $tVersionString)
    ConsoleWrite (">>> " & $tVersionString)
    
;//Version command
    While 1
        
        $TCPRecv = TCPRecv ($TCPMainSocket, 2048)
        If $TCPRecv <> "" Then
            ConsoleWrite ("<<< " & $TCPRecv)
            ExitLoop
        EndIf
        
    WEnd
EndFunc

Func _MSNVer($tID)
    
    $tVERString =  "VER " & $tID & " MSNP9" & @CRLF
    TCPSend ($TCPMainSocket, $tVERString)
    ConsoleWrite (">>> " & $tVERString)
    
;//Verify command
    While 1
        
        $TCPRecv = TCPRecv ($TCPMainSocket, 2048)
        If $TCPRecv <> "" Then
            If $TCPRecv = $tVERString Then
                ConsoleWrite ("<<< " & $TCPRecv)
                ExitLoop
            Else
                ConsoleWrite ("<<< " & $TCPRecv)
            EndIf
        EndIf
        
    WEnd
    
EndFunc

Func _MSNUsr($tID, $tEmail)
    
    $tUsrString = "USR " & $tID & " TWN I " & $tEmail & @CRLF
    TCPSend ($TCPMainSocket, $tUsrString)
    ConsoleWrite (">>> " & $tUsrString)
    ;//USR command
    While 1
        
        $TCPRecv = TCPRecv ($TCPMainSocket, 2048)
        If $TCPRecv <> "" Then
            ConsoleWrite ("<<< " & $TCPRecv)
            ExitLoop
        EndIf
        
    WEnd
    TCPCloseSocket ($TCPMainSocket)
    
EndFunc
Link to comment
Share on other sites

nice one, using msn protocol v8.

I've developped an msn client with the v15 ( xml, sso, ticket token, and so on ...) , but it's forbidden so i've never published it.

too bad that we can't make our own client with the new protocol :/

nice job anyway :)

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Link to comment
Share on other sites

Good work! :)

Edit: But it's not working :)

Edited by torels

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

in the licence agreement microsoft says that msn protocol is proprietary.

Since there you can't make your own client with this new protocol. It's proprietary.

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Link to comment
Share on other sites

Am I the only idiot for whom it's not working ?

Can it depend on the country where you are ?

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

It's not working for my either. No version is returned. (Nothing is returned)

I just remembered... He cut TCPStartUp() off at some point.

TCPStartup ( )

Dim $MSNConnectServer = TCPNameToIP ("messenger.hotmail.com")

Dim $MSNConnectPort = 1863
Dim $MSNCurrentID = 0, $TCPMainSocket

_MSNStart("emailhere@hotmail.com", "passwordhere")



Func _MSNStart($tEmail, $tPassword)
    ConsoleWrite("Attempting to connect to " & $MSNConnectServer & @CRLF)
;//Start connection
    While 1
        $TCPMainSocket = TCPConnect ($MSNConnectServer, $MSNConnectPort)
        If $TCPMainSocket <> - 1 Then
            ExitLoop
        EndIf
    WEnd
    ConsoleWrite ("Connected to " & $MSNConnectServer & @CRLF)
    
    _MSNVer($MSNCurrentID)
    $MSNCurrentID +=1
    _MSNCvr($MSNCurrentID, $tEmail)
    $MSNCurrentID +=1
    _MSNUsr($MSNCurrentID, $tEmail)
    
;//Connect to new server
    While 1
        $TCPMainSocket = TCPConnect ("207.46.111.72", 1863)
        If $TCPMainSocket <> - 1 Then
            ExitLoop
        EndIf
    WEnd
    
    $MSNCurrentID = 0

    _MSNVer($MSNCurrentID)
    $MSNCurrentID +=1
    _MSNCvr($MSNCurrentID, $tEmail)
    $MSNCurrentID +=1
    _MSNUsr($MSNCurrentID, $tEmail)
    
EndFunc

Func _MSNCvr($tID, $tEmail)
    
    $tVersionString = "CVR " & $tID & " 0x0409 win 4.10 i386 MSNMSGR 5.0.0544 MSMSGS " & $tEmail & @CRLF
    TCPSend ($TCPMainSocket, $tVersionString)
    ConsoleWrite (">>> " & $tVersionString)
    
;//Version command
    While 1
        
        $TCPRecv = TCPRecv ($TCPMainSocket, 2048)
        If $TCPRecv <> "" Then
            ConsoleWrite ("<<< " & $TCPRecv)
            ExitLoop
        EndIf
        
    WEnd
EndFunc

Func _MSNVer($tID)
    
    $tVERString =  "VER " & $tID & " MSNP9" & @CRLF
    TCPSend ($TCPMainSocket, $tVERString)
    ConsoleWrite (">>> " & $tVERString)
    
;//Verify command
    While 1
        
        $TCPRecv = TCPRecv ($TCPMainSocket, 2048)
        If $TCPRecv <> "" Then
            If $TCPRecv = $tVERString Then
                ConsoleWrite ("<<< " & $TCPRecv)
                ExitLoop
            Else
                ConsoleWrite ("<<< " & $TCPRecv)
            EndIf
        EndIf
        
    WEnd
    
EndFunc

Func _MSNUsr($tID, $tEmail)
    
    $tUsrString = "USR " & $tID & " TWN I " & $tEmail & @CRLF
    TCPSend ($TCPMainSocket, $tUsrString)
    ConsoleWrite (">>> " & $tUsrString)
    ;//USR command
    While 1
        
        $TCPRecv = TCPRecv ($TCPMainSocket, 2048)
        If $TCPRecv <> "" Then
            ConsoleWrite ("<<< " & $TCPRecv)
            ExitLoop
        EndIf
        
    WEnd
    TCPCloseSocket ($TCPMainSocket)
    
EndFunc
Link to comment
Share on other sites

Now it's working :)

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

Holy smokes :D ! can u give use some examples, like how to send files etc :D ?

Sending/Receiving files through MSN protocol is a bit more advanced, it requires packet reassembly and MSN has a particular way of handling these, it wouldn't be to hard to initiate the transfer negotiation but you can only send the file in i think 2040bytes increments which include the position of that piece in the final file, this becomes complicated when data packets could be lost on their way to the target. There's an msnwiki on the net explaining in-depth how the protocol works. Ive analyzed packets from my MSN client using Wireshark, and it's quite a handful actually.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...