You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get Node.GetServers() to return the SMB server listening on the loopback adapter but the NameQuery packet sent to port 137 doesn't seem to get a reply, and so it doesn't get added to the list.
Windows 10
Steps to reproduce:
Disable "Server" service
Install the "Microsoft KM-TEST Loopback Adapter"
Bind adapter to IP 10.0.0.1 and Subnet Mask 255.255.255.0
Create a text file in the folder "C:\Shared"
Run SMBServer.exe
IP Address: Any
Transport: Direct TCP Transport (Port 445)
Protocol: [X] SMB 1.0/CIFS [X] SMB 2.0/2.1
[ ] Integrated Windows Authentication
Click Start
Modify EzSmb\Scanners\Scanner.cs by commenting out these two lines (47 and 62): || nic.NetworkInterfaceType == NetworkInterfaceType.Loopback || IPAddress.IsLoopback(uAddr.Address)
Set a breakpoint after the call to Node.GetServers() in the test GetServersTest()
Debug the test GetServersTest()
Inspect the value of result1
Notice 10.0.0.1 is not in the list
I discovered that instead of using port 137, I have to use port 445 to detect the SMB server.
Thank you.
The text was updated successfully, but these errors were encountered:
icnocop
changed the title
Loopback adapter support
Optionally use port 445 instead of port 137 to detect SMB servers
Oct 6, 2021
As you wrote, the current implementation cannot detect servers on port 445 (=Direct Hosting SMB).
This is a mechanism to find servers that have NetBIOS name resolution enabled.
It is my understanding that DNS is responsible for finding SMB servers in environments where ports 137 and 138 are closed and only 445 is open (= directly hosted SMB only).
#This SMB implementation is probably intended to be used in an Active Directory environment.
It is possible to detect this by trying to connect to TCP port 445.
But it should follow the meaning of the protocol constraints and should not be implemented, in my opinion.
Hi.
I'm trying to get
Node.GetServers()
to return the SMB server listening on the loopback adapter but the NameQuery packet sent to port 137 doesn't seem to get a reply, and so it doesn't get added to the list.Windows 10
Steps to reproduce:
IP Address: Any
Transport: Direct TCP Transport (Port 445)
Protocol: [X] SMB 1.0/CIFS [X] SMB 2.0/2.1
[ ] Integrated Windows Authentication
EzSmb\Scanners\Scanner.cs
by commenting out these two lines (47 and 62):|| nic.NetworkInterfaceType == NetworkInterfaceType.Loopback
|| IPAddress.IsLoopback(uAddr.Address)
Node.GetServers()
in the testGetServersTest()
GetServersTest()
result1
I discovered that instead of using port 137, I have to use port 445 to detect the SMB server.
Thank you.
The text was updated successfully, but these errors were encountered: