博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux入侵审查浅谈转自2cto
阅读量:2434 次
发布时间:2019-05-10

本文共 1782 字,大约阅读时间需要 5 分钟。

 1. 检查帐户

1
2
3
4
5
# less /etc/passwd
# grep :0: /etc/passwd(检查是否产生了新用户,和UID、GID是0的用户)
# ls -l /etc/passwd(查看文件修改日期)
# awk -F: ‘$3= =0 {print $1}’ /etc/passwd(查看是否存在特权用户)
# awk -F: ‘length($2)= =0 {print $1}’ /etc/shadow(查看是否存在空口令帐户)

2. 检查日志

# last(查看正常情况下登录到本机的所有用户的历史记录)
注意”entered promiscuous mode”
注意错误信息
注 意Remote Procedure Call (rpc) programs with a log entry that includes a large number (> 20) strange characters(-^PM-^PM-^PM-^PM-^PM-^PM-^PM-^PM)

 

3. 检查进程

1
2
3
# ps -aux(注意UID是
0
的)
# lsof -p pid(察看该进程所打开端口和文件)
# cat /etc/inetd.conf | grep -v “^#”(检查守护进程)

检查隐藏进程
 

1
2
3
# ps -ef|awk ‘{print }’|sort -n|uniq >
1
# ls /porc |sort -n|uniq >
2
# diff
1
2

 

4. 检查文件

1
2
3
4
5
6
# find / -uid
0
–perm -
4000
–print
# find / -size +10000k –print
# find / -name “…” –print
# find / -name “.. ” –print
# find / -name “. ” –print
# find / -name ” ” –print

注意SUID文件,可疑大于10M和空格文件
# find / -name core -exec ls -l {} \;(检查系统中的core文件)
检查系统文件完整性

1
2
3
4
# rpm –qf /bin/ls
# rpm -qf /bin/login
# md5sum –b 文件名
# md5sum –t 文件名

5. 检查RPM

# rpm –Va
输出格式:

1
2
3
4
5
6
7
8
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

注意相关的 /sbin, /bin, /usr/sbin, and /usr/bin

 

6. 检查网络

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

7. 检查计划任务

注意root和UID是0的schedule
 

1
2
3
# crontab –u root –l
# cat /etc/crontab
# ls /etc/cron.*

 

8. 检查后门

 

1
2
3
4
5
6
# cat /etc/crontab
# ls /var/spool/cron/
# cat /etc/rc.d/rc.local
# ls /etc/rc.d
# ls /etc/rc3.d
# find / -type f -perm
4000

 

9. 检查内核模块

# lsmod

 

10. 检查服务

# chkconfig
# rpcinfo -p(查看RPC服务)

 

11. 检查rootkit

 

1
2
# rkhunter -c
# chkrootkit -q

转载地址:http://gkmmb.baihongyu.com/

你可能感兴趣的文章
linux下access函数的应用
查看>>
linux系统调用之文件:递归删除非空目录
查看>>
linux下获取系统时间的方法
查看>>
ubuntu12.04安装openCV2.4.6.1
查看>>
jsp与servlet的作用以及区别--为什么说JSP底层就是一个Servlet
查看>>
看HashMap源码前的必备冷知识,白话文式教学,适合刚开始了解源码的新手观看
查看>>
Oracle安装指南
查看>>
Redis面试必备(一)
查看>>
Cookie对象入门详解
查看>>
HashMap的remove()方法详解
查看>>
单例模式-分解步骤,逐步解析
查看>>
通过Form表单一次性拿到json格式数据,及后台接收
查看>>
## EL表达式与JSTL标签用法解读
查看>>
Mybatis异常:The content of elements must consist of well-formed.......(一般出现在写分页/带大于小于号的SQL)
查看>>
Mybatis光速入门(配置文件模块)
查看>>
关于Oracle的主键自增如何设置
查看>>
手撕HashMap的resize()方法源码渗透解析+图解
查看>>
Mybatis常见异常类型Could not set parameters for mapping离不开这个原因!
查看>>
Thymeleaf中一个页面怎么嵌套另一个页面,关于页面嵌套,标签告诉你应该知道的
查看>>
JAVA如何实现短信验证码--阿里云接口,新手式图文教学,个人项目有这一篇就够了
查看>>