码迷,mamicode.com
首页 > 系统相关 > 详细

linux应急响应常用命令和思路

时间:2017-12-14 22:55:32      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:pre   time   shel   tar   color   div   bash   gpo   path   

1、首先查看网络连接情况:

1 #netstat -anop | grep "ssh" /*查看ssh连接或者telent*/
2 #netstat -anop | grep "a.b.c.d" /*查看连接的IP*/
3 #ps aux /*查看可以进程*/ 
4 /*
5 可以结合起来,因为netstat -anop里面有pid
6 */

由上面确认是否攻击者仍在连接。如果连接,建议关闭网络或直接下线脱机应急。

2、查看history

1 #history /*查看历史命令*/=》即使攻击者敲击了unset history 也至少会被记录这一条

如果觉得history历史记录太少请查看历史命令文件:

1 #vim ~/.bash_history

3、查看用户:

1 #who        /*查看登录情况*/
2 #whoami   /*查看自己是谁*/
3 #vim /etc/passwd
4 #vim /etc/shadow

4、查看最近被改过的文件:

1 #find /path/ -mtime -1 -type f -print
2 #find /path/ -ctime -1 -type f -print
3 #ls -alt

5、查看所有脚本文件打包:

1 find /var/www/html/  |grep -E ".asp$|.aspx$|.jsp$|.jspx$|.jspf$|.php$|.php3$|.php4$|.php5$|.inc$|.phtml$|.jar$|.war$|.pl$|.py$|.cer$|.asa$|.cdx$|.ashx$|.ascx$|.cfm$|.cgi$ "|xargs tar zcvf /tmp/shellscript.tar.gz

6、查看web日志:

1 /*access_log:/var/log/httpd/access_log*/
2 #cat access_log | awk {print $1}|sort|uniq -c  查看访问的ip
3 #cat access_log | awk {print $1}|sort|uniq -c| sort -n -t   按访问次数排序
4 #find ./ -name "*.php" |grep 404|xargs ls -la//(xargs)把前面的结果传到后面作为输入 
5 /*awk指定符号切:-F ‘切割符号‘
6 #find /var/www/html/ -name "*.php" |xargs grep chenran 查看文件里面的内容

 

linux应急响应常用命令和思路

标签:pre   time   shel   tar   color   div   bash   gpo   path   

原文地址:http://www.cnblogs.com/KevinGeorge/p/8040227.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!