近期有接到客户反馈,网站已经在多个方面上做好了源站IP保密工作,并且在接入AADUN高防cdn之后源站服务器仍然遭受到多次ddos攻击,通过多方面排查基本确定泄露网站源站服务器IP的原因是因为ssl证书。
市面上很多工具爬虫24小时不停的抓取扫描IP,这类的工具网站通过无差别HTTP/HTTPS请求所有的IP,并将抓取到的IP地址所对应的网站记录到网站,以至于有些攻击者可以通过这类的网站可以直接查询到网站源站IP,因此我们在搭建网站的时候一定要做好屏蔽安全工作。
排查是否属于上述问题:通过https://你的源站IP,如果可以访问并且浏览器左上角锁的标志中显示了你的域名ssl证书那么就存在泄露的风险。
解决方案
宝塔面板用户可添加一个随意的网站1.1.1.1(域名或者IP随意),然后删除宝塔创建网站默认生成的全部文件,然后为这个随意添加的网站配置一个无效的证书(本文下方会为大家提供一个无效的证书使用),配置好证书之后在宝塔面板后台:【网站】-【默认站点】中心选择刚才添加的这个随意的网站作为默认站点。
证书(PEM格式)
—–BEGIN CERTIFICATE—–
MIIGZDCCBMygAwIBAgIRAItzU97ziYapzQuBtObbQjowDQYJKoZIhvcNAQEMBQAw
WTELMAkGA1UEBhMCQ04xJTAjBgNVBAoTHFRydXN0QXNpYSBUZWNobm9sb2dpZXMs
IEluYy4xIzAhBgNVBAMTGlRydXN0QXNpYSBSU0EgRFYgVExTIENBIEcyMB4XDTIz
MDIyNDAwMDAwMFoXDTI0MDIyNDIzNTk1OVowGDEWMBQGA1UEAxMNamYuMjg2ODEx
LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMgnEJqkq8yC9RoT
FBezNIAEaudMS0EJYTcFYaqDD/wrFeYzq8Dn4l5lhNr9H7Qb4ygpDLtBu0ibsZkJ
vtx3s8zDnvQI3ymOW2mbqM7ROp7GdxmaX4lSNZ/CPdVCqa5V9qp2HGEDwOZ23e5J
k+jLL7w2i01H4zw+Yk5dWQ6PlhA1jZ3+Y9v3EsQZNzDTzsqN77ZdwOgQicFL/DJF
F5Ax5OCMVjjw6voB7dcjG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4SumHs1yLm3ixGFR4adU3lFgLsYuGoxqTTFSJ2lC+wGN
h8TQ2vqu4vJB1z7qkoLxXDesf8luWGD6AbNIquUrEKec8cTWuFRRhFjEt7AN7Uth
w4r7QFZJ6y8P18wRVFGBa1eCMTeVxgNuIBrBRGMQKYk4xxPATiyF0UcCgYEA0LIo
qoQRy0aTcv+1rqeyhqFj/pCoU7PFHj2NI3O++E5ANb8zDEVll/UKSzqlFx3aY5T3
2TFbzDqOnb51g2lquzkuiC29XoXWyIKVZjHX50W95vIvs07LU/tKxOaLFMTfZpR4
0urkxTO+o7VEKaCAX6K9gsPMF7SRiG8fEAObxksCgYEApvQAQeBEOE3rL6T60PGu
M2YOPQkBYBAr/IKNFUaIfqdcOyqL/o2mxT0j3NR8mhysgwbokepy4AeHyHmcDIMd
XoygjH07lJ61zX3RmRTVPc7zLgmM3uDUwRjAE5bZuxCMkGzXF+Q4wlqGUJuAwF7S
wwgOhkdq1SPXtSAMM9x4vr8CgYBDjpipci1Mb2FF5c8LZc/d0xrKiktjJRuXSXeJ
1WspeDNC8sz0mPZlNXaKmcZdcFWEzPFahqbfusj1+XSTAKoDR2Rvwta9ZXf82oDA
Xzwz6pipzRZx5fzeB8fRa4v0QjLLQx7FsDI0QCbjWcdh7koAK29LiFRmDBbcYpRc
m75udwKBgAF0phrWTH0AyQ3qHdaNAX2LZqhpUOFhIDeBnj+0krqh4MsLENjYl3PQ
1df5JaZC9zOePj43DIJF63wChFUQho4BYlSKpKbfRSqbhQ2XiRYyXCO6g4IlnK/t
eE5E4q4PNmH3yYfJ1cKDzcwjDVyh3Wzm7UeAr/KobRaTBpTVTBnk
—–END RSA PRIVATE KEY—–
以上证书为随意生成的一个无效域名ssl证书,可用于预防ssl证书泄露IP所导致的风险问题,证书过期也可以继续使用,不影响预防IP泄露风险的效果(有动手能力的朋友也可以自行生成ssl证书)。
另外建议您的宝塔面板上的服务器不要设置默认站点,避免恶意解析,同时宝塔上面有多少个网站就要给多少个网站部署SSL证书或者都不部署。
暂无评论