Files
wordlists/tools/make_tld_list.py
2023-10-12 13:30:36 +02:00

24 lines
597 B
Python
Vendored

import requests
def get_content(url: str) -> str:
response = requests.get(
url=url,
headers={
"User-Agent": "Krypton's Wordlists (https://github.com/kkrypt0nn/wordlists)"
},
)
return response.text
def main() -> None:
raw_content = get_content("https://data.iana.org/TLD/tlds-alpha-by-domain.txt")
lines = raw_content.split("\n")
content = "\n".join(lines[1 : len(lines)])
with open("./wordlists/discovery/tlds.txt", "w+", encoding="utf-8") as manuf_file:
manuf_file.write(content)
if __name__ == "__main__":
main()