一.升级原因描述
之前在博客中编写过一套Centos7.5部署zabbix4.0的文档,起初也一直在使用,但是后来通过漏洞扫描测试发现4.0中有一个漏洞信息。
http://your_zabbix_ipaddress/zabbix/zabbix.php?action=dashboard.view&dashboardid=1
攻击者通过访问zabbix.php?action=dashboard.view&dashboardid=1进入后台控制面板,可以操作Dashboard/Report/Screen/Map等功能
小伙伴们可以看看自己有没有中招哈,学长就不做过多描述了。但是此处呢也想和大家说几点过于zabbix使用的一些安全信息。毕竟监控服务器是公司的秘密所在,运维的"眼睛",其中包含公司所有业务服务器的详细信息,为了方便我们自己查看我们也会做好备注【例:数据库服务器,WEB服务器,Tomcat服务器,Mysql-server服务器,Mysql-slave服务器等等】并且配置信息中包含数据库服务器IP地址等信息,如果IP地址,服务器备注信息,端口开放,都被爆开了,那么你的网络架构中奖没有安全可言。监控一旦暴露了问题也就跟着来了。
基础安全
1.默认用户名密码及弱口令
WeapPassword = [("admin","zabbix"),("Admin","zabbix"),("guest","")]
这个相信大家都不陌生吧,看看自己有没有做修改吧。
2.数据库SQL注入
latest.php处toogle_ids[]参数SQL注入,可获取系统权限。但是这个是需要在登录系统后才可以做的操作,所以弱口令是必须要禁用的
URL以及payload:
1 """
2 http://your_zabbixserver_address/latest.php?output=ajax&sid=登录后的sessionid的后16位&favobj=toggle&toggle_open_state=1&toggle_ids[]=15385); select * from users where (1=1
3 """
说到这啊可能很多学弟们已经蒙圈了吧,其实预防也简单只需要注意以下两点就可以了
1.关注官方推送信息,定期做系统升级更新【后续的话学长尽快出一版zabbix在线升级的文档】
2.拒绝弱口令,默认用户名密码,密码定期更改且符合安全规范
Centos7.5部署zabbix4.4
好了,不闲谈了,进入今天的正题毕竟咱们不是聊zabbix安全的对吧。
1.基础环境
在描述一下,学长这里的环境默认已经禁用iptables及firewalld防火墙了,也关闭selinux了。yum也配置了阿里云的Centos-7.repo和epel-release。此处就不做过多描述了。yum信息可以参考学长之前的文档文档地址。先给你们看下我的基础环境,避免学弟学妹们出现不一致的现象我也没有做什么只是配置好了yum,关闭了上面说的防火墙等。
[root@localhost ~]# systemctl is-enabled firewalld
disabled
[root@localhost ~]# firewall-cmd --stat
not running
[root@localhost ~]# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
[root@localhost ~]# getenforce
Disabled
[root@localhost ~]# ll /etc/yum.repos.d/
总用量 16
drwxr-xr-x. 2 root root 187 9月 3 2019 bak
-rw-r--r--. 1 root root 2523 9月 3 2019 Centos-7.repo
-rw-r--r--. 1 root root 951 10月 3 2017 epel.repo
-rw-r--r--. 1 root root 1050 10月 3 2017 epel-testing.repo
-rw-r--r--. 1 root root 1245 9月 3 2019 mslinux.repo //这个是清华大学的yum源,本次实验也用不到
1.安装zabbix4.4的yum源
安装yum源的命令怕你们不方便复制,够贴心吧。
yum install -y https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
[root@localhost ~]# yum install -y https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
zabbix-rel