Cloudflare scanner
This scanner can be used with any CDN, provided you have the necessary requirements, such as an IP list or domain list for scanning. By default, it is configured to target Cloudflare. Please review the JSON configuration document below.
Caution
نکات مهم برای وضعیت کنونی ایران
-
اسکن مبتنی بر Ping را غیرفعال کنید. بسیاری از آیپیها به سوکت TCP پاسخ میدهند، حتی زمانی که Ping کار نمیکند. در فایل کانفیگ، در بخش Ping مقدار گزینهی Enable را روی false قرار دهید.
-
تعداد Goroutineها را بیشتر از ۸ تنظیم نکنید. در غیر این صورت، پس از چند دقیقه ممکن است اتصال اینترنت بهطور کامل قطع شود (محدودیت اعمالشده از سمت اپراتور برای جلوگیری از اسکن گسترده).
-
حالتهای مختلف Fingerprint را امتحان کنید. برای اپراتور ایرانسل، در محدودترین شرایط معمولاً فقط حالت chrome پاسخ میدهد.
-
مقدار IgnoreRange را خالی بگذارید تا تمام رنجهای آیپی بدون استثنا اسکن شوند.
-
اگر سرعت اینترنت بهشدت پایین است، مقدار MaxLatency را افزایش دهید.
-
از آیپی مقصد پینگ گرفته میشود. اگر پاسخ دریافت شود و مقدار تأخیر کمتر از MaxPing باشد، اسکنر به مرحله بعد میرود. در غیر این صورت خروجی قرمز میشود.
-
اتصال TCP به آیپی برقرار میشود. اگر اتصال موفق باشد، مرحله بعد اجرا میشود. اگر در بازه زمانی MaxLatency اتصال برقرار نشود، خروجی قرمز خواهد بود.
-
فرآیند TLS Handshake انجام میشود. در صورت موفقیت، اسکنر به مرحله بعد میرود. اگر این فرآیند در مدت MaxLatency کامل نشود، خروجی قرمز میشود.
-
اولین درخواست HTTP ارسال میشود. اگر پاسخ دریافت شود و تأخیر کمتر از MaxLatency باشد، مرحله بعد اجرا میشود. در غیر این صورت خروجی قرمز خواهد بود.
-
کد وضعیت (Status Code) بررسی میشود تا یکی از مقادیر 200 یا 204 باشد. سپس هدر Server بررسی میشود تا مقدار آن cloudflare باشد (مطابق تنظیمات ResponseStatusCode و ResponseHeader).
-
اگر Jitter غیرفعال باشد و مرحله ۵ با موفقیت انجام شده باشد، خروجی سبز نمایش داده میشود.
-
اگر Jitter فعال باشد، به تعداد Samples درخواست HTTP با فاصله زمانی Interval ارسال میشود. تأخیر هر درخواست اندازهگیری و مقدار جیتر محاسبه میشود.
- اگر مقدار جیتر کمتر از حد مجاز باشد، خروجی سبز میشود.
- اگر مقدار جیتر بیشتر از حد مجاز باشد، خروجی زرد میشود.
- اگر هنگام محاسبه جیتر اتصال قطع شود یا پاسخی دریافت نشود، خروجی قرمز شده و در انتهای خروجی عبارت jammed درج میشود.
- To fetch the latest
ipv4.txt, delete the existing file. It will be automatically downloaded from the cf-tools latest release. If the download fails, it will gracefully fall back toipv4_old.txt.
- HTTP/1.1 + HTTP/2 + HTTP/3
- Ping + Latency + Jitter + Download speed test
- UTLS
- Noise for HTTP/3
- UDP scan
- CSV format result
- Padding
To build, run the following commands in the project directory:
go mod tidy
go build -ldflags "-w -s"- Windows:
- Powershell:
Get-Content result.txt | Sort-Object { ($_ -split '\s+')[2] } | Out-File sorted_result.txt - CMD:
powershell "Get-Content result.txt | Sort-Object { ($_ -split '\s+')[2] } | Out-File sorted_result.txt" - NuShell
powershell "Get-Content result.txt | Sort-Object { ($_ -split '\\s+')[2] } | Out-File sorted_result.txt"
- Powershell:
- Linux:
- Bash:
sort -k3,3 -n result.txt > sorted_result.txt
- Bash:
- NOTE❕: Both HTTP/2 and HTTP/1.1 are supported, with protocol selection based on ALPN. If ALPN is explicitly set to
"h2", HTTP/2 will be used—provided the server supports it. By default, ALPN is set to"h2", "http/1.1", allowing HTTP/2 when available; otherwise, the connection falls back to HTTP/1.1. - WARNING
⚠️ : When UTLS is enabled, ALPN is forcibly set to"h2", "http/1.1"and cannot be overridden via the configuration file. - WARNING
⚠️ : If DownloadTest is enabled, use only one Goroutine; running multiple will yield inaccurate results.
Caution
Avoid using your own domain for scanning activities, as CDN providers may interpret the traffic as DDoS or port scanning behavior and block your domain.
{
"Hostname": "cp.cloudflare.com", // The target hostname or domain to scan.
"Ports": [], // If empty, defaults to port 443 for HTTPS and 80 for HTTP.
"Path": "/", // The path to append to the hostname.
"Headers": { // Additional HTTP headers.
"User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0)"],
"Accept-Encoding": ["gzip", "br"]
},
"ResponseHeader": { // Headers that an HTTP response must include.
"Server": "cloudflare"
},
"ResponseStatusCode": [200, 204], // Acceptable status codes.
"Ping": {
"Enable": true, // Enable ping IP.
"MaxPing": 300, // Maximum acceptable ping time (in milliseconds).
"Privileged": false, // SetPrivileged sets the type of ping pinger will send. false means pinger will send an "unprivileged" UDP ping. true means pinger will send a "privileged" raw ICMP ping. Setting to true requires that it be run with super-user privileges.
"Size": "24-64" // Pinger packet size
},
"Goroutines": 8, // Number of concurrent goroutines for scanning.
"Scans": 6000, // Total number of scans to perform per goroutine.
"Maxlatency": 1000, // Maximum acceptable latency (in milliseconds).
"Jitter": {
"Enable": true, // Enable jitter calculation.
"MaxJitter": 20.0, // Maximum acceptable jitter.
"Samples": 5, // Number of samples to calculate average jitter.
"Interval": 200 // Delay (in ms) between consecutive jitter samples.
},
"IpVersion": "v4", // IP version (`v4` or `v6`).
"IplistPath": "ipv4.txt", // Path to the file containing a list of IP addresses (e.g., `ipv4.txt`).
"IgnoreRange": [], // List of IP ranges to ignore. (e.g., `["172.0.0.0/8", "104.0.0.0/8"]`).
"AllowRange": [], // List of IP ranges to allow. (e.g., `["192.0.0.0/8", "8.14.0.0/16"]`).
"TLS": {
"Enable": true,
"SNI": "cp.cloudflare.com", // The SNI value to use during the TLS handshake.
"Insecure": false, // Certificate validation.
"Alpn": ["h2", "http/1.1"], // List of supported ALPN (Application-Layer Protocol Negotiation) protocols.
"Utls": {
"Enable": true, // Enable UTLS fingerprint.
"Fingerprint": "chrome" // Supported fingerprints are firefox, edge, chrome, 360 and ios.
}
},
"HTTP/3": false, // Enable HTTP version 3.
"Noise": {
"Enable": false, // Enable UDP noise injection for HTTP/3.
"Packets": [
{
"Type": "rand", // Noise payload type. `str`, `base64`, `hex` and `rand` types are supported.
"Payload": "1-10", // Noise payload
"Sleep": "20-50" // Delay in milliseconds after sending noise.
},
{
"Type": "rand",
"Payload": "1-50",
"Sleep": "20-50"
}
]
},
"LinearScan": false, // Enable linear scanning.
"DomainScan": {
"Enable": false, // Enable domain scanning.
"DomainAsSNI": false, // Use selected domain as SNI.
"DomainAsHost": false, // Use selected domain as Host.
"Shuffle": true, // Shuffle domains list for random scanning.
"SkipIPV6": true, // Skip IPv6 as result of resolving domain.
"DomainListPath": "cloudfalare-domains.txt" // Path to the file containing a list of domains
},
"Padding": true, // Enable padding in HTTP requests by adding random text as cookies. This helps eliminate fixed-size requests.
"PaddingSize": "1-500", // Padding size range.
"CSV": false, // CSV format result.
"DownloadTest": {
"Enable": false, // Enable the download speed test.
"SeparateConnection": false, // Open new connection for download speed test. Enable for H3.
"Url": "https://speed.cloudflare.com/__down?bytes=10000000", // Target URL for download.
"SNI": "cp.cloudflare.com", // The SNI value to use during the TLS handshake for DownloadTest.
"TargetBytes": 5000000, // Expected data in bytes; if not met, report as JAMMED.
"Timeout": 5000 // Timeout duration in milliseconds before aborting the download.
}
}