Trustwave Rapid Response: CrowdStrike Falcon Outage Update. Learn More

Trustwave Rapid Response: CrowdStrike Falcon Outage Update. Learn More

Services
Capture
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

twi-managed-portal-color
Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

twi-briefcase-color-svg
Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

tw-laptop-data
Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

tw-officer
Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

tw-network
Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

MySQL/MariaDB: Trade You a Banana for Root Access?

Summary

Over the weekend, an Authentication Bypass Vulnerability for MySQL and MariaDB (CVE-2012-2122) was released by Sergei Golubchik of Monty Program Ab (link). The vulnerability is trivial to exploit and has the potential to expose root user access to the database instance if the database service is exposed. As it happens, the binary packages provided by some popular Linux variants including Ubuntu, OpenSuSE, Fedora and others are affected by this issue.

In this post, we will cover exploiting the vulnerability as well as what you should do if you are running/evaluating vulnerable MySQL or MariaDB services.

Exploiting the MySQL Vulnerability

I spent some time this morning to confirm the vulnerability on a vanilla Ubuntu 12.04 LTS Linux 64-bit VM. I downloaded the latest Ubuntu 64-bit version, installed mysql-server using apt-get and here is what I came up with…

Successful MySQL Login (root/toor on localhost)
7913_0e7efeab-22a7-4dda-8bf4-0791ea4ffe47

Failed MySQL Login (root/bananas on localhost)
BSL_8436_28ece772-db8b-4e5e-af5c-65b22d002647

Successful MySQL Auth Bypass (root/bananas on localhost)
BSL_9092_49dfecc6-3e69-464d-8606-51834957de0f
BSL_11794_ca2e3447-4556-4a07-bded-ede5319f3316
Note:
The proof of concept above was based on info provided in Metasploit blog posted here earlier today.


What You Should Do?

Please note that at the time of this writing, the community is still in the process of identifying specific OS variants and their associated binary packages and compile options that are affected by this vulnerability. As a safety precaution, it is encouraged that all MySQL and MariaDB instances be tested for the existance of the vulnerability. Additionally, both vendors have addressed this vulnerability so it is highly recommended that the associated patches are applied as soon as possible and that access to the database service and users should be restricted by IP.

Additionally, for penetration testers and security assessors, you might want to jump on this now so you help your customers/clients confirm their exposure and/or mitigate this risk. The above example will work against remote instances by simply changing the value of the ip supplied to the "-h" (host) switch.

Latest SpiderLabs Blogs

Cloudy with a Chance of Hackers: Protecting Critical Cloud Workloads

If you've been following along with David's posts, you'll have noticed a structure to the topics: Part I: The Plan, Part II: The Execution and now we move into Part III: Security Operations. Things...

Read More

Trustwave Rapid Response: CrowdStrike Falcon Outage Update

Trustwave is proactively assessing and monitoring our clients who may have been impacted by CrowdStrike’s recently rolled-out update for its Windows users. The critical issue identified with...

Read More

Using AWS Secrets Manager and Lambda Function to Store, Rotate and Secure Keys

When working with Amazon Web Services (AWS), we often find that various AWS services need to store and manage secrets. AWS Secrets Manager is the go-to solution for this. It's a centralized service...

Read More