排查顺序

一、是否入侵检查

1)检查系统日志

1
2
检查系统错误登陆日志,统计IP重试次数(last命令是查看系统登陆日志,比如系统被reboot或登陆情况)
[root@bastion-IDC ~] # last

2)检查系统用户

1
2
3
4
5
6
7
8
9
10
11
12
13
14
查看是否有异常的系统用户
[root@bastion-IDC ~] # cat /etc/passwd
 
查看是否产生了新用户,UID和GID为0的用户
[root@bastion-IDC ~] # grep "0" /etc/passwd
 
查看 passwd 的修改时间,判断是否在不知的情况下添加用户
[root@bastion-IDC ~] # ls -l /etc/passwd
 
查看是否存在特权用户
[root@bastion-IDC ~] # awk -F: '$3==0 {print $1}' /etc/passwd
 
查看是否存在空口令帐户
[root@bastion-IDC ~] # awk -F: 'length($2)==0 {print $1}' /etc/shadow

3)检查异常进程

1
2
3
4
5
6
7
8
9
10
注意UID为0的进程
使用 ps  -ef命令查看进程
 
察看该进程所打开的端口和文件
[root@bastion-IDC ~] # lsof -p pid命令查看
 
检查隐藏进程
[root@bastion-IDC ~] # ps -ef | awk '{print }' | sort -n | uniq >1
[root@bastion-IDC ~] # ls /porc |sort -n|uniq >2
[root@bastion-IDC ~] # diff 1 2

4)检查异常系统文件

1
2
3
4
5
6
[root@bastion-IDC ~] # find / -uid 0 –perm -4000 –print
[root@bastion-IDC ~] # find / -size +10000k –print
[root@bastion-IDC ~] # find / -name "…" –print
[root@bastion-IDC ~] # find / -name ".." –print
[root@bastion-IDC ~] # find / -name "." –print
[root@bastion-IDC ~] # find / -name " " –print

5)检查系统文件完整性

1
2
3
4
[root@bastion-IDC ~] # rpm –qf /bin/ls
[root@bastion-IDC ~] # rpm -qf /bin/login
[root@bastion-IDC ~] # md5sum –b 文件名
[root@bastion-IDC ~] # md5sum –t 文件名

6)检查RPM的完整性

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@bastion-IDC ~] # rpm -Va #注意相关的/sbin,/bin,/usr/sbin,/usr/bin
输出格式说明:
S – File size differs
 
M – Mode differs (permissions)
 
5 – MD5  sum  differs
 
D – Device number mismatch
 
L – readLink path mismatch
 
U – user ownership differs
 
G – group ownership differs
 
T – modification  time  differs

7)检查网络

1
2
3
4
[root@bastion-IDC ~] # ip link | grep PROMISC(正常网卡不该在promisc模式,可能存在sniffer)
[root@bastion-IDC ~] # lsof –i
[root@bastion-IDC ~] # netstat –nap(察看不正常打开的TCP/UDP端口)
[root@bastion-IDC ~] # arp –a

8)检查系统计划任务

1
2
3
[root@bastion-IDC ~] # crontab –u root –l
[root@bastion-IDC ~] # cat /etc/crontab
[root@bastion-IDC ~] # ls /etc/cron.*

9)检查系统后门

1
2
3
4
5
[root@bastion-IDC ~] # cat /etc/crontab
[root@bastion-IDC ~] # ls /var/spool/cron/
[root@bastion-IDC ~] # cat /etc/rc.d/rc.local
[root@bastion-IDC ~] # ls /etc/rc.d
[root@bastion-IDC ~] # ls /etc/rc3.d

10)检查系统服务

1
2
[root@bastion-IDC ~] # chkconfig —list
[root@bastion-IDC ~] # rpcinfo -p(查看RPC服务)

11)检查rootkit

1
2
[root@bastion-IDC ~] # rkhunter -c
[root@bastion-IDC ~] # chkrootkit -q
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值