HackTheBox-Linux-Curling

admin 2021年11月18日05:22:40评论92 views字数 1645阅读5分29秒阅读模式

一个每日分享渗透小技巧的公众号HackTheBox-Linux-Curling



大家好,这里是 大余安全 的第 140 篇文章,本公众号会每日分享攻防渗透技术给大家。


HackTheBox-Linux-Curling

靶机地址: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.


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

HackTheBox-Linux-Curling



一、信息收集

HackTheBox-Linux-Curling


HackTheBox-Linux-Curling

可以看到靶机的IP是10.10.10.150..

HackTheBox-Linux-Curling

nmap仅发现ssh和apache服务开放...

HackTheBox-Linux-Curling

访问80端口,遇到了一个Joomla网站...

HackTheBox-Linux-Curling

这里主要获得了Floris用户名信息...

HackTheBox-Linux-Curling

在前段源码对于上面的用户名话语,查找到了secret文本信息存在...

HackTheBox-Linux-Curling

这是base64值,解析获得了密码...

HackTheBox-Linux-Curling

爆破目录获得了administrator页面...这是登录页面

思路都是先信息收集获得用户名密码,然后找登录页面即可...

HackTheBox-Linux-Curling

成功登录管理面板...文件上传或者编写shell...开始

HackTheBox-Linux-Curling

HackTheBox-Linux-Curling

HackTheBox-Linux-Curling

HackTheBox-Linux-Curling

很简单,找到路径,编写php,把shell写进去,生成shell.php即可...

这里文件路径上面有提示...访问执行即可



二、提权

HackTheBox-Linux-Curling


HackTheBox-Linux-Curling

执行后,获得了反向外壳...无法查看flag信息

枚举用户目录下,发现这是hex dump文件,复制到本地...

通过xxd转储后,这是一系列的转换包的过程....

通过最后file的提示,获得了password信息...

HackTheBox-Linux-Curling

密码直接SSH登录,获得了user_flag信息...

HackTheBox-Linux-Curling

pyps观察进程发现了该目录下存在执行的文件...

一直以root权限循环执行者访问...

通过curl,输出到report中,这里可以使用file读取到root信息...

HackTheBox-Linux-Curling

简单修改,获得了root_flag信息...

对于靶机,获得flag已经获胜,这里有N种方法可以获得root信息...我就列举了三种典型的...开始吧



方法1:

HackTheBox-Linux-Curling
HackTheBox-Linux-Curling


获取SSH密匙...

HackTheBox-Linux-Curling

file:///etc/ssh/ssh_host_rsa_key

成功获得了root_ssh_key密匙...

直接通过ssh登陆即可....



方法2:

HackTheBox-Linux-Curling
HackTheBox-Linux-Curling


利用本地文件写入shell提权

HackTheBox-Linux-Curling

获得root权限



方法3:

HackTheBox-Linux-Curling
HackTheBox-Linux-Curling


利用dirty_sock提权...

HackTheBox-Linux-Curling

HackTheBox-Linux-Curling

获得了root权限...


还有很多方法,因为权限放开很大...感兴趣的可以慢慢玩...

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


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


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

HackTheBox-Linux-Curling


如果觉得这篇文章对你有帮助,可以转发到朋友圈,谢谢小伙伴~

HackTheBox-Linux-Curling
HackTheBox-Linux-Curling


HackTheBox-Linux-Curling


随缘收徒中~~随缘收徒中~~随缘收徒中~~


欢迎加入渗透学习交流群,想入群的小伙伴们加我微信,共同进步共同成长!

HackTheBox-Linux-Curling

大余安全

一个全栈渗透小技巧的公众号

HackTheBox-Linux-Curling

本文始发于微信公众号(大余安全):HackTheBox-Linux-Curling

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年11月18日05:22:40
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   HackTheBox-Linux-Curlinghttp://cn-sec.com/archives/477105.html

发表评论

匿名网友 填写信息