Dasar Hack Wordpress
Dasar Hack Wordpress
Dasar Hack Wordpress
WordPress can be installed on a Windows, Linux, or Mac OSX host. For this module,
we will focus on a default WordPress installation on an Ubuntu Linux web server.
WordPress requires a fully installed and configured LAMP stack (Linux operating
system, Apache HTTP Server, MySQL database, and the PHP programming language)
before installation on a Linux host. After installation, all WordPress supporting
files and directories will be accessible in the webroot located at /var/www/html.
Below is the directory structure of a default WordPress install, showing the key
files and subdirectories necessary for the website to function properly.
tree -L 1 /var/www/html
├── index.php
├── license.txt
├── readme.html
├── wp-activate.php
├── wp-admin
├── wp-blog-header.php
├── wp-comments-post.php
├── wp-config.php
├── wp-config-sample.php
├── wp-content
├── wp-cron.php
├── wp-includes
├── wp-links-opml.php
├── wp-load.php
├── wp-login.php
├── wp-mail.php
├── wp-settings.php
├── wp-signup.php
├── wp-trackback.php
└── xmlrpc.php
The root directory of WordPress contains files that are needed to configure
WordPress to function correctly.
wp-activate.php is used for the email activation process when setting up a new
WordPress site.
wp-admin folder contains the login page for administrator access and the backend
dashboard. Once a user has logged in, they can make changes to the site based on
their assigned permissions. The login page can be located at one of the following
paths:
/wp-admin/login.php
/wp-admin/wp-login.php
/login.php
/wp-login.php
This file can also be renamed to make it more challenging to find the login page.
wp-config.php
Code: php
<?php
/** <SNIP> */
/* <SNIP> */
$table_prefix = 'wp_';
/** For developers: WordPress debugging mode. */
/** <SNIP> */
if ( ! defined( 'ABSPATH' ) ) {
The wp-content folder is the main directory where plugins and themes are stored.
The subdirectory uploads/ is usually where any files uploaded to the platform are
stored. These directories and files should be carefully enumerated as they may lead
to contain sensitive data that could lead to remote code execution or exploitation
of other vulnerabilities or misconfigurations.
WP-Content
tree -L 1 /var/www/html/wp-content
├── index.php
├── plugins
└── themes
WP-Includes
wp-includes contains everything except for the administrative components and the
themes that belong to the website. This is the directory where core files are
stored, such as certificates, fonts, JavaScript files, and widgets.
tree -L 1 /var/www/html/wp-includes
├── theme.php
├── update.php
├── user.php
├── vars.php
├── version.php
├── widgets
├── widgets.php
├── wlwmanifest.xml
├── wp-db.php
└── wp-diff.php
Role Description
Administrator This user has access to administrative features within the website.
This includes adding and deleting users and posts, as well as
editing source code.
Editor An editor can publish and manage posts, including the posts of other
users.
Contributor These users can write and manage their own posts but cannot publish
them.
Subscriber These are normal users who can browse posts and edit their profiles.
Check Wordpress Version using given below curl command or seeing source code
commnad:
Command :
curl http://blog.inlanefreight.com/wp-json/wp/v2/users
Example :
If we are checking and testing properly of our target wordpress website and if
target wordpress website is vulneable we will see some CVE or Exploite information
after using above wpscan command
WPScan can be used to brute force usernames and passwords. The tool uses two kinds
of login brute force attacks, xmlrpc and wp-login. The wp-login method will attempt
to brute force the normal WordPress login page, while the xmlrpc method uses the
WordPress API to make login attempts through /xmlrpc.php. The xmlrpc method is
preferred as it is faster.
Command :
With administrative access to WordPress, we can modify the PHP source code to
execute system commands. To perform this attack, log in to WordPress with the
administrator credentials, which should redirect us to the admin panel. Click on
Appearance on the side panel and select Theme Editor. This page will allow us to
edit the PHP source code directly. We should select an inactive theme in order to
avoid corrupting the main theme.
We can use the Metasploit Framework (MSF) to obtain a reverse shell on the target
automatically. This requires valid credentials for an account that has sufficient
rights to create files on the webserver.
To obtain the reverse shell, we can use the wp_admin_shell_upload module. We can
easily search for it inside MSF:
Matching Modules
Module Selection:
Module Options
Exploit target:
Id Name
-- ----
0 WordPress
prayPracticing Sites:
https://tryhackme.com/room/allinonemj
https://tryhackme.com/room/wordpresscve202129447
https://tryhackme.com/room/blog
https://sitecheck.sucuri.net/
Install https://github.com/cyberteach360/Hacking-Wordpress
indo-----------------------------------------------------------------------
WordPress dapat diinstal pada host Windows, Linux, atau Mac OSX. Untuk modul ini,
kami akan fokus pada instalasi WordPress default di server web Ubuntu Linux.
WordPress memerlukan tumpukan LAMP yang terinstal dan terkonfigurasi sepenuhnya
(sistem operasi Linux, Server HTTP Apache, database MySQL, dan bahasa pemrograman
PHP) sebelum penginstalan pada host Linux. Setelah instalasi, semua file dan
direktori pendukung WordPress akan dapat diakses di webroot yang terletak di
/var/www/html.
pohon -L 1 /var/www/html
├── indeks.php
├── lisensi.txt
├── readme.html
├── wp-aktivasi.php
├── wp-admin
├── wp-blog-header.php
├── wp-komentar-post.php
├── wp-config.php
├── wp-config-sample.php
├── konten-wp
├── wp-cron.php
├── termasuk wp
├── wp-links-opml.php
├── wp-load.php
├── wp-login.php
├── wp-mail.php
├── wp-settings.php
├── wp-signup.php
├── wp-trackback.php
└── xmlrpc.php
Direktori root WordPress berisi file yang diperlukan untuk mengonfigurasi WordPress
agar berfungsi dengan benar.
folder wp-admin berisi halaman login untuk akses administrator dan dashboard
backend. Setelah pengguna masuk, mereka dapat membuat perubahan ke situs
berdasarkan izin yang diberikan kepada mereka. Halaman login dapat ditemukan di
salah satu jalur berikut:
/wp-admin/login.php
/wp-admin/wp-login.php
/login.php
/wp-login.php
File ini juga dapat diganti namanya agar lebih sulit menemukan halaman login.
xmlrpc.php adalah file yang mewakili fitur WordPress yang memungkinkan pengiriman
data dengan HTTP bertindak sebagai mekanisme transportasi dan XML sebagai mekanisme
pengkodean. Jenis komunikasi ini telah digantikan oleh WordPress REST API.
File wp-config.php berisi informasi yang diperlukan oleh WordPress untuk terhubung
ke database, seperti nama database, host database, nama pengguna dan kata sandi,
kunci dan salt autentikasi, dan awalan tabel database. File konfigurasi ini juga
dapat digunakan untuk mengaktifkan mode DEBUG, yang berguna dalam pemecahan
masalah.
wp-config.php
Kode: php
<?php
/** <SNIP> */
define('DB_HOST', 'localhost');
/* <SNIP> */
$table_prefix = 'wp_';
/** <SNIP> */
if ( ! defined( 'ABSPATH' ) ) {
Folder wp-content adalah direktori utama tempat plugin dan tema disimpan.
Subdirektori uploads/ biasanya tempat file yang diunggah ke platform disimpan.
Direktori dan file ini harus dihitung dengan hati-hati karena dapat berisi data
sensitif yang dapat menyebabkan eksekusi kode jarak jauh atau eksploitasi
kerentanan atau kesalahan konfigurasi lainnya.
WP-Konten
pohon -L 1 /var/www/html/wp-content
├── indeks.php
├── plugin
└── tema
WP-Termasuk
wp-includes berisi segalanya kecuali komponen administratif dan tema milik situs
web. Ini adalah direktori tempat file inti disimpan, seperti sertifikat, font, file
JavaScript, dan widget.
pohon -L 1 /var/www/html/wp-termasuk
├── tema.php
├── perbarui.php
├── pengguna.php
├── vars.php
├── versi.php
├── widget
├── widgets.php
├── wlwmanifest.xml
├── wp-db.php
└── wp-diff.php
Editor Seorang editor dapat menerbitkan dan mengelola posting, termasuk posting
dari pengguna lain.
Kontributor Pengguna ini dapat menulis dan mengelola kiriman mereka sendiri tetapi
tidak dapat menerbitkannya.
Subscriber Ini adalah pengguna normal yang dapat menelusuri posting dan mengedit
profil mereka.
Periksa Versi Wordpress menggunakan perintah curl di bawah ini atau melihat kode
sumber
perintah:
Periksa juga Versi WP - Versi CSS dan Versi WP - Versi JS dari Kode Sumber
Memerintah :
curl http://blog.inlanefreight.com/wp-json/wp/v2/users
WPScan adalah pemindai WordPress otomatis dan alat enumerasi. Ini menentukan apakah
berbagai tema dan plugin yang digunakan oleh situs WordPress sudah usang atau
rentan. Itu diinstal secara default di Parrot OS ,Kali OS tetapi juga dapat
diinstal secara manual dengan gem gem install wpscan Setelah instalasi selesai,
kita dapat mengeluarkan perintah seperti wpscan --hh untuk memverifikasi instalasi.
Perintah ini akan menunjukkan kepada kita menu penggunaan dengan semua sakelar
baris perintah yang tersedia.
Contoh :
Jika kami memeriksa dan menguji dengan benar situs web wordpress target kami dan
jika situs web target wordpress rentan, kami akan melihat beberapa informasi CVE
atau Eksploitasi setelah menggunakan perintah wpscan di atas
ballot_box_with_checkWordPress Pengguna Bruteforce
WPScan dapat digunakan untuk memaksa nama pengguna dan kata sandi. Alat ini
menggunakan dua jenis serangan brute force login, xmlrpc dan wp-login. Metode wp-
login akan mencoba memaksa halaman login WordPress normal, sedangkan metode xmlrpc
menggunakan API WordPress untuk melakukan upaya login melalui /xmlrpc.php. Metode
xmlrpc lebih disukai karena lebih cepat.
Memerintah :
Dengan akses administratif ke WordPress, kita dapat memodifikasi kode sumber PHP
untuk menjalankan perintah sistem. Untuk melakukan serangan ini, masuk ke WordPress
dengan kredensial administrator, yang seharusnya mengarahkan kita ke panel admin.
Klik Penampilan di panel samping dan pilih Editor Tema. Halaman ini akan
memungkinkan kita untuk mengedit kode sumber PHP secara langsung. Kita harus
memilih tema yang tidak aktif untuk menghindari kerusakan pada tema utama.
Kita bisa menggunakan Metasploit Framework (MSF) untuk mendapatkan reverse shell
pada target secara otomatis. Ini memerlukan kredensial yang valid untuk akun yang
memiliki hak yang memadai untuk membuat file di server web.
Pemilihan Modul:
RHOSTS ya Host target, pengidentifikasi rentang CIDR, atau file host dengan
sintaks 'file:<path>'
Eksploitasi target:
Nama Id
----
0 WordPress
https://tryhackme.com/room/allinonemj
https://tryhackme.com/room/wordpresscve202129447
https://tryhackme.com/room/blog
Instal https://github.com/cyberteach360/Hacking-Wordpress