Linux /etc/(x)inetdconf 文件权限配置问题

漏洞信息

漏洞名称: Linux /etc/(x)inetd.conf 文件权限配置问题

漏洞类型: 配置问题

漏洞等级: 高危

漏洞描述: 该漏洞涉及Linux系统中的/etc/xinetd.conf或/etc/inetd.conf文件权限配置不当问题。这些文件用于配置xinetd或inetd服务,如果这些文件被非root用户可写,攻击者可能注册恶意服务,这些服务将以root权限运行,从而带来严重的安全风险。

受影响产品: Linux操作系统广泛用于服务器和个人计算机中,xinetd和inetd是用于管理网络服务的守护进程,常见于企业级服务和网络应用组件中。这些服务的配置文件权限不当可能导致系统被恶意利用。

漏洞解释: 此漏洞属于配置问题,具体表现为/etc/xinetd.conf或/etc/inetd.conf文件的权限设置不当,允许非root用户进行写操作。这违反了最小权限原则,可能导致权限提升。技术根源在于系统管理员未正确设置文件的所有权和权限,使得非授权用户能够修改服务配置。

影响分析: 此漏洞的高危性在于,攻击者可以利用此漏洞注册并运行恶意服务,从而获得root权限,执行任意代码,导致数据泄露、服务中断等严重后果。由于这是本地漏洞,攻击者需要先获得系统访问权限,但一旦获得,无需进一步认证即可利用此漏洞。因此,对于多用户系统或共享主机环境,此漏洞的风险尤为突出。

产品名称: Linux系统

来源: https://github.com/projectdiscovery/nuclei-templates/blob/1dc5e4c5a7e3689548a72d7cb2a00b803fccc824/misconfiguration%2Flinux%2Fetc-xinetdconf-permission-check.yaml

类型: projectdiscovery/nuclei-templates:github issues

POC详情

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

id: etc-xinetdconf-permission-check

info:
name: /etc/(x)inetd.conf File Owner and Permission Check
author: songyaeji
severity: high
description: >
If the /etc/xinetd.conf or /etc/inetd.conf file is writable by non-root users, they may register malicious services that run with root privileges. This check ensures the file is owned by root and has secure permissions.
reference:
- https://isms.kisa.or.kr/main/csap/notice/
- Cloud Vulnerability Assessment Guide (2024) by KISA
tags: linux,local,configuration,file,ownership,permission,xinetd,inetd
metadata:
verified: true
os: linux
max-request: 2
classification:
cwe-id: CWE-732
cvss-metrics: CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
cvss-score: 7.4

self-contained: true

code:
- engine:
- bash
source: |
stat -c "%U %G %a" /etc/xinetd.conf 2>/dev/null || echo "not-found"
matchers:
- type: regex
part: code_1_response
regex:
- '^root\s+root\s+([0-5]?[0-9]{2}|644)$'

- engine:
- bash
source: |
stat -c "%U %G %a" /etc/inetd.conf 2>/dev/null || echo "not-found"
matchers:
- type: regex
part: code_2_response
regex:
- '^root\s+root\s+([0-5]?[0-9]{2}|644)$'


Linux /etc/(x)inetdconf 文件权限配置问题
http://example.com/2025/07/29/github_4034562627/
作者
lianccc
发布于
2025年7月29日
许可协议