More Thick Client Fun!
A thick client application connected directly to a SQL Server database with hardcoded credentials, was vulnerable to SQL injection, stored database credentials in a password-protected zip with a hardcoded password recoverable from memory, and allowed arbitrary command execution through a scripting feature, enabling privilege escalation. An attacker could extract sensitive data, obtain database credentials, and gain administrative shell access.
medium.com
Published on medium.com
#### Richard Clifford
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely multiple design flaws: direct database connections with hardcoded credentials, lack of input validation leading to SQL injection, insecure storage of credentials in a password-protected zip with a hardcoded password, and a scripting feature that allowed arbitrary command execution.
Impact
An attacker could access sensitive private data, obtain multiple database credentials, and escalate privileges to an administrative shell on the host.
What the attacker needed
Access to the thick client application; ability to run the application on a Windows host
How it was found
- Booted up the application using Echo Mirage to inspect network traffic.
- Noticed the application connected directly to a SQL Server box and obtained the 'sa' user account password.
- Identified SQL injection vulnerabilities that could be exploited by intercepting and modifying queries or through poor input validation.
- Created a memory dump of the running application and searched it for the zip file password, finding it in a function called 'UnzipFile'.
- Used the password to unzip the file and found credentials for three database connections.
- Exploited a scripting feature with a specific syntax to run arbitrary system commands and spawn an administrative cmd shell.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A thick client is a program installed on your computer that talks directly to a database or server, rather than through a website. Here, the program had several mistakes: it used a weak, built-in database password, it let users change the database queries it sent, and it stored its own passwords in a file that could be unlocked with a password hidden in the program's memory. Because the program ran with administrator rights, an attacker who could run commands through it could take full control of the computer.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.