Skip to content

Commit 1bd003b

Browse files
committed
2016-03-14
1 parent 69d4b23 commit 1bd003b

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

Off-line-Yum-Install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
- 安装下载的 rpm 文件:`sudo rpm -ivh *.rpm`
2121

2222

23-
## NFS 资料
23+
## 资料
2424

2525
- <http://www.jianshu.com/p/5930545b5591>

Was-Hacked.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# 被黑客入侵的检查
2+
3+
------
4+
5+
## 思路
6+
7+
8+
- 看下查看系统资源占用有无异常:`top`
9+
- 查看当前系统登录者有哪些,及其登录记录:`last | more`
10+
- 查看当前系统所有用户有哪些:`cat /etc/passwd |awk -F \: '{print $1}'`
11+
- 更多详细可以用:`cat /etc/passwd`
12+
- 查看开放的端口,比如常用的80,22,8009,后面的箭头表示端口对应占用的程序:`netstat -lnp`
13+
- 检查某个端口的具体信息:`lsof -i :18954`
14+
- 下载 iftop 分析流量,查看是否被黑客当做肉鸡使用
15+
- 安装 iftop
16+
- 官网:<http://www.ex-parrot.com/~pdw/iftop/>
17+
- 使用文章:<https://linux.cn/article-1843-1.html>
18+
- 没有安装第三方源的情况:
19+
- 安装依赖包:`yum install -y flex byacc libpcap ncurses ncurses-devel libpcap-devel`
20+
- 下载源码包:`wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz`
21+
- 解压:`tar zxf iftop-0.17.tar.gz`
22+
- 进入解压目录:`cd iftop-0.17/`
23+
- 编译:`./configure`
24+
- 安装:`make && make install`
25+
- 有第三方源的情况(eg:EPEL):
26+
- `yum install -y iftop`
27+
- 运行:`iftop`
28+
29+
``` bash
30+
中间部分:外部连接列表,即记录了哪些ip正在和本机的网络连接
31+
32+
右边部分:实时参数分别是该访问 ip 连接到本机 2 秒,10 秒和 40 秒的平均流量
33+
34+
=> 代表发送数据,<= 代表接收数据
35+
36+
底部会显示一些全局的统计数据,peek 是指峰值情况,cumm 是从 iftop 运行至今的累计情况,而 rates 表示最近 2 秒、10 秒、40 秒内总共接收或者发送的平均网络流量。
37+
38+
TX: cumm: 143MB peak: 10.5Mb rates: 1.03Mb 1.54Mb 2.10Mb
39+
RX: 12.7GB 228Mb 189Mb 191Mb 183Mb
40+
TOTAL: 12.9GB 229Mb 190Mb 193Mb 185MbW
41+
42+
```
43+
44+
- 禁用 root 账号登录:`vim /etc/ssh/sshd_config`
45+
- 把 PermitRootLogin 属性 yes 改为 no
46+
- 如果安全度要更高,可以考虑禁用口令登录,采用私钥/公钥方式:`vim /etc/ssh/sshd_config`
47+
- 设置属性:PasswordAuthentication 为 no
48+
- 如果还要限制指定 IP 登录,可以考虑编辑:hosts.allow 和 hosts.deny 两个文件
49+
50+
51+
52+
53+
54+
## 资料
55+
56+
- <http://www.jianshu.com/p/97b9dc47b88c>

0 commit comments

Comments
 (0)