• Wordpress Core
  • Wordpress Plugins
  • Wordpress Themes

Skills Needed

  • Source Code Analysis
  • Web Development (Html+Javascript+PHP+SQL)
  • Knowledge of Web2 Vulnerabilities
  • Scripting Knowledge
  • Knowledge of Mass Automated Weaponization of Vulnerabilities
  • CVE Reversing

Source Code Analysis Types

  • Static Analysis
  • Dynamic Analysis

Additional Skills for Elite Threat Research

  • Honeypot deployment and monitoring real world attacker's vulnerability exploitation workflow

Install Docker 🐳

sudo apt update -y
None
sudo apt install -y docker.io
None
None
sudo apt install docker-compose -y
None
docker version
None
docker-compose version
None
groups
None
sudo docker ps
None
sudo docker run hello-world
None
echo $USER
None
sudo usermod -aG docker $USER
None

Reboot your machine to save the changes

  • Current user is now part of docker group
None
sudo cat /etc/group | grep -i docker
cat /etc/group | grep -i docker
None
docker ps -a
None

Wp-Xdebug-Docker

📥Installation Step-by-step commands (Linux)

git clone https://github.com/dhakalananda/wp-xdebug-docker
None
cd wp-xdebug-docker
None
docker version
None
docker-compose up -d
None
None
docker ps -a
None

Visit port 8000 on localhost http://localhost:8000/

None

Or Visit port 8000 on 127.0.0.1 http://127.0.0.1:8000/

None

http://localhost:8000/wp-admin/install.php?step=1

None
None
None

👨‍💻VS Code Extensions

1️⃣ Dev Containers

None

2️⃣ PHP Debug

Make sure it's from xdebug verified one.

None
None
None
None

Select /wp-xdebug-docker-wp-1

None
None
None

Go to the directory /var/www/html/ (within container , not locally)

None
None

Run & Debug ⚙️

None

Select debugger as "PHP"

None

Now we replace this file with

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9000
        }
        
    ]
}
None

Click on "Run and Debug"

None

Set a breakpoint in wp-login.php

None
None

If your breakpoint not getting hit, watch this

VSCODE: File > Preferences > Settings

None

🔌Download Wordpress Plugins

None

Click on any of the plugins listed and download it's source code.

None
wget {zip_file_link_from_download_button}
None
unzip {plugin-file-name.zip}
None

Open Visual Studio Code if already installed or open with any IDE you want

None
None

Start your analysis

None

🎨Download Wordpress Themes

None

Similarly download like Wordpress Plugins elaborated previously.

🔍 STATIC CODE ANALYSIS BASIC EXAMPLES

Below grep commands helps to narrow down to potential places to further test accordingly.

1️⃣ Broken Access Control

This can help to find potential endpoints to further analyse dynamically, however you need to figure it out, it's made of the feature or a vulnerability where anyone can trigger that endpoint.

grep  --color=always --include="*.php" -ir 'permission_callback' .  | grep -i "__return_true"

grep  --color=always --include="*.php" -ir 'permission_callback' .  | grep -i "__return_true" | sort -u 
None

2️⃣ XSS

GET Request Param

grep  --color=always --include="*.php" -ir 'echo' .  | grep -i "\$_GET"
None

POST Request Param

grep  --color=always --include="*.php" -ir 'echo' .  | grep -i "\$_POST"
None

Remove esc_

grep  --color=always --include="*.php" -ir 'echo' .  | grep -i "\$_GET" | grep -iv "esc_"
grep  --color=always --include="*.php" -ir 'echo' .  | grep -i "\$_POST" | grep -iv "esc_"

Remove sanitize_

grep  --color=always --include="*.php" -ir 'echo' .  | grep -i "\$_GET" | grep -iv "sanitize_"
grep  --color=always --include="*.php" -ir 'echo' .  | grep -i "\$_POST" | grep -iv "sanitize_"

3️⃣ SQL Injection

grep  --color=always --include="*.php" -ir 'wpdb->' .  | grep -iv "prepare(" | grep -iv "sanitize_"
None

DELETE

grep  --color=always --include="*.php" -ir 'wpdb->' .  | grep -iv "prepare(" | grep -iv "sanitize_" | grep "DELETE"
None

FROM

grep  --color=always --include="*.php" -ir 'wpdb->' .  | grep -iv "prepare(" | grep -iv "sanitize_" | grep "FROM"

ORDER BY

grep  --color=always --include="*.php" -ir 'wpdb->' .  | grep -iv "prepare(" | grep -iv "sanitize_" | grep "ORDER BY"
None

4️⃣ Open Redirect

grep --color=always --include="*.php" -ir "wp_redirect" .
grep --color=always --include="*.php" -ir "wp_redirect" . | grep "$"
None

Where to Submit Confirmed Vulnerabilities🔖

Before submitting, read all important guidelines & rules properly.

1️⃣ PatchStack

https://patchstack[.]com/database/report
None

2️⃣ WordFence

https://www[.]wordfence[.]com/threat-intel/vulnerabilities/submit/
None

There might be more places to report however I am not aware of it.