Skip to content

Instantly share code, notes, and snippets.

@meicookies
Last active September 18, 2022 19:36
Show Gist options
  • Save meicookies/98b0917840566c1c047b754b24abfd5d to your computer and use it in GitHub Desktop.
Save meicookies/98b0917840566c1c047b754b24abfd5d to your computer and use it in GitHub Desktop.
'''
GRAB DOMAIN BY DATE => MASSIVE DOMAIN TO IP
CODED BY ./MEICOOKIES
'''
import re, cfscrape, socket
scraper = cfscrape.create_scraper()
def grab_domain(date):
domain = "https://www.cubdomain.com/domains-registered-by-date"
total_domain = 0
count_domain = 0
page = 1
while True:
html = scraper.get(f"{domain}/{date}/{page}").text
if total_domain == 0:
for tag in re.findall("<li class=\"list-inline-item\">(.*?)</li>", html):
if "Total" in tag:
total_domain = int(re.findall(r'[0-9]+', tag)[-1])
total_domain -= 1000
valid_host = []
for site in re.findall("<a href=\"https://www.cubdomain.com/site/(.*?)\">", html):
count_domain += 1
try:
addr = socket.gethostbyname(site)
if addr not in valid_host:
valid_host.append(addr)
with open('saved.txt', 'a') as file:
file.write(f'{addr}\n')
print(f"[+] valid host => {addr}")
except socket.gaierror:
print(f"{addr} invalid host")
if count_domain > total_domain: break
if count_domain < total_domain:
page += 1
if __name__ == '__main__':
date = str(input("Input date (YYYY-MM-DD): "))
grab_domain(date)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment