Blog

tryhackme.com - Β© TryHackMe

Intro

Room Info

πŸ”— Name

🎯 Target IP

10.10.54.35

πŸ“ˆ Difficulty level

🟑Medium

πŸ’² Subscription type

Free

🐧 OS

Linux


Recon

Add blog.thm to the /etc/hosts file

Start Reconnaissance

Enumerate web server application

  • http://blog.thm/

  • http://blog.thm/robots.txt

    • Disallow: /wp-admin/

🚩 The web server uses the WordPress 5.0 CMS

  • http://blog.thm/wp-admin/

    • tried default admin:password - does not work

Perform some SMB enumeration

πŸ“Œ Found local user bjoel

Enumerate all the WordPress users using WpScan

πŸ“Œ Found 2 WordPress users: bjoel, kwheel

Check for WordPress 5.0 vulnerabilities

There is a vulnerability called WordPress Core 5.0.0 - Crop-image Shell Upload

This module exploits a path traversal and a local file inclusion vulnerability on WordPress versions 5.0.0 and <= 4.9.8. The crop-image function allows a user, with at least author privileges, to resize an image and perform a path traversal by changing the _wp_attached_file reference during the upload. The second part of the exploit will include this image in the current theme by changing the _wp_page_template attribute when creating a post.

Since Karen Wheeler has author access to the blog, brute force the user kwheel.

Navigate to http://blog.thm/wp-login.php and try a password with user kwheel. Copy the HTTP POST request in raw format, it is necessary for the Hydra command.

πŸ“Œ kwheeler:cutiepie1


Exploitation

Use Metasploit with module exploit/multi/http/wp_crop_rce

Download the .pdf file


Privilege Escalation

Try to run /usr/sbin/checker

If ltrace is present on the machine use it. If not, download the file with Meterpreter and check it in Kali with ltrace or Ghidra.

The binary requires the admin environment variable to be declared

root shell

Last updated

Was this helpful?