Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问怎么扫描到这些IP的? #8

Open
cxjava opened this issue Apr 22, 2022 · 5 comments
Open

请问怎么扫描到这些IP的? #8

cxjava opened this issue Apr 22, 2022 · 5 comments

Comments

@cxjava
Copy link

cxjava commented Apr 22, 2022

hello,请问怎么扫描到这些IP的,我这边想自己扫描一些距离自建cloud近的IPV6的地址。不知道怎么确认某个IPV6距离某个cloud更近?里面的具体原理或者方法能不能分享一下?

@woodongwong
Copy link

woodongwong commented May 25, 2022

可以通过AS号去扫,http://whois.ipip.net/ 可以拿到某AS的所有IP,然后使用程序挨个访问一遍。推荐使用 https://speed.cloudflare.com/cdn-cgi/trace 去测试通不通,顺便还能拿到节点、ip和延迟等信息,再使用 https://speed.cloudflare.com/__down?bytes=300000000 测试下载速度。扫描前可以先尝试tcp连接443端口通不通(只判断能不能收到握手时的ACK),可以节省扫描时间。(ps:这个只能满足标题的问题)

@cxjava
Copy link
Author

cxjava commented May 25, 2022

@woodongwong 多谢回复哈,其实我知道有其他工具的, 比如 https://github.com/XIU2/CloudflareSpeedTest ,其实更想知道楼主用的是什么工具扫描到这些高质量IP的。

@woodongwong
Copy link

@cxjava 与cloudflarespeedtest不同的是,此项目中的ip 是非官方的,我猜测,有一些服务器是想对cloudflare做代理,但是因为配置不当,导致所有人都可以使用;还有一些ip 是对所有的域名都进行代理,很可能是因为配置不当导致的bug。下图中就是一个很好的例子。关于扫描工具,实现不难吧?可以参考楼上我说的思路。
IMG_0020

@woaiguyu1314
Copy link

可以通过AS号去扫,http://whois.ipip.net/ 可以拿到某AS的所有IP,然后使用程序挨个访问一遍。推荐使用 https://speed.cloudflare.com/cdn-cgi/trace 去测试通不通,顺便还能拿到节点、ip和延迟等信息,再使用 https://speed.cloudflare.com/__down?bytes=300000000 测试下载速度。扫描前可以先尝试tcp连接443端口通不通(只判断能不能收到握手时的ACK),可以节省扫描时间。(ps:这个只能满足标题的问题)

大佬这个https://speed.cloudflare.com/cdn-cgi/trace网站怎么使用ip访问呀,

@us254
Copy link

us254 commented Jan 19, 2024

methods to scan and test IP addresses, especially concerning their proximity and quality relative to Cloudflare's network.

Scanning by Autonomous System (AS) Number:

Websites like http://whois.ipip.net/ allow you to look up all IP addresses associated with a particular AS. Cloudflare, for example, has its own AS number (AS13335).
Once you have this list of IPs, you can programmatically (using a script or tool) access them one by one to see which are operational and have good latency or other desired characteristics relative to your needs.
Testing Connectivity and Performance:

For Cloudflare IPs, you can use https://speed.cloudflare.com/cdn-cgi/trace to get details about the IP address you are connecting from, the data center you are hitting, and other information like latency. You replace speed.cloudflare.com with the specific Cloudflare IP address you're testing.
To test download speeds, use https://speed.cloudflare.com/__down?bytes=300000000. This endpoint allows you to download a 300MB file from Cloudflare's servers, so you can assess the throughput performance of the IP address.
Pre-Scan Check:

Before you scan a large number of IPs, it's efficient first to check if there's a successful TCP connection to port 443 (HTTPS). You can do this by seeing if the TCP handshake is completed (ACK received), saving time by eliminating IPs where the handshake fails.
Specific Query:

How to use an IP address to access https://speed.cloudflare.com/cdn-cgi/trace? You can use curl with the --resolve option to specify the IP address manually:
shell
curl "https://speed.cloudflare.com/cdn-cgi/trace" --resolve speed.cloudflare.com:443:[IP_Address]
Replace [IP_Address] with the IPv6 or IPv4 you're testing. This directs curl to bypass DNS resolution and connect directly to the provided IP address when accessing the Cloudflare trace URL.

The command printed in the example (curl "https://www.baidu.com" --resolve www.baidu.com:443:39.106.114.208) shows a similar pattern but uses Baidu's domain. This demonstrates how you can use curl to check the response from a specific server that isn't necessarily registered in DNS to the domain being queried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants