服务器的 IP 如果泄露, DDoS 等情况就有可能发生,同时还会极大地增加攻击面。因此,服务器的HTTP流量必须始终通过 CDN(比如Cloudflare CDN)。在 https://securitytrails.com/dns-trails 网站上,一个域名的全部子域名和 DNS 历史记录都可以轻松查到,因此不能有任何时刻让服务器真实 IP 暴露在外。
; <<>> DiG 9.18.0 <<>> +trace sunnysab.cn ;; global options: +cmd . 329177 IN NS a.root-servers.net. . 329177 IN NS c.root-servers.net. . 329177 IN NS i.root-servers.net. . 329177 IN NS l.root-servers.net. . 329177 IN NS b.root-servers.net. . 329177 IN NS j.root-servers.net. . 329177 IN NS h.root-servers.net. . 329177 IN NS k.root-servers.net. . 329177 IN NS f.root-servers.net. . 329177 IN NS d.root-servers.net. . 329177 IN NS m.root-servers.net. . 329177 IN NS g.root-servers.net. . 329177 IN NS e.root-servers.net. ;; Received 267 bytes from 192.168.31.1#53(192.168.31.1) in 6 ms
cn. 172800 IN NS a.dns.cn. cn. 172800 IN NS b.dns.cn. cn. 172800 IN NS c.dns.cn. cn. 172800 IN NS d.dns.cn. cn. 172800 IN NS e.dns.cn. cn. 172800 IN NS f.dns.cn. cn. 172800 IN NS g.dns.cn. cn. 172800 IN NS ns.cernet.net. cn. 86400 IN DS 57724 8 2 5D0423633EB24A499BE78AA22D1C0C9BA36218FF49FD95A4CDF1A4AD 97C67044 cn. 86400 IN RRSIG DS 8 1 86400 20220422050000 20220409040000 47671 . Ecc7/2n1m4EGcDGsilV4h8Dq+jHAx2UN6KhJC9QrTGGfyqdxTaiKQvDp llcpdMvF5G07McmLR2X4Z6/z9Af+n22X9fhxJL25JYPwvmb9feZuVo51 FEQ6EFiRgODb6NxqeOGSEpPzr4ERT5zA+hBRTboGQv/8G77pXMEn9vkU FlBwIBVVZhuyLPnliIRsy1scdRNJf92s8ExSh4R3roK0PVdZNcdJdmgm sdTRiihRyZa8wAaVc3wgXA9JAxHsmC64K7UUAxzhZDHLzn+Qr3OhMjAS mbqRNJOBTuQNvJK7tsKERZvwdNMfDnTZYaRiIQe8p0aS2I/MBd5IFdzj 9x6Dmw== ;; Received 702 bytes from 199.7.83.42#53(l.root-servers.net) in 16 ms
sunnysab.cn. 86400 IN NS f1g1ns1.dnspod.net. sunnysab.cn. 86400 IN NS f1g1ns2.dnspod.net. 3QDAQA092EE5BELP64A74EBNB8J53D7E.cn. 21600 IN NSEC3 1 1 10 AEF123AB 3QHKTF6LTFG8AAFUUAJSR8RVAJP99SFU NS SOA RRSIG DNSKEY NSEC3PARAM 3QDAQA092EE5BELP64A74EBNB8J53D7E.cn. 21600 IN RRSIG NSEC3 8 2 21600 20220421020437 20220322010437 38388 cn. h8l0G9BHCfmmihReDucaiq7ZGQVaLbZMg00XJW0S0ueVhyvgFGtobZrS zAw4TgiKkQ4RzVMIaQDCpl9Ndj1gvhGvK9tmO3DxRLMTs2EfhbS4oaAW J5ZPgtNZWe9UnmNYShX1a7BvWLAuF+yx4ZhP/pxd5LLbdpIO4FLGBIkl JKE= 460MA1KN9RCS318KUU45F11O2MJGT558.cn. 21600 IN NSEC3 1 1 10 AEF123AB 46F805934J5U26CSL3LRD98GD3IJC8R8 NS DS RRSIG 460MA1KN9RCS318KUU45F11O2MJGT558.cn. 21600 IN RRSIG NSEC3 8 2 21600 20220421020437 20220322010437 38388 cn. hfaIKR67Vm4pnSy8ScHFEJ55K1hjG2u49euVOJ7W6d1N5GnLF6Tn5JxF X/BfScthNSnLCQl/5c3AE//pUTuviDQePG4syifn58ljjV/hSV1ARprG PY+DA+VPLE6bVX1RV5P7kcGtHIFZxHWhHnGgB5irC6PuEkqWrx9RM1QX fWg= ;; Received 585 bytes from 203.119.27.1#53(c.dns.cn) in 6 ms
sunnysab.cn. 600 IN A 106.15.182.107 sunnysab.cn. 86400 IN NS f1g1ns2.dnspod.net. sunnysab.cn. 86400 IN NS f1g1ns1.dnspod.net. ;; Received 120 bytes from 58.251.121.111#53(f1g1ns2.dnspod.net) in 36 ms
If you’re running SSL on those domains but don’t have a wildcard cert, it’s probably grabbing them from certificate transparency logs. https://crt.sh is a nice place to look things up (though updates have stopped for a month due to ongoing backend changes).
Crt.sh is a site where you could find all the SSL or TLS certificates of the particular targeted domain. And the site is open-source to monitor the certificates.
The site is in a GUI format and it is really very easy to gather the information and the motive of the site is to keep the certificate logs very transparently.
Even you could find the certificates algorithms in a ciphertext format. The crt.sh stands for “certificates.Saint Helena”
为了保证小程序和 App 的后端服务不被侧面攻击(包括旁站、暴露端口等方式的攻击),一般需要完全隐藏源站的真实地址。于是开通了阿里云的全站加速服务,将网站放置于 CDN 后面。操作后发现并不能完全解决问题,当使用 IP 访问源站时,nginx 会默认返回当前网站内容,攻击这可以依赖一类互联网空间搜索平台(如 ZoomEyes)通过网站内容反向检索到源站真实 IP 地址。
屏蔽直接 IP 访问
树洞配置指南中给出的方法是只允许 CDN (文中是 Cloudflare)服务器访问源站 Web 端口,但阿里云并未提供他们的 CDN 服务器列表,只提供了一个查询接口:
本想试试对阿里云 CDN 的 IP 反向域名解析一波,看看是否存在阿里云 CDN 的特征,但是好像没有什么有用的信息: