No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习

**

HackTheBox-Linux-Curling-Walkthrough

**

靶机地址:https://www.hackthebox.eu/home/machines/profile/160
靶机难度:初级(4.7/10)
靶机发布日期:2019年5月8日
靶机描述:
Curling is an Easy difficulty Linux box which requires a fair amount of enumeration. The password is saved in a file on the web root. The username can be download through a post on the CMS which allows a login. Modifying the php template gives a shell. Finding a hex dump and reversing it gives a user shell. On enumerating running processes a cron is discovered which can be exploited for root.

作者:大余
时间:2020-06-22

请注意:对于所有这些计算机,我是通过平台授权允许情况进行渗透的。我将使用Kali Linux作为解决该HTB的攻击者机器。这里使用的技术仅用于学习教育目的,如果列出的技术用于其他任何目标,我概不负责。

一、信息收集

No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
可以看到靶机的IP是10.10.10.150…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
nmap仅发现ssh和apache服务开放…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
访问80端口,遇到了一个Joomla网站…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
这里主要获得了Floris用户名信息…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
在前段源码对于上面的用户名话语,查找到了secret文本信息存在…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
这是base64值,解析获得了密码…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
**目录获得了administrator页面…这是登录页面
思路都是先信息收集获得用户名密码,然后找登录页面即可…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
成功登录管理面板…文件上传或者编写shell…开始
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
很简单,找到路径,编写php,把shell写进去,生成shell.php即可…
这里文件路径上面有提示…访问执行即可

二、提权

No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
执行后,获得了反向外壳…无法查看flag信息
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
枚举用户目录下,发现这是hex dump文件,复制到本地…
通过xxd转储后,这是一系列的转换包的过程…
通过最后file的提示,获得了password信息…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
密码直接SSH登录,获得了user_flag信息…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
pyps观察进程发现了该目录下存在执行的文件…
一直以root权限循环执行者访问…
通过curl,输出到report中,这里可以使用file读取到root信息…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
简单修改,获得了root_flag信息…
对于靶机,获得flag已经获胜,这里有N种方法可以获得root信息…我就列举了三种典型的…开始吧

方法1:

获取SSH密匙…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
命令:file:///etc/ssh/ssh_host_rsa_key
成功获得了root_ssh_key密匙…
直接通过ssh登陆即可…

方法2:

利用本地文件写入shell提权
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
获得root权限

方法3:

利用dirty_sock提权…
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习
获得了root权限…
还有很多方法,因为权限放开很大…感兴趣的可以慢慢玩…

简单的靶机,提示也很明显…

由于我们已经成功得到root权限查看user和root.txt,因此完成这台初级的靶机,希望你们喜欢这台机器,请继续关注大余后期会有更多具有挑战性的机器,一起练习学习。

如果你有其他的方法,欢迎留言。要是有写错了的地方,请你一定要告诉我。要是你觉得这篇博客写的还不错,欢迎分享给身边的人。

No.142-HackTheBox-Linux-Curling-Walkthrough渗透学习