-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDomain_Discovery.py
More file actions
77 lines (55 loc) · 2.62 KB
/
Domain_Discovery.py
File metadata and controls
77 lines (55 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# where is your shame, if you recode this, and don't include my credit
import requests
import time
from fake_useragent import UserAgent
from colorama import init, Fore, Style
init(autoreset=True)
API_URL = "https://api.xreverselabs.org/api/discover_domain?apiKey=FREE-TRIAL"
user_agent = UserAgent()
banner = """
______ _ ______ _
| _ (_) | _ \ (_)
| | | |_ ___ ___ _____ _____ _ __ | | | |___ _ __ ___ __ _ _ _ __
| | | | / __|/ __/ _ \ \ / / _ \ '__| | | | / _ \| '_ ` _ \ / _` | | '_ \
| |/ /| \__ \ (_| (_) \ V / __/ | | |/ / (_) | | | | | | (_| | | | | |
|___/ |_|___/\___\___/ \_/ \___|_| |___/ \___/|_| |_| |_|\__,_|_|_| |_|
Domain Discovery Engine - Real Time Update
Owner : https://t.me/xxyz4
API : https://api.xreverselabs.org
"""
unique_domains = set()
def scrape_domains():
headers = {
}
try:
response = requests.get(API_URL, headers=headers, timeout=10)
if response.status_code == 200:
data = response.json()
domains = data.get('domains', [])
if domains:
new_domains = [domain for domain in domains if domain not in unique_domains]
unique_domains.update(new_domains)
if new_domains:
print(Fore.LIGHTGREEN_EX + f"{len(new_domains)} new domains found.")
with open('result_discover.txt', 'a') as f:
for domain in new_domains:
f.write(domain + '\n')
print(Fore.LIGHTCYAN_EX + "New results saved to result_discover.txt")
else:
print(Fore.LIGHTYELLOW_EX + "No new domains found in this request.")
else:
print(Fore.LIGHTYELLOW_EX + "No domains found in this request.")
else:
print(Fore.LIGHTRED_EX + f"Failed to fetch data: Status Code {response.status_code}")
except Exception as e:
print(Fore.LIGHTRED_EX + "An error occurred while connecting to the API!", e)
def main():
print(f"{Fore.LIGHTCYAN_EX}{banner}")
repeats = int(input(Fore.YELLOW + "Enter how many times to scrape: "))
delay = int(input(Fore.YELLOW + "Enter delay between requests (in seconds): "))
for i in range(repeats):
print(Style.BRIGHT + Fore.LIGHTCYAN_EX + f"\n[Scraping Attempt {i+1}]")
scrape_domains()
time.sleep(delay)
if __name__ == "__main__":
main()