作者:mobiledu2502934191 | 来源:互联网 | 2023-06-26 15:05
Imjuststartingtolookintohowtointegratenmap,anopensourcesecurityproduct,intosomec++
I'm just starting to look into how to integrate nmap, an open source security product, into some c++ code. If anyone's tried this, and has some ideas on the best approach, I'd certainly appreciate it.
我刚刚开始研究如何将开源安全产品nmap集成到某些c ++代码中。如果有人试过这个,并对最佳方法有一些想法,我当然会很感激。
Thanks for the responses. Specifically, I'd like to run a port scan (ipv6). I would definitely prefer non-gpl solutions such as a command line or sockets interface. However, I'm also this point I'm looking for the fastest solution/s, as we're up against some stringent timelines, and we can backload implemententing the non-gpl solution if necessary.
谢谢你的回复。具体来说,我想运行端口扫描(ipv6)。我肯定更喜欢非gpl解决方案,如命令行或套接字接口。但是,我也是这一点,我正在寻找最快的解决方案,因为我们正在面对一些严格的时间表,我们可以在必要时重新实现非gpl解决方案。
4 个解决方案
(note: I am not a lawyer, and none of this should be taken as legal advice)
(注意:我不是律师,这一切都不应被视为法律建议)
You should probably note that Nmap considers a product that parses its output to be a derived work, according to the licensing chapter in the manual, and thus fall under the GPL licensing obligations. The GPLv2 does not define what a derived work is, instead letting that be up to the courts and according to definitions in copyright law. The usual interpretation is that any form of linking, other than linking to system libraries included in the operating system, makes the linked work a derived work, while separate process that talk over pipes or the network are not necessarily derived works, though as mentioned in the GPL FAQ, "if the semantics of the communication are intimate enough, exchanging complex internal data structures, that too could be a basis to consider the two parts as combined into a larger program." That seems to be the interpretation that the Nmap developers are taking.
您可能应该注意到,根据手册中的许可章节,Nmap会将解析其输出的产品视为派生作品,因此属于GPL许可义务。 GPLv2没有定义派生作品是什么,而是根据版权法的定义让法院判决。通常的解释是,除了链接到操作系统中包含的系统库之外,任何形式的链接都使链接的工作成为派生的工作,而通过管道或网络进行交谈的单独进程不一定是派生的工作,尽管如上所述GPL常见问题解答,“如果通信的语义足够密切,交换复杂的内部数据结构,这也可以成为将这两个部分组合成一个更大的程序的基础。”这似乎是Nmap开发人员正在采取的解释。
Anyhow, assuming that you don't need to worry about the GPL, you probably want to look at the output options for Nmap; in particular, -oX
for XML output and -oG
for "greppable" output. If you need more control over what Nmap does, you should look into the Nmap Scripting Engine, a Lua scripting engine in Nmap that gives you all kinds of control.
无论如何,假设您不需要担心GPL,您可能想要查看Nmap的输出选项;特别是,-oX表示XML输出,-oG表示“greppable”输出。如果您需要更多地控制Nmap的功能,您应该查看Nmap脚本引擎,它是Nmap中的Lua脚本引擎,可以为您提供各种控制。