热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

有关如何以编程方式与nmap集成的任何想法?-Anyideasonhowtointegratewithnmapprogrammatically?

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 个解决方案

#1


(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脚本引擎,可以为您提供各种控制。

#2


Are you looking to use specific pieces of functionality? An easy way I've found of using nmap in other languages is to have it spit out xml using the -oX switch. There is a DTD (and numerous ways to covert this to an xsd for your favourite binding tool) what you can use to consume the data.

您是否希望使用特定的功能?我发现在其他语言中使用nmap的一种简单方法是使用-oX开关吐出xml。有一个DTD(和许多方法将其转换为您最喜欢的绑定工具的xsd)您可以使用什么来使用数据。

Given that you're writing in C++ though it probably would be easy enough to link against directly if you needed.

鉴于您正在使用C ++编写,但如果您需要,可能很容易直接链接。

#3


You could always read it in pipe. According to tradition that is acceptable even if non-GPL accesses GPL.

你总是可以用烟斗来读它。根据传统,即使非GPL访问GPL也是可以接受的。

#4


"Integrate" doesn't really say enough. What kind of things do you want to do? Depending on the level of "integration" it might be enough to run nmap as a separate process and capture its output. The advantage there is that you can update the version of nmap without rebuilding your app. If you require tighter coupling, then it depends on what functionality you need and "library-izing" nmap, but be warned that it's GPL code and this kind of integration would require source distribution of your app..

“整合”并没有真正说出来。你想做什么事?根据“集成”的级别,将nmap作为单独的进程运行并捕获其输出可能就足够了。优点是您可以在不重建应用程序的情况下更新nmap的版本。如果你需要更紧密的耦合,那么它取决于你需要什么功能和“库化”nmap,但要注意它是GPL代码,这种集成需要你的应用程序的源代码分发。


推荐阅读
  • 本文介绍了九度OnlineJudge中的1002题目“Grading”的解决方法。该题目要求设计一个公平的评分过程,将每个考题分配给3个独立的专家,如果他们的评分不一致,则需要请一位裁判做出最终决定。文章详细描述了评分规则,并给出了解决该问题的程序。 ... [详细]
  • tcpdump 4.5.1 crash 深入分析
    tcpdump 4.5.1 crash 深入分析 ... [详细]
  • 本文总结了Java中日期格式化的常用方法,并给出了示例代码。通过使用SimpleDateFormat类和jstl fmt标签库,可以实现日期的格式化和显示。在页面中添加相应的标签库引用后,可以使用不同的日期格式化样式来显示当前年份和月份。该文提供了详细的代码示例和说明。 ... [详细]
  • 生成式对抗网络模型综述摘要生成式对抗网络模型(GAN)是基于深度学习的一种强大的生成模型,可以应用于计算机视觉、自然语言处理、半监督学习等重要领域。生成式对抗网络 ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 本文讨论了clone的fork与pthread_create创建线程的不同之处。进程是一个指令执行流及其执行环境,其执行环境是一个系统资源的集合。在调用系统调用fork创建一个进程时,子进程只是完全复制父进程的资源,这样得到的子进程独立于父进程,具有良好的并发性。但是二者之间的通讯需要通过专门的通讯机制,另外通过fork创建子进程系统开销很大。因此,在某些情况下,使用clone或pthread_create创建线程可能更加高效。 ... [详细]
  • 本文介绍了最长上升子序列问题的一个变种解法,通过记录拐点的位置,将问题拆分为左右两个LIS问题。详细讲解了算法的实现过程,并给出了相应的代码。 ... [详细]
  • 本文介绍了机器学习手册中关于日期和时区操作的重要性以及其在实际应用中的作用。文章以一个故事为背景,描述了学童们面对老先生的教导时的反应,以及上官如在这个过程中的表现。同时,文章也提到了顾慎为对上官如的恨意以及他们之间的矛盾源于早年的结局。最后,文章强调了日期和时区操作在机器学习中的重要性,并指出了其在实际应用中的作用和意义。 ... [详细]
  • 本文介绍了在Windows系统上使用C语言命令行参数启动程序并传递参数的方法,包括接收参数程序的代码和bat文件的编写方法,同时给出了程序运行的结果。 ... [详细]
  • 本文介绍了使用readlink命令获取文件的完整路径的简单方法,并提供了一个示例命令来打印文件的完整路径。共有28种解决方案可供选择。 ... [详细]
  • 本文介绍了在RHEL 7中的系统日志管理和网络管理。系统日志管理包括rsyslog和systemd-journal两种日志服务,分别介绍了它们的特点、配置文件和日志查询方式。网络管理主要介绍了使用nmcli命令查看和配置网络接口的方法,包括查看网卡信息、添加、修改和删除配置文件等操作。 ... [详细]
  • Linux设备驱动开发详解-Note(3)---驱动设计的硬件基础(1)
    驱动设计的硬件基础(1)成于坚持,败于止步处理器分类不做过多说明,处理器类型很多,大同小异存储器存储器可分为只读储存器(ROM)、闪存(Flash)、随机存取存储器(RAM)、光介质存储器和磁介质存储 ... [详细]
author-avatar
mobiledu2502934191
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有