Jump to content

Listen NetBIOS


Nnet
 Share

Recommended Posts

Hello, i have DOS program with maximum 30 users online. Sometimes some people let program running and oter users cant connect.

Its posible watch NTBBS communication? And when its not running for 30minutes, to disconect user (mb for 30sec disconect this pc from port 139(netbios))
Im trying to use TCPListen but it dont work :/

I dont get anything. Just trying to discover how it works.
When i use Wireshark i cant see all comunikations. But Autoit dont see it.

192.168.1.250    192.168.1.96    TCP    netbios-ssn > 51532 [SYN, ACK] Seq=0 Ack=1 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1
192.168.1.96    192.168.1.250    TCP    51532 > netbios-ssn [FIN, ACK] Seq=73 Ack=7 Win=65692 Len=0
 

Func Example()
    TCPStartup() ; Start the TCP service.


    Local $sIPAddress = "192.168.1.96" ; This IP Address only works for testing on your own computer.
    Local $iPort = 139 ; Port used for the connection.
While 1

    Local $aInfo = _Net_Share_SessionGetInfo($sIPAddress, @ComputerName, @UserName)
    Local $iListenSocket = TCPListen($sIPAddress, $iPort, 200)
    local $iSocket = TCPAccept($iListenSocket)
    sleep(100)


    ConsoleWrite($aInfo[1] & $iListenSocket & $iSocket)
    sleep(50)
  WEnd
EndFunc

 

Link to comment
Share on other sites

Thank, Im trying to use it but still nothing.
Script running on server.

This is how first contact look in wireshark:
192.168.1.198    192.168.1.96    NBSS    126    Session request, to NAVI42-N300114<03><00> from <00><00><00><00><00><00><00><00><00><00><1c>oe<81><e4><60>

So what to do in code?
Local $aInfo = _Net_Share_SessionGetInfo( "NAVI42-N300114<03><00>", "<00><00><00><00><00><00><00><00><00><00><1c>oe<81>", @UserName )

I got absolutly nothing :( Im used IP, computer names, sesion name...

Edited by Nnet
Link to comment
Share on other sites

I've never used the network share functions before, but I think you usage is malformed.  I think perhaps you can use the _Net_Share_SessionEnum() function to collect a list (array) of the active sessions, then you could supply the params for your desired session to the GetInfo func.

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...