-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathClatChecker(1.00).py
More file actions
96 lines (74 loc) · 4.51 KB
/
Copy pathClatChecker(1.00).py
File metadata and controls
96 lines (74 loc) · 4.51 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
from pystyle import Colors, Write
import requests
import time
import logging
import threading
stop_flag = False
def wait_for_enter():
"""
Wait for user to press ENTER; when pressed, set stop_flag to True.
"""
input("\nPress ENTER at any time to stop monitoring...\n")
global stop_flag
stop_flag = True
def monitor_websites(domains):
"""
Check the given domains every 1 second until stop_flag is True.
Logs and prints whether each domain is up or down.
"""
global stop_flag
while not stop_flag:
for domain in domains:
try:
response = requests.get(domain.strip())
if response.status_code == 200:
print(f"[+] {domain} is up")
logging.info(f"{domain} is up (HTTP 200)")
else:
print(f"[-] {domain} is down (HTTP {response.status_code})")
logging.info(f"{domain} is down (HTTP {response.status_code})")
except requests.exceptions.RequestException as e:
print(f"[!] Error connecting to {domain}: {e}")
logging.error(f"Error connecting to {domain}: {e}")
time.sleep(1)
def main():
try:
print("\033[1;31m ██████╗██╗ █████╗ ████████╗\033[0m")
print("\033[1;31m ██╔════╝██║ ██╔══██╗╚══██╔══╝\033[0m")
print("\033[1;31m ██║ ██║ ███████║ ██║ \033[0m")
print("\033[1;31m ██║ ██║ ██╔══██║ ██║ \033[0m")
print("\033[1;31m ╚██████╗███████╗██║ ██║ ██║ \033[0m")
print("\033[1;31m ╚═════╝╚══════╝╚═╝ ╚═╝ ╚═╝ \033[0m")
print("\033[1;31m ██████╗ ██╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ███████╗ ██████╗ \033[0m")
print("\033[1;31m██╔════╝ ██║ ██║ ██╔════╝ ██╔════╝ ██║ ██╔╝ ██╔════╝ ██╔══██╗\033[0m")
print("\033[1;31m██║ ███████║ █████╗ ██║ █████╔╝ █████╗ ██████╔╝\033[0m")
print("\033[1;31m██║ ██╔══██║ ██╔══╝ ██║ ██╔═██╗ ██╔══╝ ██╔══██╗\033[0m")
print("\033[1;31m╚██████╗ ██║ ██║ ███████╗ ╚██████╗ ██║ ██╗ ███████╗ ██║ ██║\033[0m")
print("\033[1;31m ╚═════╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝\033[0m")
print()
print("\033[1;34mD O W N D E T E C T O R T O O L\033[0m\t\033[1;31mVersion 1.00\033[0m")
author_line = "🛡️ By Joshua M Clatney - Ethical Pentesting Enthusiast 🛡️"
Write.Print(author_line + "\n", Colors.white, interval=0)
print()
Write.Print("Domain Status Checker\n", Colors.white, interval=0)
Write.Print("Site Status In Seconds\n", Colors.white, interval=0)
except Exception as e:
print(f"Error displaying banner: {e}")
logging.basicConfig(
filename='website_monitor.log',
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
domains_input = input("Enter the domain(s) (comma separated): ")
domains_list = [domain.strip() for domain in domains_input.split(',') if domain.strip()]
if not domains_list:
print("No valid domain(s) provided. Exiting...")
return
# Start a thread to detect when the user presses Enter
stopper_thread = threading.Thread(target=wait_for_enter, daemon=True)
stopper_thread.start()
# Start monitoring the websites (indefinitely until user presses ENTER)
monitor_websites(domains_list)
print("Monitoring stopped.")
if __name__ == "__main__":
main()