Skip to content

Commit

Permalink
2016-03-17
Browse files Browse the repository at this point in the history
  • Loading branch information
judasn committed Mar 17, 2016
1 parent edcee7b commit 0f86a72
Showing 1 changed file with 49 additions and 2 deletions.
51 changes: 49 additions & 2 deletions Was-Hacked.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,53 @@

## 思路

- 扫描木马工具:`clamAV`
- 官网:<http://pkgs.repoforge.org/clamav/>
安装
yum -y install clamav*

启动
service clamd restart

更新病毒库
freshclam

扫描方法,
- 扫描 /etc 目录,并把扫描结果放在 /root 目录下:`clamscan -r /etc --max-dir-recursion=5 -l /root/etcclamav.log`
clamscan -r /bin --max-dir-recursion=5 -l /root/binclamav.log
clamscan -r /usr --max-dir-recursion=5 -l /root/usrclamav.log

如果日志有类似内容,表示有木马病毒
/usr/bin/.sshd: Linux.Trojan.Agent FOUND
/usr/sbin/ss: Linux.Trojan.Agent FOUND
/usr/sbin/lsof: Linux.Trojan.Agent FOUND


- 看下当前有多少登录者:`who`
- 看下最近有哪些登录者:`last`
- 查看最近尝试登录的账号信息:`grep "sshd" /var/log/secure`
- 很多这种信息就表示有人在不断地尝试用 root 登录:`Failed password for root from 222.186.56.168 port 4080 ssh2`
- 查看最近登录成功的账号信息:`grep "Accepted" /var/log/secure`,可以看到:pop3, ssh, telnet, ftp 类型
- 看下查看系统资源占用有无异常:`top`
- 看下所有进程:`ps aux`
- 查看当前系统登录者有哪些,及其登录记录:`last | more`
- 把最近执行的所有命令输出到一个文件,然后下载下来细细研究:`history >> /opt/test.txt`
- 查看当前系统所有用户有哪些:`cat /etc/passwd |awk -F \: '{print $1}'`
- 更多详细可以用:`cat /etc/passwd`
- 查看开放的端口,比如常用的80,22,8009,后面的箭头表示端口对应占用的程序:`netstat -lnp`
- 检查某个端口的具体信息:`lsof -i :18954`
- 检查启动项:`chkconfig`
- 检查定时器:`cat /etc/crontab`
- 检查其他系统重要文件:
- `cat /etc/rc.local`
- `cd /etc/init.d;ll`
- 检查文件:
- `find / -uid 0 –perm -4000 –print`
- `find / -size +10000k –print`
- `find / -name "…" –print`
- `find / -name ".. " –print`
- `find / -name ". " –print`
- `find / -name " " –print`
- 下载 iftop 分析流量,查看是否被黑客当做肉鸡使用
- 安装 iftop
- 官网:<http://www.ex-parrot.com/~pdw/iftop/>
Expand All @@ -25,6 +65,7 @@
- 有第三方源的情况(eg:EPEL):
- `yum install -y iftop`
- 运行:`iftop`
- 显示端口与 IP 信息:`iftop -nP`

``` bash
中间部分:外部连接列表,即记录了哪些ip正在和本机的网络连接
Expand All @@ -49,8 +90,14 @@ TOTAL:(总的流量) 12.9GB 229Mb 190Mb 193Mb





## 资料

- <http://www.jianshu.com/p/97b9dc47b88c>
- <http://monklof.com/post/10/>
- <http://yafeilee.me/blogs/54be6e876c69341430050000>
- <http://coolnull.com/4174.html>
- <http://www.oicqzone.com/pc/2014110420118.html>
- <>
- <>
- <>
- <>

0 comments on commit 0f86a72

Please sign in to comment.