Mendapatkan Akses SMTP Melalui Celah SQL Injection
Two SQL injection vulnerabilities were found in a campus e-learning application, allowing access to 301 databases including other campuses' data and SMTP credentials. The attacker could read sensitive student and admin information and send emails using the compromised SMTP account.
Saya menemukan celah keamanan ini pada website kampus saya, yang menggunakan aplikasi pihak ketiga (vendor) untuk sistem e-learning. Setelah menemukan celah tersebut, saya segera melaporkannya kepada vendor terkait.
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 the application concatenated user-supplied parameter values directly into SQL queries without parameterisation or input validation.
Impact
An attacker could read sensitive data from 301 databases, including other campuses' student and admin records, and could send emails using the compromised SMTP credentials.
What the attacker needed
Valid login credentials; access to the vulnerable endpoints
The fix
The vulnerabilities were fixed by the vendor.
How it was found
- Log in to the application using provided credentials.
- Capture HTTP requests while browsing features.
- Test parameters with a single quote to look for SQL errors.
- Use sqlmap on the vulnerable endpoint to enumerate databases.
- Dump the konfigsmtp table to obtain SMTP credentials.
- Validate the credentials by sending an email using a PHP script.
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.
SQL injection is a flaw where user input is inserted into database commands without proper handling, letting an attacker change the command. Here, adding a quote character to certain parameters caused database errors, showing the input was being used directly in SQL queries. The attacker then used a tool to extract data, including email server passwords.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.