2025-08-22 10:22:38 +05:30
id : tcpwrapper-access
info :
name : TCP Wrapper Access Control Check
author : songyaeji
severity : low
description : |
Checked if IP and port restrictions were properly applied using TCP Wrapper (/etc/hosts.allow and /etc/hosts.deny). Reported systems as vulnerable if unrestricted remote access (e.g. Telnet, RSH, SSH) was possible.
reference :
- https://isms.kisa.or.kr
2025-08-28 23:41:32 +05:30
tags : linux,local,audit,kisa,compliance
2025-08-22 10:22:38 +05:30
self-contained : true
code :
- engine :
2025-08-25 17:30:06 +09:00
- sh
2025-08-22 10:22:38 +05:30
- bash
source : |
echo "[*] Checking /etc/hosts.deny (default deny policy)"
if grep -Eq "^[[:space:]]*ALL:[[:space:]]*ALL" /etc/hosts.deny; then
2025-08-23 12:21:00 +05:30
echo "[SAFE] /etc/hosts.deny has ALL:ALL policy"
2025-08-22 10:22:38 +05:30
else
2025-08-23 12:21:00 +05:30
echo "[VULNERABLE] /etc/hosts.deny is missing ALL:ALL (default deny)"
2025-08-22 10:22:38 +05:30
fi
2025-08-23 12:21:00 +05:30
- engine :
- sh
- bash
source : |
2025-08-22 10:22:38 +05:30
echo "[*] Checking sshd allow policy in /etc/hosts.allow"
if grep -Eq "^[[:space:]]*sshd" /etc/hosts.allow; then
if grep -Eq "^[[:space:]]*sshd:[[:space:]]*ALL" /etc/hosts.allow; then
2025-08-23 12:21:00 +05:30
echo "[VULNERABLE] sshd allows ALL hosts (too permissive)"
2025-08-22 10:22:38 +05:30
else
2025-08-23 12:21:00 +05:30
echo "[SAFE] sshd-specific allow policy found with restrictions"
2025-08-22 10:22:38 +05:30
fi
else
2025-08-23 12:21:00 +05:30
echo "[VULNERABLE] No sshd-specific allow policy found"
2025-08-22 10:22:38 +05:30
fi
matchers :
- type : word
2025-08-23 12:21:00 +05:30
name : hosts.deny
part : code_1_response
words :
- "[VULNERABLE]"
- type : word
name : sshd
part : code_2_response
2025-08-22 10:22:38 +05:30
words :
2025-08-23 12:21:00 +05:30
- "[VULNERABLE]"
2025-08-29 10:06:03 +00:00
# digest: 4b0a00483046022100aaf438d9d1df7bb250887b6732f0c1238fd0baa0b46cdd3bfcb9294e178624dd0221008dc264a278dc80cdb7f50423f878c08b49b46e0c097519dadeddf0642e74072f:922c64590222798bb761d5b6d8e72950