0004-user-passwd-exist - /etc/passwd Does Not Exist on Host¶
Rule ID¶
- 0004-user-passwd-exist
Category¶
- system
Severity¶
- critical
Compatible Versions¶
- Linux
Description¶
- Monitors whether the
/etc/passwdfile exists on the host.
Scan Frequency¶
1 */5 * * *
Rationale¶
- In Linux, the
/etc/passwdfile contains a corresponding record line for each user, recording basic user attributes. System administrators often modify this file to manage users. The deletion of/etc/passwdcan prevent host login and is considered malicious destruction.
Risk Items¶
-
Hacker infiltration
-
Data leakage
Audit Method¶
- Verify whether
/etc/passwdexists on the host. Execute the following command to verify:
Remediation¶
- If
/etc/passwdis deleted but the system has not been rebooted, execute the following command to recover:
If the system has been shut down after deleting the file, you will be unable to log in at startup.
Press
eduring GRUB boot to enter edit mode. On thelinux16line, changerotorw rd.break.Press
Ctrl+xto execute.After entering single-user mode, change the root path and copy the init program:
```bash chroot /sysroot
cp /etc/passwd /etc/passwd
Because the security context of the copied file does not match the current directory, you need to disable SELinux: ```bash vim /etc/sysconfig/selinux selinux = disabledType
exittwice to exit the current root and reboot the host. The system will return to normal.
Impact¶
- None
Default Value¶
- None
References¶
-
Emergency Investigation Ideas && Process for Hacker Intrusion (Unofficial)
-
Record of a Real Cryptomining Intrusion Investigation Analysis (Unofficial)
CIS Controls¶
- None