[HTB]记一次通关hackthebox-Oopsie

admin 2024年8月2日00:11:08评论12 views字数 1027阅读3分25秒阅读模式

知识点

  • burp爬虫

  • cookie伪造

  • python3 pty.spawn交互式shell

  • 因suid引发的提权

START

端口扫描,发现开放了80和22

[HTB]记一次通关hackthebox-Oopsie

访问 http 服务,用 burp 爬取站点目录

[HTB]记一次通关hackthebox-Oopsie

访问 cdn-cgi/login

[HTB]记一次通关hackthebox-Oopsie

以guest 登录,修改get参数,找到admin的ID,修改 cookie 以 admin 账户登录

[HTB]记一次通关hackthebox-Oopsie

在上传页面中上传回连马,访问回连马页面,kali 中有自带的webshell

/usr/share/webshells,本地监听,getshell

[HTB]记一次通关hackthebox-Oopsie

启用交互式shell

python3 -c 'import pty;pty.spawn("/bin/bash")'

[HTB]记一次通关hackthebox-Oopsie

cat /etc/passwd 发现有其他用户

尝试在网站文件中找到密码信息

grep -r -i robert*

[HTB]记一次通关hackthebox-Oopsie

su robert 登录后查看所属组,发现有 bugtracker

[HTB]记一次通关hackthebox-Oopsie

查看bugtracker的文件类型

ls -la /usr/bin/bugtracker && file /usr/bin/bugtracker

[HTB]记一次通关hackthebox-Oopsie

因为有设置suid的影响,可以使用root权限执行bugtracker

Commonly noted as SUID (Set owner User ID), the special permission for the useraccesslevel has a single function: A file with SUID always executes as the user who owns thefile, regardless of the user passing the command. If the file owner doesn't haveexecute permissions, then use an uppercase S here.In our case, the binary 'bugtracker' is owned by root & we can execute it as root sinceit has SUID set.

但是在执行的时候,提示没有指定 cat的路径,这里可以手动指定

进入到 tmp 目录,创建一个 cat 文件,里面写上 /bin/sh,再赋予执行权限

[HTB]记一次通关hackthebox-Oopsie

添加加上环境变量

[HTB]记一次通关hackthebox-Oopsie

最后执行bugtracker

[HTB]记一次通关hackthebox-Oopsie

链接:

webshell:https://github.com/BlackArch/webshells

parrot os

https://www.parrotsec.org/download/

原文始发于微信公众号(CatalyzeSec):[HTB]记一次通关hackthebox-Oopsie

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年8月2日00:11:08
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   [HTB]记一次通关hackthebox-Oopsiehttps://cn-sec.com/archives/3024205.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息