WordPress is the most popular open source Content Management System (CMS), powering nearly one-third of all websites in the world. It can be used for multiple purposes, such as hosting blogs, forums, e-commerce, project management, document management, and much more. WordPress is highly customizable as well as SEO friendly, which makes it popular among companies. It has a large library of extensions called themes and plugins, both free and paid, that can be added to enhance the website. Some examples of plugins are WPForms, a robust contact form, MonsterInsights that interfaces with Google Analytics, and Constant Contact, a popular email marketing service. However, its customizability and extensible nature make it prone to vulnerabilities through third-party themes and plugins. WordPress is written in PHP and usually runs on Apache with MySQL as the backend. Many hosting companies offer WordPress as an option when creating a new website and even assist with backend tasks such as security updates.This module will cover a WordPress website's core structure, manual and automated enumeration techniques to uncover misconfigurations and vulnerabilities, and walk through a few common attacks. You will be given the opportunity to perform your own enumeration and attacks against a WordPress instance while working through the material in each section.
What is a CMS?
A CMS is a powerful tool that helps build a website without the need to code everything from scratch (or even know how to write code at all). Most CMS' provide a rich What You See Is What You Get (WYSIWYG) editor where users can edit content as if they were working in a word processing tool such as Microsoft Word. Users can upload media directly from a media library interface instead of interacting with the webserver either from a management portal or via FTP or SFTP.
A CMS is made up of two key components:
- A Content Management Application (CMA) - the interface used to add and manage content.
- A Content Delivery Application (CDA) - the backend that takes the input entered into the CMA and assembles the code into a working, visually appealing website.
A good CMS will provide extensibility, allowing you to add functionality and design elements to the site without needing to work with the website code, rich user management to provide fine-grained control over access permissions and roles, media management to allow the user to easily upload and embed photos and videos, and proper version control. WordPress can be installed on a Windows, Linux, or Mac OSX host.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.
Default File Structure: /var/www/html
Key WordPress Files
The root directory of WordPress contains files that are needed to configure WordPress to function correctly.
index.php:
is the homepage of WordPress.
license.txt:
contains useful information such as the version WordPress installed.
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:
- Note: This file can also be renamed to make it more challenging to find the login page.
xmlrpc.php:
is a file representing a feature of WordPress that enables data to be transmitted with HTTP acting as the transport mechanism and XML as the encoding mechanism. This type of communication has been replaced by the WordPress REST API.
wp-content:
folder is the main directory where plugins and themes are stored. The subdirectoryuploads/
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 structure:
- /var/www/html/wp-content
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.- WP-Includes structure:
- var/www/html/wp-includes
wp-config.php:
file contains information required by WordPress to connect to the database, such as the database name, database host, username and password, authentication keys and salts, and the database table prefix. This configuration file can also be used to activate DEBUG mode, which can useful in troubleshooting.
wp-config.php file look likes:
WordPress User Roles:
- Administrator: this user has a Administrative power as a result this user can anything in the website something adding or something deleting.
- Editor: An editor can only publish and manage post , including the other users post
- Author: An author can only publish and manage their own post.
- contributor: A contributor can manage his won post but can't published.
- subscriber: Who can browse the post and edit their won profile.
2. Manually: inspect the site or see the page source code by typing ctrl+u and for search ctrl+f in search bar type wp-content/themes or wp-content/plugins. like this.
3. wpscanner: this is the default kali tools specially use for wordpress scan. here p means Plugins and t means themes.
sed
command, short for Stream Editor, is a powerful text-processing utility used in Unix-based systems like Linux. It can perform a variety of functions such as text substitution, deletion, and insertion in a stream of text. The s
command is a part of sed
(Stream Editor) and stands for "substitute." It's used to perform substitution operations on text.\n
represents a newline character. /g
This is a flag in sed
that stands for "global." When you add /g
at the end of a sed
substitution command, it tells sed
to replace all instances of the search pattern in each line, not just the first occurrence. cut -d"'" -f2
: This cut
command takes the filtered lines and splits each line using the single quote character '
as the delimiter (-d"'"
). It then extracts and prints the second field (-f2
) from each split line.https://example.com/?author=1
will display a page of all posts published by the user with ID 1, revealing the username. Now I hope that you can easily Identify the point . we can try to identify the user by increase the author number.
JSON
endpoint, which allows us to obtain a list of users. This was changed in WordPress core after version 4.7.1, and later versions only show whether a user is configured or not. Before this release, all users who had published a post were shown by default. here you can see that the json api file. you can use it in url but than you can't identify it easily .so use curl and jq for well format.xmlrpc.php
page. see the below. here our user name is correct but the password isn't correct so it gives us error 403 forbidden.
0 Comments
Thanks For your comment