HOME 27175ff8b6 commit: import project | 4 years ago | |
---|---|---|
.. | ||
Authentication | 4 years ago | |
Client | 4 years ago | |
Enums | 4 years ago | |
Exceptions | 4 years ago | |
Helpers | 4 years ago | |
NTFileStore | 4 years ago | |
NetBios | 4 years ago | |
RPC | 4 years ago | |
SMB1 | 4 years ago | |
SMB1FileStore | 4 years ago | |
SMB2 | 4 years ago | |
Server | 4 years ago | |
Services | 4 years ago | |
Tests | 4 years ago | |
Utilities | 4 years ago | |
Win32 | 4 years ago | |
Readme.md | 4 years ago | |
Readme.txt | 4 years ago | |
RevisionHistory.txt | 4 years ago | |
_SOURCE.TXT | 4 years ago |
SMBLibrary is an open-source C# SMB 1.0/CIFS, SMB 2.0 and SMB 2.1 server implementation.
SMBLibrary gives .NET developers an easy way to share a directory / file system / virtual file system, with any operating system that supports the SMB protocol.
SMBLibrary is modular, you can take advantage of Integrated Windows Authentication and the Windows storage subsystem on a Windows host or use independent implementations that allow for cross-platform compatibility.
SMBLibrary shares can be accessed from any Windows version since Windows NT 4.0.
• NetBIOS over TCP (port 139)
• Direct TCP hosting (port 445)
By default, Windows already use ports 139 and 445. there are several techniques to free / utilize those ports:
Disable the "Server" service (p.s. "TCP\IP NETBIOS Helper" should be enabled).
Windows bind port 139 to the first IP addres of every adapter, while port 445 is bound globally. This means that if you'll disable port 445 (or block it using a firewall), you'll be able to use a different service on port 139 for every IP address.
To free port 139 for a given adapter, go to 'Internet Protocol (TCP/IP) Properties' > Advanced > WINS, and select 'Disable NetBIOS over TCP/IP'. Uncheck 'File and Printer Sharing for Microsoft Networks' to ensure Windows will not answer to SMB traffic on port 445 for this adapter.
It's important to note that disabling NetBIOS over TCP/IP will also disable NetBIOS name service for that adapter (a.k.a. WINS), This service uses UDP port 137. SMBLibrary offers a name service of its own.
You can install a virtual network adapter driver for Windows to be used solely with SMBLibrary:
However, you will have to configure this adapter to use a separate network segment. The driver installation can be downloaded from: https://openvpn.net/index.php/open-source/downloads.html To get started, go to Adapter properties > 'Advanced' and set 'Media Status' to 'Always Connected'.
Using PCap.Net you can programmatically setup a virtual Network adapter and intercept SMB traffic (similar to how a virtual machine operates), You should use the ARP protocol to notify the network about the new IP address, and then process the incoming SMB traffic using SMBLibrary, good luck!
Any directory / filesystem / object you wish to share must implement the IFileSystem interface (or the lower-level INTFileStore interface).
You can share anything from actual directories to custom objects, as long as they expose a directory structure.
If you have any question, feel free to contact me.
Tal Aloni tal.aloni.il@gmail.com