-3

我想分析Nmap源代码,首先应该怎么做?Nmap有很多文件和文件夹,我不知道从哪里开始,我该怎么办?我想知道一些 Nmap 的工作,比如 nmap 如何检测操作系统或 nmap 如何检测开放端口?模块中是否存在一些 nmap 工作?

谢谢。此致。

4

2 回答 2

4

Nmap 是一个古老且“成熟”的软件包。最好先阅读优秀的文档,然后再阅读源代码,而不是反过来。

我建议Phrack 51 - The Art of Port Scanning稍微更新的版本作为仍然相关的入门读物。

只是为了让您了解杂乱无章的 nmaps 内部结构,请参阅上面 Phrack Articke 的引用:

在编写 nmap 之前,我花了很多时间与其他扫描仪一起探索 Internet 和各种专用网络(注意避免使用“intranet”流行语)。我使用了当今可用的许多顶级扫描仪,包括 Julian Assange 的 strobe、Hobbit的 netcat、Uriel Maimon 的 stcp、Pluvius 的 pscan、Dave Goldsmith 的 ident-scan 以及 Wietse Venema 的 SATAN tcp/udp 扫描仪。这些都是优秀的扫描仪!事实上,我最终破解了它们中的大多数以支持其他人的最佳功能。最后,我决定编写一个全新的扫描仪,而不是依赖 /usr/local/sbin 中十几个不同扫描仪的破解版本。虽然我编写了所有代码,但 nmap 使用了许多前辈的好主意。我还加入了一些新的东西,比如碎片扫描和其他扫描仪的“愿望清单”上的选项。

(免责声明:几年来没有检查过 nmap 的内部结构。可能有人已经清理了中间的代码,但我认为这不太可能。

于 2010-11-06T11:12:40.257 回答
0

Your best bet now is to use the python nmap library. It gives the best look at what's under the hood and you get to learn python as well.

An even better option if you are willing is to build your own in ruby. It really isn't that hard to do and you have more control on what is going on. Scapy is pretty good to learn as well. If you pull up wireshark with any of these while you are doing your scanning you will gain a much better understand on how everything works.

于 2016-05-19T18:51:30.840 回答