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文件的配置不当。TCP Wrapper是一种广泛使用的访问控制机制,用于限制或允许特定IP地址或网络对系统服务的访问,如Telnet、RSH、SSH等。如果这些配置文件未正确设置,攻击者可能利用此漏洞进行未授权的远程访问,从而对系统安全构成威胁。

漏洞的技术根源在于缺乏严格的IP和端口限制配置,特别是在/etc/hosts.deny文件中未设置默认拒绝策略(ALL:ALL),或在/etc/hosts.allow文件中未为关键服务如SSHD设置明确的允许策略。这种配置疏忽可能导致系统暴露于未授权访问的风险中。

此漏洞的影响极为严重,因为它可能被利用来绕过访问控制,实现远程代码执行、数据泄露或服务中断。由于该漏洞不需要认证即可被利用,且可以自动化攻击,因此对系统的安全构成了重大威胁。建议管理员检查并严格配置TCP Wrapper的相关文件,以确保系统的安全。

产品名称: Linux TCP Wrapper

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