1. 首先找一个存在cdn节点的网站

http://ping.chinaz.com/www.uniqlo.cn

自动化识别 CDN节点端口特征
通过在线网站查到的CDN节点示例

 

2、通过上一步可以看到,目标网站有很多cdn节点(未完全识别,需要我们进一步识别)

3、根据http头部,对其中一个确认的cnd节点进行端口分析

自动化识别 CDN节点端口特征
识别到的端口信息

4、在此假设,目标网站使用了同一家cdn、并且cdn节点端口开放情况类似

5、利用下面的自动化代码可以区分出cdn节点的IP地址

#!/usr/bin/env python3
# -*- coding:utf-8 -*-

import telnetlib

hosts=open('cdnList.txt','r')

ports=['80','8080','8081','8082']
cdn=[]
for host in hosts:
	host=host.strip('\n')
	try:
		for port in ports:
			tel=telnetlib.Telnet(host,port=port,timeout=3)
			tel.set_debuglevel(2)
			print(tel)			
			cdn.append(host)
	except Exception as e:
		print(e)
hosts.close()

hosts=open('cdnList.txt','r')
origin=[]
for i in hosts:
	i=i.strip('\n')
	origin.append(i)

print('origin size is ',len(set(origin)))
print('cdn size is ',len(set(cdn)))

real=list(set(origin).difference(set(cdn)))
print('real IP size is ',len(real))
print('real ip list is ',real)

diff=list(set(origin).intersection(set(cdn)))
print('差集 大小是 ',len(diff))
print('差集是 :',diff)

6、代码执行结果如下

自动化识别 CDN节点端口特征
脚本执行结果

7、最后可以对排查出来的ip进行手工确认工作

 

附件地址【附件中包含文中的脚本和使用到的cdn列表】:

链接:https://pan.baidu.com/s/1HUwBWmsjiMhYi71lUgKyDg 密码:cmsr

相关文章:

  • 2021-05-24
  • 2021-04-08
  • 2021-09-28
  • 2021-12-29
  • 2021-11-01
  • 2021-11-18
猜你喜欢
  • 2021-06-30
  • 2022-01-08
  • 2021-11-16
  • 2022-01-08
  • 2021-11-23
  • 2021-05-16
相关资源
相似解决方案