InfoSecPrep Box Proving grounds.
好,我现在要帮用户总结这篇文章的内容。首先,我需要仔细阅读文章,理解其主要步骤和结论。 文章讲的是渗透测试的过程,从信息收集开始。作者使用了nmap扫描,发现了两个开放端口:80和SSH。接着,他注意到80端口运行的是WordPress 5.4.2,可能存在漏洞。于是他使用wpscan工具进一步分析,找到了robots.txt文件,并在secrets目录下发现了一个Base64编码的文本。 解码后,他得到了一个OpenSSH私钥。通过设置权限并使用这个私钥,他成功以OSCP用户名SSH登录到目标机器。接下来,为了提升权限,他使用了Linpeas.sh工具,找到了bash和sudo作为提权的可能途径。最终,他成功获得了root权限,并提到了GTFOBins网站作为参考。 现在我需要将这些内容浓缩到100字以内。重点包括:nmap扫描、WordPress漏洞、wpscan工具、Base64解码、SSH登录、提权方法和成功结果。 最后,确保语言简洁明了,不使用任何开头的固定格式。 </think> 文章描述了一次渗透测试过程:通过nmap扫描发现目标机器的开放端口和运行服务(WordPress 5.4.2),利用wpscan工具发现robots.txt文件并获取Base64编码的私钥。解码后获得SSH私钥并成功登录系统。随后通过Linpeas.sh工具寻找提权方法,在bash或sudo配置错误的情况下成功获取root权限。 2026-2-26 13:39:7 Author: infosecwriteups.com(查看原文) 阅读量:7 收藏

Press enter or click to view image in full size

InfoSecprep Box Proving grounds.

Cyb0rgBytes

As we approach any penetration testing engagement we start with information gathering, information gathering in Cyber Security is a crucial step that should not be avoided, same goes for enumeration.

There are many tools that can be used for enumeration or information gathering.

Lets start with an nmap scan:

Press enter or click to view image in full size

Nmap Scan Initial Results.

from the nmap scan I can see that there is two open ports, port 80 & SSH!

I can see that the web server is running wordpress with version 5.4.2 on port 80 which hints to be vulnerable, the perfect next tool to check the wordpress web server is wpscan!

Lets use it in the next steps and see if we can get a foothold on the webserver.

from the wpscan shown below I can find that there is a file called robots.txt in the web directories:

Press enter or click to view image in full size

Finding the robots.txt.

Then next I go to the secrets directory :

Press enter or click to view image in full size

Found a Base64 encoded text!

From there I found a base64 encoded text, I use this command to decode it :

echo “base64 encoded text” | base64 — decode

From the decoded text, I found a Private OpenSSH Key:

Press enter or click to view image in full size

Found an OpenSSH Private Key Text.

lets give its permission and try to connect:

Get Cyb0rgBytes’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

first of all lets add this SSH Private key to a file and change the required permissions:

chmod 600 id_rsa

next :

Press enter or click to view image in full size

Gaining Initial Access to the box through SSH.

for this machine the username is known as OSCP since it’s a infosec prep machine, which makes our job much easier with dealing with it!

after gaining foothold using the ssh private key, our time has come to elevate our privilege, we can start searching for PE vectors using our handy tool Linpeas.sh.

from this screenshot I’ve found that bash and sudo are possible Privilege escalation vectors

Press enter or click to view image in full size

Gaining root successfully.
PWN TO OWN!

I got the information on the priv escalation method from this website:

Press enter or click to view image in full size

gtfobins website.

GTFOBins is a curated list of Unix binaries that can be used to bypass local security restrictions in misconfigured systems.

Thanks for reading my write-up and stay tuned for the next info sec write-ups!

Cheers!

Cyb0rgBytes Out!


文章来源: https://infosecwriteups.com/offensive-securitys-proving-grounds-infosecprep-lab-walkthrough-23150fb516bb?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh