Linux /etc/(x)inetdconf 文件权限配置不当漏洞

漏洞信息

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

漏洞类型: 配置问题

漏洞等级: 高危

漏洞描述: 该漏洞涉及Linux系统中的/etc/xinetd.conf或/etc/inetd.conf文件权限配置不当问题。这些文件用于配置inetd或xinetd超级服务器,控制网络服务的启动和管理。如果这些文件被非root用户可写,攻击者可能注册恶意服务,这些服务将以root权限运行,从而导致权限提升或其他安全风险。漏洞的技术根源在于文件的所有权和权限设置不当,未遵循最小权限原则。具体表现为文件未被root用户独占拥有,或权限设置过于宽松(如非644或更严格的权限)。此漏洞的影响极为严重,因为它允许本地用户通过修改配置文件来执行任意代码或服务,进而可能完全控制系统。由于攻击需要本地访问权限,且通常需要一定的用户权限来修改文件,因此其利用条件相对受限。然而,一旦被利用,后果极为严重,可能导致系统完全被控制。因此,建议系统管理员定期检查关键系统文件的权限设置,确保其符合安全最佳实践。

产品名称: Linux系统

来源: https://github.com/projectdiscovery/nuclei-templates/blob/dfc176303ffebe3d9f231045fa3abe2cf2ca9874/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/31/github_2757998597/
作者
lianccc
发布于
2025年7月31日
许可协议