Conducted an Nmap scan of the target to identify open ports and running services:
Identified the MySQL service running on port 3306, which is commonly used for database connections.
Attempted to access the MySQL database using the mysql client from the Kali Linux VM.
When running this command, we encountered the error 2026 (HY000): TLS/SSL error: wrong version number.
This was due to an SSL/TLS version mismatch between the MySQL client and the server.
Fix Applied: To resolve this, the connection was modified to disable SSL by using the --skip-ssl option:
This successfully allowed us to bypass the SSL/TLS connection issue and access the MySQL database.
-u root: Specifies the root user to attempt login.
-p: Prompts for a password (used to test the default password or perform a brute-force attack).
--skip-ssl: Disables SSL (Secure Sockets Layer), which resolved the error related to SSL/TLS version mismatch.
-h 192.168.1.184: Specifies the Metasploitable VM's IP address.
Upon logging in without specifying a password, the MySQL service allowed access without authentication, as no password had been set.
This highlights the unsecured nature of the MySQL service on Metasploitable, allowing unauthenticated access to the database.
After gaining access, we verified the connection by querying the databases:

Searching for sensitive tables which may contain credentials of users:

Querying the user table to extract usernames and password hashes:

Successfully logged in and accessed the MySQL service.
Writing a backdoor (Failed)

Writing a backdoor (Success)

-
Enforce Strong Password Policies:
- Use a minimum password length of 12 characters with a combination of uppercase, lowercase, numbers, and special characters.
-
Disable Remote Access for MySQL:
- Modify the MySQL configuration to restrict access to only trusted IP addresses.
-
Enable SSL/TLS Encryption for MySQL:
- Configure MySQL to use SSL/TLS encryption to protect data in transit and prevent man-in-the-middle attacks.
-
Ensure proper configuration of SSL certificates to avoid version mismatches.
- Use trusted Certificate Authorities (CAs) to issue SSL certificates.
-
Limit User Privileges:
- Use least-privilege principles when creating MySQL users, ensuring they only have the necessary permissions.
-
Use Intrusion Detection and Prevention Tools:
- Deploy a Network Intrusion Detection System (NIDS) such as Snort or Suricata to monitor database traffic.
-
Use Rate-Limiting and Intrusion Prevention Tools:
- Install fail2ban to block IPs after multiple failed login attempts




