HackTheBox-Linux-Stratosphere

admin 2021年12月23日02:27:10评论72 views字数 1466阅读4分53秒阅读模式

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



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


HackTheBox-Linux-Stratosphere

靶机地址:https://www.hackthebox.eu/home/machines/profile/129

靶机难度:中级(3.5/10)

靶机发布日期:2018年9月24日

靶机描述:

Stratosphere focuses on the use of an Apache Struts code execution vulnerability which was leveraged in a large-scale breach, resulting in the disclosure of millions of peoples’ credit information.


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




一、信息收集

HackTheBox-Linux-Stratosphere


HackTheBox-Linux-Stratosphere

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

HackTheBox-Linux-Stratosphere

HackTheBox-Linux-Stratosphere

Nmap发现运行着OpenSSH和Apache Tomcat...

HackTheBox-Linux-Stratosphere

主页面没啥信息...直接爆破...

HackTheBox-Linux-Stratosphere

发现了Monitoring目录...

HackTheBox-Linux-Stratosphere

访问后跳转到了example/Welcome.action下...

HackTheBox-Linux-Stratosphere

google搜索Welcome.action存在EXP漏洞可利用....

HackTheBox-Linux-Stratosphere

https://github.com/mazen160/struts-pwn

下载试试...不懂的看文章解释,最近快速过,就不解释了...cve-2017-5638

HackTheBox-Linux-Stratosphere

直接按照提示,利用后成功获得ID...

然后直接利用获得了mysql底层密码信息...

HackTheBox-Linux-Stratosphere

通过密码成功登录了richard用户...并获得了root_flag信息....

HackTheBox-Linux-Stratosphere

sudo-l发现了可直接提权的路径....

查看了test.py信息后,发现该脚本是通过python调用的,import hashlib提示了python库中存在hashlib??

还发现很多哈希值,破解后,尝试都没办法登录root....

HackTheBox-Linux-Stratosphere

检查发现存在python2和python3.5两个库....

尝试执行提权也失败....


方法1:

HackTheBox-Linux-Stratosphere
HackTheBox-Linux-Stratosphere


直接利用python2库执行代码提权

HackTheBox-Linux-Stratosphere

成功获得root_flag信息....



方法2:

HackTheBox-Linux-Stratosphere
HackTheBox-Linux-Stratosphere


利用python3库中hashlib提权...

HackTheBox-Linux-Stratosphere

查看到hashlib存在python3库中...python2没...

HackTheBox-Linux-Stratosphere

然后直接在用户目录下创建一个hashlib.py执行即可...


HackTheBox-Linux-Stratosphere
HackTheBox-Linux-Stratosphere

这里直接修改python3_hashlib.py的话,无法修改...可自行查看test.py...

直接sudo成功提权获得root_flag.....

主要方法简单,漏洞单一...拥有EXP...


说明漏洞的严重性在安全中很重要,有一个漏洞,就能搜到一个EXP...

加油

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


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


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

HackTheBox-Linux-Stratosphere
HackTheBox-Linux-Stratosphere


HackTheBox-Linux-Stratosphere


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


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

HackTheBox-Linux-Stratosphere

大余安全

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

HackTheBox-Linux-Stratosphere




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

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

发表评论

匿名网友 填写信息