Blog TryHackMe Box Writeup
嗯,用户让我总结这篇文章的内容,控制在100字以内,而且不需要特定的开头。首先,我需要通读文章,理解主要步骤和工具。 文章讲的是渗透测试的过程,从信息收集开始。使用nmap扫描端口,发现开放的服务。然后用gobuster枚举目标,找到用户名bjoel和khweel。接着用WpScan结合RockYou字典爆破密码,成功获取khweel的密码。 之后利用WordPress漏洞获取初始shell,并找到数据库凭证。通过检查SUID文件找到提升权限的方法,最终获得root权限。 现在要将这些步骤浓缩到100字以内。需要包括主要工具:nmap、gobuster、WpScan、Metasploit;关键点:发现用户、爆破密码、利用漏洞、获取shell、提升权限到root。 确保语言简洁明了,直接描述过程。 </think> 文章描述了一次渗透测试过程,使用nmap扫描目标并发现开放端口及服务,通过gobuster枚举目标并找到用户名bjoel和khweel。利用WpScan结合RockYou字典爆破WordPress登录页面密码,成功获取khweel密码后利用WordPress漏洞获取初始shell,并通过检查SUID文件最终获得root权限。 2026-3-19 04:55:31 Author: infosecwriteups.com(查看原文) 阅读量:4 收藏

Cyb0rgBytes

In every penetration testing practice we start by examining the target, starting with information gathering :

Lets start by using nmap as our information gathering tool of choice

Press enter or click to view image in full size

Scan Results with Nmap.

we found a couple of ports open with the shown services in the screenshot above ^

next lets start enumerating our target with our tool of choice “gobuster” >

Press enter or click to view image in full size

Enumeration Results with GoBuster.

Press enter or click to view image in full size

Found two Users using auxiliary tool in Metasploit.

as we can see in the results above we found two usernames : bjoel and khweel , maybe lets try to bruteforce the login page with those users in mind? with common passwords perhaps?

Moving along

Next we run the wpscan tool for conducting a vulnerability test on the wordpress webpage in this case we are looking for the password for the user khweel >>>

Press enter or click to view image in full size

Running WpScan Tool against the user file with the known wordlist “RockYou”

BINGO!

the password for khweel is found, which is “XXXXX”

after some digging I found out that Wordpress 5.0 is vulnerable to multiple vulnerabilities.

one of those vulnerabilities is : WordPress Crop-image Shell Upload

using this exploit which is also available in metasploit we can use it as follows :

Press enter or click to view image in full size

using the RCE To get a shell.

Press enter or click to view image in full size

Exploit Completed and Gained an initial Shell.

After laying foothold on the machine, and looking for a possible prevesc, I’ve found some creds ;

define(‘DB_USER’, ‘wordpressuser’);
define(‘DB_PASSWORD’, ‘LittleYellowLamp90!@’);

Get Cyb0rgBytes’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

lets keep these credentials for later we might need them and might not!

we run this command to check for SUID files and directories that www-data has acess to :

find / -perm -4000 2>/dev/null

one interesting directory is /usr/sbin/checker, lets check it out :

Checker Executable in sbin. (interesting PrevESC)
Reverse engineer it with ltrace..

And finally I managed to crack this open and get Root!

thanks for reading everyone and see you in the next one!

Gained Root on the box !

文章来源: https://infosecwriteups.com/blog-tryhackme-box-writeup-55b5abe7e28d?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh