使用 unc 路径(相对)唯一地识别机器
使用 C#,并且假定用户输入 unc 路径。有没有办法验证两个月后,当我将文件写入 unc 路径时,它与他输入时的机器是同一台机器?
即我正在向路径写入一些敏感信息,并希望阻止某人将另一台具有相同名称/共享等的计算机放在网络上并获取输出。或者,如果软件在笔记本电脑上运行,并且用户将其插入另一个网络,并且恰好有一台具有相同名称/共享的计算机...
除了使用 IP 地址(并验证其是否为 IP 地址)之外,还有任何想法吗?相同的?)。除了对 unc 共享的写访问权限之外,我不一定对远程计算机拥有任何权限。
是的,我可能有点偏执,但想知道是否有可能......
Using C#, and given that the user enters in a unc path. Is there a way to verify that 2 months down the line, when I'm writing a file to the unc path, that it is the same machine as when he entered it?
i.e. I'm writing some sensitive information to the path, and want to stop someone from putting another machine on the network with the same name / share etc and grabbing the output. Or if the software is running on a laptop and the user plugs it into another network, and there just happens to be a machine with the same name / share...
Any ideas, other than using the IP address (and verifying that its the same?). I don't necessarily have any rights on the remote machine other than write access to the unc share.
Yes, I'm probably being paranoid, but would like to know if anything is possible...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您无权访问该盒子并且不想使用IP,那么我唯一能想到的就是当用户输入UNC并验证存在性和内容时在共享上留下一个隐藏文件(也许指南)当您再次访问时。
If you don't have access to the box and you don't want to use IP then the only other thing I can think of is to leave a hidden file on the share when the user enters the UNC and verify existence and content (perhaps a guid) when you revisit.
如果计算机位于同一子网上,您也许可以使用 ARP 检索 MAC机器的地址。这有点难以欺骗。当他们进入 UNC 路径时,检索 MAC 地址。然后在写入文件之前,进行相同的解析并验证MAC地址是否相同。
If the machines are on the same subnet, you might be able to use ARP to retrieve the MAC address of the machine. That is a little harder to spoof. When they enter the UNC path, retrieve the MAC address. Then later before writing the file, do the same resolution and verify that the MAC address is the same.
如果您担心此类场景的安全性,对我来说唯一可能的方法是数据加密。通过公钥基础设施,您可以确保只有您想要接收数据的人才能真正解密数据,并且您还可以确保接收者知道您并且只有您写入了数据。
互联网上有很多有关数据加密的信息,因此我不会在这里详细介绍,但请务必查找“公钥基础设施、rsa、aes、混合密码系统、数字签名”等关键字。
最好的问候,
奥利弗·哈纳皮
If you are concerned about security for such scenarios, for me the only possible way to go is data encryption. With a public key infrastructure you can make sure that only the person you want to receive the data will actually be able to decrypt the data and you can also make sure that the receiver knows that you and only you have written the data.
There is much information about data encryption on the internet, so I'm not going into details here, but be sure you look for keywords like "public key infrastructure, rsa, aes, hybrid cryptosystem, digital signature".
Best Regards,
Oliver Hanappi