(以编程方式)确定文件网络来源的最佳方法是什么?
对于我正在编写的应用程序,我想以编程方式找出文件来自网络上的哪台计算机。我怎样才能最好地完成这个任务?
我是否需要监控网络事务,或者这些数据是否存储在 Windows 中的某个位置?
For an application I'm writing, i want to programatically find out what computer on the network a file came from. How can I best accomplish this?
Do I need to monitor network transactions or is this data stored somewhere in Windows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将文件复制到本地系统时,Windows 不会保留复制位置的任何记录。因此,除非创建它的应用程序将此类信息保存在文件中,否则它将丢失。
通过文件审核,可以跟踪文件和目录操作,但我认为这不会包括带有文件副本的源路径(只是由谁创建的以及何时创建的)。
When a file is copied to the local system Windows does not keep any record of where it was copied. So unless the application that created it saved such information in the file then it will be lost.
With file auditing file and directory operations can be tracked, but I don't think that will include the source path with file copies (just who created it and when).
是的,您似乎需要根据网络流量的拦截来检测文件传输,或者如果您有能力以某种方式更改文件,请使用公钥加密技术使用计算机特定的密钥对文件进行签名,然后再进行签名。被转移。
Yes, it seems like you would either need to detect the file transfer based on interception of network traffic, or if you have the ability to alter the file in some way, use public key cryptography to sign files using a machine-specific key before they are transferred.
在目标计算机或文件托管计算机上创建一项服务,该服务会将记录添加到附加到每个文件的备用数据流中,这与 Windows 处理从 Internet 下载的文件的 ZoneInfo 的方式非常相似。
您可以在机器 A 上有一个后台进程,它将每个文件“标记”为已由机器 A 在某个日期和时间标记。然后,当机器 B 下载文件时,假设我们使用 NTFS 文件系统,它可以看到来自 A 的标签。或者,如果服务器上没有进程,则可以通过数据包在“客户端”端使用 NTFS 流正如其他人所描述的嗅探方法。这里的好处是,未来的文件副本将保留 NTFS 系统之间的数据。
替代方案:创建一个要求,即所有文件传输都必须通过 Web 门户完成(而不是网络拖放)。内置日志记录。或其他类型的文件检索代理。你能控制这样的程序吗?
Create a service on either the destination computer, or on the file hosting computers which will add records to an Alternate Data Stream attached to each file, much the way that Windows handles ZoneInfo for files downloaded from the internet.
You can have a background process on machine A which "tags" each file as having been tagged by machine A on such-and-such a date and time. Then when machine B downloads the file, assuming we are using NTFS filesystems, it can see the tag from A. Or, if you can't have a process at the server, you can use NTFS streams on the "client" side via packet sniffing methods as others have described. The bonus here is that future file-copies will retain the data as long as it is between NTFS systems.
Alternative: create a requirement that all file transfers must be done through a Web portal (as opposed to network drag-and-drop). Built in logging. Or other type of file retrieval proxy. Do you have control over procedures such as this?