Description The /etc/hosts file was writable by non-root users, allowing attackers to register malicious DNS mappings and redirect legitimate domains (pharming attacks). This check verified that /etc/hosts was owned by root and had appropriate permissions.
PoC Copy id: rw-hosts-file info: name: /etc/hosts File Read/Write Check author: songyaeji severity: high description: | The /etc/hosts file was writable by non-root users, allowing attackers to register malicious DNS mappings and redirect legitimate domains (pharming attacks). This check verified that /etc/hosts was owned by root and had appropriate permissions. reference: - https://isms.kisa.or.kr/main/csap/notice/ metadata: verified: true tags: local,linux,hosts,file,audit,kisa self-contained: true code: - engine: - sh - bash source: | stat -c "%U %G %a" /etc/hosts 2>/dev/null || echo "not-found" matchers: - type: regex part: response regex: - '^root\s+root\s+(600|644)$' # digest: 4a0a00473045022017a5a0e8603f419052c28b1a4247cf2ad1427ed06e840c85cb976599aba89ac50221009d55c0bde34158f8e63bfd6c2a090e801dd4271f75947ef4ad2d9baa133294ab:922c64590222798bb761d5b6d8e72950 # Visit https://trap.biu.life/ to view exploit trends for this vulnerability. Source: https://github.com/projectdiscovery/nuclei-templates/blob/main/code/linux/audit/rw-hosts-file.yaml
References https://newreleases.io/project/github/projectdiscovery/nuclei-templates/release/v10.2.8 https://cve.imfht.com/poc_detail/c7bfcf3d8ed6468d3cc89d870d3bef970a9e0282?lang=en https://cve.imfht.com/poc_detail/c7bfcf3d8ed6468d3cc89d870d3bef970a9e0282 https://github.com/projectdiscovery/nuclei-templates https://www.baeldung.com/linux/check-etc-hosts-file-entries https://www.linuxquestions.org/questions/linux-server-73/etc-hosts-file-is-read-only-for-root-in-ubuntu-server-but-rw-is-for-root-934236/ https://man7.org/linux/man-pages/man5/hosts.5.html
Related VulnerabilitiesPoCCVE-2026-116167: SiYuan 2.9.0-3.8.6 - Unauthenticated XSS via check-auth "to" ParameterPoCCVE-2026-14554: WordPress Check & Log Email < 2.0.15 - SQL InjectionPoCCVE-2026-18937: WordPress Broken Link Checker < 2.4.12 - Remote Code ExecutionPoCCVE-2026-93616: Check Point Security Management - Unauthenticated Directory Traversal to RCEPoCds-store-file: DS_Store File - Exposedkotaemon /check_connection 命令执行漏洞(CVE-2026-69098)Check Point VPN IKEv1 权限绕过漏洞(CVE-2026-50751)PoCCVE-2025-32778: Web-Check < 2.0.1 Screenshot API - OS Command InjectionPoCCVE-2026-50751: Check Point IKEv1 Remote-Access VPN - Certificate Authentication Bypass云供应链管理系统GetTodayCheckRecord存在SQL注入漏洞云供应链管理系统 GetCheckRecord 存在SQL注入漏洞SysAid /mdm/checkin XML 外部实体注入漏洞(CVE-2025-2775)PoCPowerJob /server/checkConnectivity 服务器端请求伪造漏洞(CVE-2025-14518)