Linux TCP Wrapper IP-based Access Control Misconfiguration

漏洞信息

漏洞名称: Linux TCP Wrapper IP-based Access Control Misconfiguration

漏洞类型: 配置问题

漏洞等级: 高危

漏洞描述: 该漏洞涉及Linux系统中的TCP Wrapper配置问题,具体表现为/etc/hosts.allow和/etc/hosts.deny文件中的IP和端口限制未正确应用。TCP Wrapper是一种广泛使用的访问控制机制,用于限制或允许特定IP地址对服务的访问,如Telnet、RSH和SSH等。如果配置不当,系统可能面临未授权远程访问的风险。漏洞的技术根源在于缺乏严格的默认拒绝策略(如ALL:ALL规则未在/etc/hosts.deny中设置)或未在/etc/hosts.allow中为关键服务(如SSH)设置明确的允许策略。这种配置疏忽可能导致攻击者绕过预期的访问控制,直接访问受保护的服务,从而执行未授权操作或泄露敏感信息。由于该漏洞可能影响所有使用TCP Wrapper进行访问控制的Linux系统,其潜在影响范围广泛,尤其是在企业级服务或云环境中。攻击者无需认证即可利用此漏洞,增加了自动化攻击的可能性。因此,及时检查和修正相关配置文件对于维护系统安全至关重要。

产品名称: Linux TCP Wrapper

来源: https://github.com/projectdiscovery/nuclei-templates/blob/1dc5e4c5a7e3689548a72d7cb2a00b803fccc824/misconfiguration%2Flinux%2Flinux-hosts-access-control.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: linux-hosts-access-control

info:
name: Check TCP Wrapper IP-based access control configuration
author: songyaeji
severity: high
description: >
Detects if IP and port restrictions are properly applied using TCP Wrapper (/etc/hosts.allow and /etc/hosts.deny).
If unrestricted, systems are vulnerable to unauthorized remote access (e.g. Telnet, RSH, SSH).
reference:
- https://isms.kisa.or.kr
- Cloud Vulnerability Assessment Guide(2024) by KISA
tags: linux,local,misconfig,access-control,tcpwrapper,ssh
metadata:
verified: true
os: linux
max-request: 1
classification:
cvss-metrics: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score: 7.8
cwe-id: CWE-284

self-contained: true

code:
- engine:
- bash
source: |
echo "[*] Checking /etc/hosts.deny"
if grep -q "^ALL:ALL" /etc/hosts.deny; then
echo "[OK] /etc/hosts.deny has ALL:ALL policy"
else
echo "[WARN] /etc/hosts.deny is missing ALL:ALL (default deny)"
fi

echo "[*] Checking sshd allow policy in /etc/hosts.allow"
grep -Ei "sshd" /etc/hosts.allow || echo "[WARN] No sshd-specific allow policy found"
matchers:
- type: word
part: code_1_response
words:
- "/etc/hosts.deny"
- "/etc/hosts.allow"


Linux TCP Wrapper IP-based Access Control Misconfiguration
http://example.com/2025/07/29/github_3620726952/
作者
lianccc
发布于
2025年7月29日
许可协议