Bypassing the real IP CDN Find method summary

CDN stands for Content Delivery Network, ie, content delivery network. CDN is built on existing intelligent network foundation virtual networks rely on servers deployed around the edge, through the center of the platform load balancing, content distribution, scheduling and other functional modules, allowing users to get what you need nearby, reduce network congestion, improve user access response speed and hit rate.

Baidu Encyclopedia

 

 

 

0x01: Domain Name Process

  • Traditional access: users access the domain -> resolve IP -> access to the target host

  • Simple Mode: user access to the domain -> CDN node -> real IP -> target host

  • 360 Guardian website: User Access Domain Name -> CDN node (Cloud WAF) -> real IP -> target host

 

 

Note: Currently on the scene most of the CDN service providers offer cloud WAF configuration options, with built-in security policy, may SQL injection, XSS Cross Site, Webshell upload, back door isolation protection, command injection, malicious scanning attacks carried out effectively blocking.

 

0x02: CDN configuration

  • 1, the domain name of the NS record points to the DNS server CDN vendors.

  • 2, to set up a domain name cname record, it points to another domain CDN vendors.

 

0x03: the CDN detection method

The use of "global Ping" rapid detection of the presence or absence CDN destination URL, if the resulting IP attribution is a CDN service provider, or get the IP address of each region is different, it could indicate the presence of CDN, can be used to detect the following website!

https://wepcc.com
http://ping.chinaz.com
https://asm.ca.com/en/ping.php

 

 

Note: Global Ping have a chance to get the real IP address of the target server, because there is no CDN service providers in some areas CDN node.

 

0x04: Find the real IP method

(1) phpinfo such as a probe to find the real IP

通过l.php、phpinfo.php等探针类文件即可得到真实IP地址,phpinfo.php搜索SERVER_NAME。

 

 

 

(2) 网站根域或子域找到真实IP

大部分CDN服务都是按流量进行收费的,所以一些网站管理员只给重要业务部署CDN,也有很多人忘了给“根域”部署CDN,所以我们可以尽可能的多搜集一些子域名来尝试得到真实IP地址。

 

 

注:有时多个子域名可能不会解析到同一台服务器,而是根据公司业务的重要与非重要性将子域名解析在内网或外网的不同服务器中,需要一定的分析能力。

 

(3) 利用邮件服务器找到真实IP

Web跟Email服务属同服务器的情况下可以通过Email来查询目标真实IP地址,但如果Web跟Email属不同服务器,那么我们通过Email得到的可能只是邮件服务器的IP地址,所以在hosts文件中即使绑定IP后无法访问目标网站也属正常现象。常见发送邮件的功能有:注册用户、找回密码等等。

 

 

 

 

(4) 域名历史解析记录找到真实IP

查询目标域名历史解析记录可能会找到部署CDN前的解析记录(真实IP地址),可用以下几个网站查询。

https://domain.8aq.net    //基于Rapid7 Open Data
https://x.threatbook.cn
https://webiplookup.com
https://viewdns.info/iphistory
https://securitytrails.com/#search
https://toolbar.netcraft.com/site_report

 

 

(5) FOFA查询网站标题找到真实IP

利用“FOFA网络空间安全搜索引擎”搜索网站源代码中的title标签内容即可得到真实IP地址。

title="*** ***** – Multi Asset Fund"

 

 

(6) Censys查询SSL证书找到真实IP

利用“Censys网络空间搜索引擎”搜索网站的SSL证书及HASH,在https://crt.sh上查找目标网站SSL证书的HASH,然后再用Censys搜索该HASH即可得到真实IP地址。

443.https.tls.certificate.parsed.extensions.subject_alt_name.dns_names:***trade.com

 

 

(7) 自建CDN节点服务器找到真实IP

这篇笔记当时没有记录下来,其实就是MS17-010刚出来时很多机器都还没打补丁,批量过程中打了一台别人自建的CDN节点服务器,然后在里边发现很多解析到这边的IP地址,其实这些IP地址就是某些网站的真实IP,所以说这种方法也算是一种思路吧,但是得先拿到这台CDN节点服务器的权限。

注:一些免费或自建CDN流量都不会很多,可以用DDOS攻击将其流量耗尽后即可显示出真实IP地址。

 

(8) 分析目标C段来简单判断真实IP

这种方法得看目标有多少子域名吧,如果子域够多,且又有多台服务器(同段),找一个没有部署CDN的子域名,然后扫描整个C段查找与目标站Title一致的即可得到它的真实IP地址!

网站域名

真实IP地址

CDN节点IP地址

111.test.com(目标)

192.168.1.10

8.8.8.8

222.test.com

192.168.1.11

9.9.9.9

333.test.com

192.168.1.12

没有CDN

假如目标站111.test.com解析在192.168.1.10,title:90sec社区,通过查询333.test.com这个子域名得到333的真实IP地址192.168.1.12,然后扫描192.168.1.x 整个C段,扫到192.168.1.10这个IP后发现一个title为“90sec社区”的网站,域名也是111.test.com后就能确定192.168.1.10是它的真实IP地址了,虽然这种方法没有实践过,但肯定是有这种情况的,在遇到时可以尝试一下?

 

(9) 利用目标网站的漏洞找到真实IP

Web漏洞:
XSS、SSRF、命令执行、文件上传等,需要先绕过云WAF的安全防护。

敏感信息泄露:
phpinfo、Apache status和Jboss status敏感信息泄露,网页源代码泄露,SVN、Github信息泄露等。

 

(10) 通过社工CDN控制台找到真实IP

(11) Zmap全网扫描及F5 LTM解码法

这两种方法都是前辈们写的,个人感觉较为复杂,并没有实践测试过,不知道是否真可行?


注:部署了CDN的网站有必要设置严格访问控制策略,仅允许CDN节点访问网站真实服务器(80端口),这样设置的好处就是即使别人在hosts文件中绑定了真实IP以后仍然无法访问。笔者曾经在一次渗透测试过程中也遇到过类似情况,就是成功绑定了真实IP后,虽然能够正常访问到目标网站,但是仍然没有绕过云WAF,具体情况有点记不太清了,当时没有去细研究这个问题!

Guess you like

Origin www.cnblogs.com/nongchaoer/p/12055362.html