Sign in to follow this  
Followers 0
Dampe

MSN Protocol

16 posts in this topic

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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
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]

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Any way someone could post a working example(like a personal client?)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Send file ? FT - Pocket on my signature 

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0