Centos 7.3 上的 modprobe 返回多个和/或奇怪的结果

not*_*mer 6 centos modprobe

有人可以告诉我为什么下面的命令

modprobe -n -v dccp_ipv4
Run Code Online (Sandbox Code Playgroud)

返回两个结果 ?

install /bin/true
install /bin/true
Run Code Online (Sandbox Code Playgroud)

为什么会这样

modprobe -n -v dccp_ipv6
Run Code Online (Sandbox Code Playgroud)

返回三?

install /bin/true
install /bin/true
install /bin/true
Run Code Online (Sandbox Code Playgroud)

我使用的是 CentOS Linux 版本 7.3.1611(核心),在 /etc/modprobe.d 中我有许多文件,其中有一个来自 CIS 的建议的文件。该文件包含(除其他外):

install dccp_ipv4 /bin/true
install dccp_ipv6 /bin/true
Run Code Online (Sandbox Code Playgroud)

以上两个是 /etc/modprobe.d 中的文件中唯一出现的情况

此外,一个

modprobe -n -v udf
Run Code Online (Sandbox Code Playgroud)

也返回两行:

insmod /lib/modules/3.10.0-514.21.2.el7.x86_64/kernel/lib/crc-itu-t.ko
install /bin/true
Run Code Online (Sandbox Code Playgroud)

/etc/modprobe.d 中的 CIS 文件内容为:

install udf /bin/true
Run Code Online (Sandbox Code Playgroud)

那么,为什么要使用 insmod 行呢?

我问这个问题是因为漏洞扫描器只需要一行输出(在本例中为 install /bin/true)

fcb*_*bsd 5

由于有多个依赖项,因此有多个结果: modinfo -F depends <module_name> 将列出该模块的依赖项。

例如:

$ modprobe -n -v dccp_ipv6                                  
insmod /lib/modules/3.10.0-514.el7.x86_64/kernel/net/dccp/dccp.ko            
insmod /lib/modules/3.10.0-514.el7.x86_64/kernel/net/dccp/dccp_ipv4.ko    
insmod /lib/modules/3.10.0-514.el7.x86_64/kernel/net/dccp/dccp_ipv6.ko 
Run Code Online (Sandbox Code Playgroud)

那么,为什么要使用 insmod 行呢?

udf模块依赖于udfcrc-itu-t,并且crc-itu-t启用了加载,因此该insmod行。

表示install /bin/true该模块已禁用 - 这就是您的扫描仪正在寻找的内容。

对我来说,这种行为在 CentOS 6.8 和 7.1 上是相同的。