Build RealiTLScanner from source
mainTo build the scanner from source, ensure you have Go 1.21 or higher installed on your system.
go buildrepository·main·Indexed 26 days ago
https://github.com/xtls/realitlscannerA tool for scanning IP addresses, CIDRs, domains, or crawled URLs to identify TLS configurations and 'Reality' TLS characteristics. It supports CSV output with optional Geo IP data via MaxMind GeoLite2/GeoIP2 databases and can be deployed via Go 1.21+ or Docker.
To build the scanner from source, ensure you have Go 1.21 or higher installed on your system.
go buildYou can use Docker to run the scanner without needing Go installed on your host machine. First, build the container image, then run it with your desired arguments.
# Build container
docker build -t realitlscanner .
# Show help
docker run --rm realitlscanner
# Scan a specific IP
docker run --rm realitlscanner -addr 1.1.1.1Country.mmdb.The RealiTLScanner CLI allows you to specify targets, ports, concurrency, and output formats.
Note: It is recommended to run this tool locally, as running the scanner in the cloud may cause the VPS to be flagged.
ValidateDomainName(domain string) bool to check if a string follows a basic domain name pattern (alphanumeric characters, hyphens, and dots).The ScanTLS function performs a TLS handshake against a target host to determine if it meets specific 'Reality' criteria (TLS 1.3 and h2 ALPN).
If the target is considered 'feasible' (TLS 1.3, h2, and valid domain/issuer information), a comma-separated string containing the scan results is sent to the out channel. If the target is not feasible, the result is logged at the Debug level and nothing is sent to the channel.
Feasibility Criteria:
tls.VersionTLS13.h2.Output Format (CSV):
When feasible, the following fields are sent to the out channel:
IP, Origin, TLS Version, ALPN, Curve ID, Cert Length (with cert count), Signature Algorithm, Public Key Algorithm, Domain, "Issuers", GeoCode
func ScanTLS(host Host, out chan<- string, geo *Geo)OutWriter(writer io.Writer) chan<- string to create a write-only channel that asynchronously writes incoming strings to the provided io.Writer. This is useful for non-blocking logging or result saving.NewGeo() to create a new Geo instance for resolving geographic information from IP addresses. This function attempts to open a Country.mmdb file in the current working directory. If the file is missing or cannot be opened, the Geo instance will be returned without a reader, and subsequent lookups will return "N/A".LookupIP(addr string) to resolve a domain or hostname to a net.IP. It returns the first valid IP found that matches the project's IP version requirements (IPv4 or IPv6 if enableIPv6 is true).Use IterateAddr(addr string) to scan a single target. If the provided addr is an IP or a domain, the function automatically enables "infinite mode".
In infinite mode, the function starts with the initial IP and then alternates between scanning the next lower IP and the next higher IP indefinitely. If the address is a CIDR, it behaves like Iterate and expands the range.
Use Iterate(reader io.Reader) to process a stream of targets (IPs, CIDRs, or domains) from any source implementing io.Reader. It returns a receive-only channel of Host objects.
Supported formats per line:
192.168.1.1192.168.1.0/24. The function expands the CIDR and emits each individual IP.example.com. Domains are validated via regex and returned with a nil IP.Note: IPv6 support depends on the enableIPv6 variable.