# Uploading and Executing a Malicious Plugin for Reverse Shell on WordPress # **Disclaimer**: This information is provided purely for educational purposes and to help security professionals and ethical hackers understand potential vulnerabilities in WordPress plugins. It should not be used for any malicious activity or unauthorized access to systems. Performing such actions without proper authorization violates laws and can lead to severe penalties, including criminal charges. Always ensure that you have explicit permission before conducting any penetration testing or uploading potentially harmful code to any system. # How to do it? To achieve our goal, we will first create a directory where we can place our malicious PHP file. This file will contain the necessary code to establish a reverse shell, allowing us to gain unauthorized access to the target system. By organizing our files systematically, we ensure that the upload process to the WordPress environment is straightforward and effective. Once the malicious PHP file is activated through the WordPress admin panel, it will execute the reverse shell payload, enabling remote command execution on the server. # The Process To achieve remote code execution (RCE) through a WordPress plugin, follow these steps: Start by creating a dedicated directory on your local machine where you will store your malicious PHP file. This helps organize your files for upload. ![Screenshot from 2024-09-29 23-06-25](https://hackmd.io/_uploads/SJSmM9vAA.png) The content of our PHP file looks like this: ![Screenshot from 2024-09-29 23-03-32](https://hackmd.io/_uploads/BJ2_f5DAA.png) After zipping it as shown in the first image, we now need to log in to the admin panel and upload our malicious plugin. But before doing that, let's start listening on the port specified in our PHP file. ![image](https://hackmd.io/_uploads/BJzAmcD0R.png) Now, let’s upload it to WordPress. Log in to the WordPress admin panel, navigate to **Plugins** > **Add** **New**, and click on **Upload Plugin**. Select your ZIP file and install it. ![Screenshot from 2024-09-29 23-08-42](https://hackmd.io/_uploads/rytF4cDC0.png) After installing the plugin, we won't get a shell immediately because we need to activate it. Click on Activate Plugin, wait a few seconds, and then... **boom!** we got it. ![Screenshot from 2024-09-29 23-12-12](https://hackmd.io/_uploads/BkiCH5DAR.png) # Bye Bye ![bed](https://hackmd.io/_uploads/Sk168qvA0.gif)