Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2016-6662 PoC — Oracle MySQL 远程代码执行漏洞/提权漏洞

Source
Associated Vulnerability
Title:Oracle MySQL 远程代码执行漏洞/提权漏洞 (CVE-2016-6662)
Description:Oracle MySQL through 5.5.52, 5.6.x through 5.6.33, and 5.7.x through 5.7.15; MariaDB before 5.5.51, 10.0.x before 10.0.27, and 10.1.x before 10.1.17; and Percona Server before 5.5.51-38.1, 5.6.x before 5.6.32-78.0, and 5.7.x before 5.7.14-7 allow local users to create arbitrary configurations and bypass certain protection mechanisms by setting general_log_file to a my.cnf configuration. NOTE: this can be leveraged to execute arbitrary code with root privileges by setting malloc_lib. NOTE: the affected MySQL version information is from Oracle's October 2016 CPU. Oracle has not commented on third-party claims that the issue was silently patched in MySQL 5.5.52, 5.6.33, and 5.7.15.
Description
CVE-2016-6662, tapi versi lab ala Kanya.  Dari SQL Injection receh → bisa jadi full server takeover.  Cocok buat latihan dan flexing di forum, jangan dipake ke server orang.
Readme
# CVE-2016-6662 - Old MySQL Exploit Lab

⚠️ **Disclaimer**  
PoC ini dibuat hanya untuk tujuan **edukasi** dan **pengujian di lab pribadi**.  
Jangan pernah gunakan pada server yang bukan milik sendiri.  
Segala penyalahgunaan di luar kontrol pembuat.

---

## 📌 Deskripsi
**CVE-2016-6662** adalah kerentanan kritis pada **MySQL/MariaDB** (versi < 5.7.15 & 5.6.33)  
yang memungkinkan attacker dengan akses SQL (misalnya lewat **SQL Injection** atau kredensial DB)  
untuk menulis file konfigurasi berbahaya (`my.cnf`).  
Hal ini dapat dieksploitasi untuk mencapai **Remote Code Execution (RCE)** pada host server.

Bug ini jadi menarik karena membuka pintu dari **SQL Injection biasa → full server takeover**.  

---

## 📂 Isi Repo
- `Exploit_Old_MySQL_Kay_ver.py` → Python PoC exploit  
- `911KanyaLab_lib.c` → Source code malicious shared object  
- `911KanyaLab_lib.so` → Hasil compile dari source `.c`

---

## ⚙️ Cara Pakai (Lab Env)
1. Jalankan MySQL lama di Docker (contoh versi vulnerable):
   ```bash
   docker run --name vuln-mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:5.5
``

2. Compile shared object (opsional, kalau mau rebuild):

   ```bash
   gcc -fPIC -shared -o 911KanyaLab_lib.so 911KanyaLab_lib.c
   ```

3. Jalankan exploit:

   ```bash
   python Exploit_Old_MySQL_Kay_ver.py -u root -p root -h 127.0.0.1
   ```

---

## 🛡️ Mitigasi

* Update MySQL minimal ke **5.7.15** / **5.6.33** atau patch versi terbaru MariaDB.
* Cabut hak `FILE` dari user SQL yang nggak perlu:

  ```sql
  REVOKE FILE ON *.* FROM 'user'@'host';
  ```
* Pastikan hanya user authorized yang bisa akses MySQL.

---

## 👤 Credits

Project ini dibuat sebagai **lab praktikum** untuk belajar eksploitasi database.
Terinspirasi dari publikasi Exploit-DB dan riset keamanan terkait CVE-2016-6662.
File Snapshot

[4.0K] /data/pocs/c622a947a6cf58b1b01e113bb03923f25f5026a1 ├── [2.0K] 911KanyaLab_lib.c ├── [ 16K] 911KanyaLab_lib.so ├── [6.5K] Exploit_Old_MySQL_Kay_ver.py ├── [1.0K] LICENSE └── [1.8K] README.md 0 directories, 5 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →