Windows 7真的支持SMB核心协议吗?

发布于 2024-10-18 04:13:27 字数 1007 浏览 0 评论 0原文

我已经开始为基于 Z80 的旧机器开发 SMB 服务器。这台机器运行一个非常简单的、类似MS-DOS的操作系统(没有多任务,没有用户概念,只有FAT文件系统,没有unicode,只有8.3文件名)并且内存有限,因此我的第一个想法是只实现SMB核心协议。我将使用 TCP 传输。

就目前而言,我只有一个非常短的测试代码,它仅回复 SMB_COM_NEGOTIATE 命令,表明核心协议(“PC NETWORK PROGRAM 1.0”)是所需的方言。为了测试它,我尝试从 Windows 7 计算机进行连接,方法是打开资源管理器窗口并在地址栏中键入 "\\"。我已使用 Wireshark 验证服务器收到协商命令并发送(显然)正确的响应。

问题:Windows 客户端收到响应后,立即显示一条通用的“无法访问资源”错误消息(错误代码为 0x80004005),然后什么也没有发生(不再发送 SMB 消息) )。我期待收到 SMB_COM_TREE_CONNECT 或类似的命令。

我当时想,也许Windows 7不支持核心协议(它很旧,而且缺乏任何安全功能),但是,为什么它会在协商请求中列出核心方言名称呢?也许我错过了一些步骤?服务器必须在协商响应后发送任何额外的数据包吗?

客户端操作系统是 Windows 7 Ultimate 64 位,以下是请求和响应的 Wireshark 转储,以防任何人在过程中发现任何错误:

请求:

SMB 方言协商请求

响应:

SMB 方言协商响应

更新:如果我选择 NT LM 0.12 方言而不是核心方言,我会收到来自客户端的 SESSION_SETUP_AND_REQUESTX 命令。显然,Windows 7 确实不支持核心协议。无论如何,任何额外的信息将不胜感激。

I have started the development of a SMB server for an old Z80 based machine. This machine runs a very simple, MS-DOS like operating system (no multitask, no concept of users, FAT filesystem only, no unicode, 8.3 filenames only) and has limited memory, therefore my first idea is to implement just the SMB core protocol. I will use TCP transport.

As for now, I have just a very short testing code that just replies to the SMB_COM_NEGOTIATE command, indicating that the core protocol ("PC NETWORK PROGRAM 1.0") is the desired dialect. In order to test it, I try to connect from a Windows 7 machine, by opening a explorer window and typing "\\<server IP>" in the address bar. I have verified with Wireshark that the server receives the negotiate command and sends an (apparently) correct response.

The problem: as soon as the Windows client receives the response, it shows a generic "Can't access resource" error message (with error code 0x80004005) and then nothing happens (no further SMB messages are sent). I was expecting to receive SMB_COM_TREE_CONNECT or a similar command.

I was thinking that maybe Windows 7 does not support the core protocol (it is very old and it lacks any security feature whatsoever), but then, why does it list the core dialect name in the negotiate request? Maybe I am missing some step? Must the server send any additional packet after the negotiate response?

The client OS is Windows 7 Ultimate 64 bits, and here are the Wireshark dumps of both the request and the response in case anyone can spot anything wrong in the process:

The request:

SMB dialect negotiate request

The response:

SMB dialect negotiate response

UPDATE: If I select the NT LM 0.12 dialect instead of the core dialect, I receive a SESSION_SETUP_AND_REQUESTX command from the client. So apparently it seems that indeed, the core protocol is not supported by Windows 7. Anyway, any extra information will be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花开浅夏 2024-10-25 04:13:28

我相信 Windows 7 确实支持核心协议。根据 此处

根据 Windows 7 连接到 Samba 服务器的问题,我认为指定核心协议的问题是由于 Windows 7 计算机上的 LANMAN 工作站/客户端设置造成的。

建议的更改是

  • 使 LM 和 NTLM 哈希成为安全策略的一部分
    网络安全:LAN Manager身份验证级别发送LM&amp; NTLM 响应
  • 将注册表项的【HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa \【LmCompatibilityLevel】值更改为0,按照此处
  • 将以下参数添加到注册表中的 LanmanWorkStation 和 NetLogon
    HKLM\System\CCS\Services\LanmanWorkstation\Parameters
    DWORD 域兼容性模式 = 1
    DWORD DNSNameResolutionRequired = 0

    HKLM\System\CCS\Services\Netlogon\Parameters
    DWORD RequireSignOnSeal = 0
    DWORD RequireStrongKey = 0

    此处列出了通过注册表和安全策略对这些设置可能进行的更改此处

这些更改应确保 LanmanWorkstation 不使用 NTLMv2 会话安全性。

I believe Windows 7 does support the Core Protocol. It downgrades to SMB 1.0 when connecting to older servers as per here.

Based on the issues that Windows 7 has with connecting to Samba servers, I believe the issue with the specifying the core protocol is due the LANMAN workstation / client settings on the Windows 7 machine.

Recommended changes would be

  • enabling LM and NTLM hashes to be as part of the security policy are
    Network security: LAN Manager authentication level Send LM & NTLM responses
  • changing the 【HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa \【LmCompatibilityLevel 】 value of the registry key to 0 as per here
  • Adding the following parameters to LanmanWorkStation and NetLogon in the registry
    HKLM\System\CCS\Services\LanmanWorkstation\Parameters
    DWORD DomainCompatibilityMode = 1
    DWORD DNSNameResolutionRequired = 0

    HKLM\System\CCS\Services\Netlogon\Parameters
    DWORD RequireSignOnSeal = 0
    DWORD RequireStrongKey = 0

    Possible changes to these settings both via registry and via security policy are listed here

These changes should ensure LanmanWorkstation doesn't use NTLMv2 session security.

離殇 2024-10-25 04:13:28

此信息与@Appleman1234 提供的基本相同(谢谢!),只是更容易应用一点。

  1. 导出您当前的注册表设置,以便您可以在必要时恢复您的设置。将以下代码放入 .bat 文件中,它将导出到您的 C: 驱动器,我们准备修改的 3 个注册表项。
reg 导出 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa HKEY_LOCAL_MACHINE.SYSTEM.CurrentControlSet.Control.Lsa.reg
reg 导出 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters HKEY_LOCAL_MACHINE.SYSTEM.CurrentControlSet.services.LanmanWorkstation.Parameters.reg
reg 导出 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Netlogon\Parameters HKEY_LOCAL_MACHINE.SYSTEM.CurrentControlSet.services.Netlogon.Parameters.reg
  1. 取消限制所需的注册表设置。下面几乎正是 @Appleman1234 的建议,除了它还启用纯文本密码并禁用安全签名。将以下代码放入 .reg 文件中并将其导入到您的注册表中。
Windows 注册表编辑器版本 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
“lmcompatibilitylevel”=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]
“启用纯文本密码”=dword:00000001
“启用安全签名”=dword:00000000
“RequireSecuritySignature”=dword:00000000
“域兼容性模式”=dword:00000001
“DNSNameResolutionRequired”=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Netlogon\Parameters]
“RequireSignOrSeal”=dword:00000000
“RequireStrongKey”=dword:00000000
“RequireSignOnSeal”=dword:00000000

This info is basically the same as @Appleman1234 provided (thanks!), just a bit easier to apply.

  1. Export your current reg settings so you can restore what you had if necessary. Put the following code into a .bat file and it will export to your C: drive the 3 reg keys we are getting ready to modify.
reg export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa HKEY_LOCAL_MACHINE.SYSTEM.CurrentControlSet.Control.Lsa.reg
reg export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters HKEY_LOCAL_MACHINE.SYSTEM.CurrentControlSet.services.LanmanWorkstation.Parameters.reg
reg export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Netlogon\Parameters HKEY_LOCAL_MACHINE.SYSTEM.CurrentControlSet.services.Netlogon.Parameters.reg
  1. Un-restrict the required registry settings. Below is almost exactly what @Appleman1234 suggested except it also enables plain text passwords and disables security signatures. Put the following code into a .reg file and import it to your registry.
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
"lmcompatibilitylevel"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]
"EnablePlainTextPassword"=dword:00000001
"EnableSecuritySignature"=dword:00000000
"RequireSecuritySignature"=dword:00000000
"DomainCompatibilityMode"=dword:00000001
"DNSNameResolutionRequired"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Netlogon\Parameters]
"RequireSignOrSeal"=dword:00000000
"RequireStrongKey"=dword:00000000
"RequireSignOnSeal"=dword:00000000
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文