An Inspiring Write up from Proving grounds
好的,我现在需要帮用户总结一篇文章的内容,控制在100字以内,并且不需要特定的开头。首先,我得仔细阅读用户提供的文章内容,理解其主要步骤和关键点。 文章讲的是渗透测试的过程,从信息收集开始,使用nmap扫描发现开放端口,特别是允许匿名登录的FTP。接着通过FTP找到了SSH的私钥,用这个私钥连接到目标系统。然后进行权限提升,使用linpeas工具寻找可能的提升点,最终通过CPUlimit工具获取了root权限。 接下来,我需要将这些步骤简洁地总结出来。确保涵盖信息收集、工具使用、发现漏洞、权限提升和最终目标达成这几个部分。同时要注意字数限制,所以每个步骤只能用一两句话描述。 可能会遇到的问题是如何在有限的字数内准确传达所有关键点。比如,如何简洁地表达使用nmap扫描发现匿名FTP登录,并通过FTP找到SSH私钥的过程。同时还要提到linpeas和CPUlimit的作用。 最后,整合这些信息,形成一个流畅且完整的总结。确保语言简洁明了,不遗漏重要步骤。 </think> 渗透测试从信息收集开始,利用nmap扫描发现开放端口及匿名FTP登录。通过FTP获取SSH私钥并成功连接目标系统。随后使用linpeas工具寻找权限提升机会,并通过CPUlimit工具实现提权,最终获得root权限。 2026-3-17 04:53:3 Author: infosecwriteups.com(查看原文) 阅读量:4 收藏

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

Information gathering output.

As shown in the output above, the scan finished and we got some interesting results!

by examining the open port we can see that anonymous login is allowed, which means we can authenticate using FTP with Anonymous credentials.

Lets go to the next step:

As shown above we can mess around with FTP, and there we go! found a private key for SSH!

I found a hidden directory called hannah, also in that directory there was a private SSH key!

Lets use that SSH private key to connect to the box using hannah as the username.

Press enter or click to view image in full size

Connecting to SSH using the found private key.

Press enter or click to view image in full size

Gained Access via SSH.

Afterwards, for privilege escalation we use a handy tool for hunting for privesc, the tool is called linpeas!

Press enter or click to view image in full size

As shown above, I’m transferred linpeas.sh to the tmp directory to work from there on automating linpeas scan!

Get Cyb0rgBytes’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

next we find these possible privesc vectors, lets check out CPUlimit to see if it goes as planned!

I got this results from using this command:

Press enter or click to view image in full size

find / -perm -u=s -type f 2>/dev/null

This binary needs its UID and GID bits set. We may accomplish this by using chmod +s.

To get root we enter the following commands :

cpulimit -l 100 -f chmod +s bash

/bin/bash -p

whoami

BINGO!

we got root!

Press enter or click to view image in full size

Got Root!

Thanks a lot for reading, if you love my content and want to see more clap and share my stories! you can also check the other stories which are definitely worth checking out, cheers!


文章来源: https://infosecwriteups.com/an-inspiring-write-up-from-proving-grounds-99342df28758?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh