import requests import time # Daftar ekstensi domain umum yang mencakup semua TLD (Top-Level Domain) tld_list = [ "com", "net", "org", "edu", "gov", "mil", "int", "co", "id", "ac.id", "co.id", "sch.id", "go.id", "or.id", "mil.id", "my", "sg", "uk", "us", "au", "jp", "de", "fr", "ru", "cn", "za", "br", "in", "ar", "ca", "kr", "es", "it", "nl", "se", "no", "fi", "dk", "ie", "tr", "th", "vn", "hk", "tw", "mx", "nz", "sa", "ae", "ua", "pl", "pt", "gr", "cz", "hu", "ro", "bg", "si", "sk", "by", "md", "hr", "ba", "rs", "mk", "me" # Anda bisa menambahkan lebih banyak TLD jika diperlukan ] def grab_domains_from_zone(zone_name): url = f"https://api.zone-xsec.com/grab?zone={zone_name}" headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3" } try: response = requests.get(url, headers=headers, timeout=15) response.raise_for_status() domains = response.json() return domains except requests.exceptions.RequestException as e: print(f"Error fetching data for {zone_name}: {e}") return None def save_domains_to_file(domains, zone_name): filename = f"{zone_name}_domains.txt" with open(filename, "w") as file: for domain in domains: file.write(f"{domain}\n") print(f"Domains for {zone_name} saved to {filename}") def main(): print("Zone-Xsec Domain Grabber for All TLDs") start_time = time.time() for tld in tld_list: print(f"Grabbing domains for .{tld}...") domains = grab_domains_from_zone(tld) if domains: save_domains_to_file(domains, tld) time.sleep(1) # Menambahkan jeda untuk menghindari rate limiting end_time = time.time() print(f"Process completed in {end_time - start_time:.2f} seconds.") if __name__ == "__main__": main()