Results 1 to 5 of 5

Thread: Sockets, Redirecting ports

  1. #1

    Thread Starter
    Member Jared's Avatar
    Join Date
    Nov 2002
    Posts
    58

    Sockets, Redirecting ports

    Using sockets, if I connect to port 139, how (or is it possible) to redirect data to 135?
    "It is preoccupation with possessions, more than anything else, that prevents us from living freely and nobly." -Bertrand Russell

  2. #2

    Thread Starter
    Member Jared's Avatar
    Join Date
    Nov 2002
    Posts
    58
    Nevermind,

    I CAN connect to port 135. When I send the data, the Messenger service window is not popping up though.
    "It is preoccupation with possessions, more than anything else, that prevents us from living freely and nobly." -Bertrand Russell

  3. #3
    Hyperactive Member
    Join Date
    Dec 2002
    Posts
    382
    It's not that simple, If you want to send messenger messages, you can't just send a packet on port 135/139 and expect it to work. I sniffed those packets and it's a series UDP/TCP/IP packets on multiple sends. Anyways you need to either shell out and use the Net Send command OR do it the preferred way (as I have) and use NetMessageBufferSend API, it works fine in .Net.

  4. #4

    Thread Starter
    Member Jared's Avatar
    Join Date
    Nov 2002
    Posts
    58
    Thanks,

    The current way I have been doing it is using the DOS shell. My app uses sockets to ping the user first, then, if the user is pingable, sends the message.

    I wanted to have uniformity with the ping and the net send.

    I could'nt get the API to work right I was using NetMessageBufferSend from the netapi32.

    Could you post your code for the api?
    "It is preoccupation with possessions, more than anything else, that prevents us from living freely and nobly." -Bertrand Russell

  5. #5
    Hyperactive Member
    Join Date
    Dec 2002
    Posts
    382
    Private Declare Unicode Function NetMessageBufferSend Lib "NetApi32" (ByVal inServ As String, ByVal inTo As String, ByVal inFrom As String, ByVal inMsg As String, ByVal MsgLen As Int32) As Int32

    And to call it....

    intRet = NetMessageBufferSend(vbNullString, objIP.ToString, strFrom, strMsg, strMsg.Length * 2)

    Hope that helps...

Posting Permissions

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



Click Here to Expand Forum to Full Width