等保测评Linux命令集
看了不少学习资料,以及一下大佬对等保2.0的理解,在他们的基础上整理一下这个命令集,如果你有更好的命令的话,可以留言交流一下,共同学习,共同进步!
测评命令集
cat /etc/passwd 查看普通用户、系统用户(1-499)
cat /etc/shadow !!密码已过期、!账户已禁用、*账户已锁定。查看是否存在默认账户 shutdown halt adm mail 等
cat /etc/login.defs 密码时间策略
cat /etc/pam.d/system-auth 密码复杂度策略
cat /etc/profile 查看登录超时策略
systemctl status sshd.service 查看ssh是否开启
netstat -an | grep 22
netstat -an | grep 23
ls -l /etc/passwd 查看当前账户分配权限
cat /etc/ssh/sshd_config 查看ssh配置,是否允许远程登录 PermitRootLogin NO为符合
more /etc/sudoers 查看具有sudoers的用户有哪些(是否存在 在Allow root to run any commands anywhere 下面是否存在除Root之外的用户)ls -l(d) passwd shadow pam.d system-auth
more /etc/selinux/config
ecforcing 违反、记录、阻止
permissive 违反、记录日志
ls -Z /etc/passwd 查看限制访问等级 S3为符合
audit为系统安全审计 additd为系统审计守护进程
auditctl -s 查看是否开启审计
auditctl -l 查看是否开启审计规则
aureport -i 查看审计项
systemctl status auditd 查看是否开启审计守护进程
yum list installd (这个我感觉不怎么能查出来,我更喜欢下面查询服务)
systemctl list-units -all --type=service 列出系统存在的服务
netstat -anp 查看开启端口
cat /etc/hosts.allow
cat /etc/hosts.deny
cat /etc/sshd_config
systemctl status firewalld 查看防火墙状态
firewall-cmd --zone=public --list-rich-rules 查看防火墙规则