知识点
-
burp爬虫
-
cookie伪造
-
python3 pty.spawn交互式shell
-
因suid引发的提权
START
端口扫描,发现开放了80和22
访问 http 服务,用 burp 爬取站点目录
访问 cdn-cgi/login
以guest 登录,修改get参数,找到admin的ID,修改 cookie 以 admin 账户登录
在上传页面中上传回连马,访问回连马页面,kali 中有自带的webshell
/usr/share/webshells,
本地监听,getshell
启用交互式shell
python3 -c 'import pty;pty.spawn("/bin/bash")'
cat /etc/passwd
发现有其他用户
尝试在网站文件中找到密码信息
grep -r -i robert*
su robert 登录后查看所属组,发现有 bugtracker
查看bugtracker的文件类型
ls -la /usr/bin/bugtracker && file /usr/bin/bugtracker
因为有设置suid的影响,可以使用root权限执行bugtracker
Commonly noted as SUID (Set owner User ID), the special permission for the useraccess
level has a single function: A file with SUID always executes as the user who owns the
file, regardless of the user passing the command. If the file owner doesn't have
execute permissions, then use an uppercase S here.
In our case, the binary 'bugtracker' is owned by root & we can execute it as root since
it has SUID set.
但是在执行的时候,提示没有指定 cat的路径,这里可以手动指定
进入到 tmp 目录,创建一个 cat 文件,里面写上 /bin/sh,再赋予执行权限
添加加上环境变量
最后执行bugtracker
链接:
webshell:https://github.com/BlackArch/webshells
parrot os
https://www.parrotsec.org/download/
原文始发于微信公众号(CatalyzeSec):[HTB]记一次通关hackthebox-Oopsie
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论