当前位置:网站首页>trollcave靶机渗透测试
trollcave靶机渗透测试
2022-04-22 01:10:00 【小王先森&】
环境
kali攻击机
IP:192.168.1.105
靶机
IP:192.168.1.103
工具
ssh
netdiscover
nmap
dirb
python
nc
searchsploit
流程
netdiscover对目标网段进行扫描主机发现

namp -sV 192.168.1.103
对端口进行扫描
发现开启了80端口和22端口
dirb对80端口进行目录爆破
扫出来的url都是跳转到一个登陆页面

回到主页发现有一篇关于密码重置的博客

在博客里给到了一个密码重置的目录password_resets

访问结果页面不存在,擦

继续进行信息收集

得到网站框架是ruby通过资料查询发现这框架的密码重置特点:在url最后是/new
加在刚刚得到的目录后面成功得到密码重置页面

让输入用户名就页面上有个xer就他了

给了个url访问后改密码
登陆上去发现有个文件上传,由于是ruby上传木马应该是行不通想着开的有22端口那就直接上传ssh公钥用ssh登录
在本地生产ssh公钥

然后把id_rsa.pub文件上传到/home/用户名/.ssh/authorized_keys目录下
发现不能上传
看到有个users目录看一下有很多用户
注意到King用户是Superadmin应该是管理员重置他的密码试试


失败
突然想起刚刚重置xer的时候给的连接最后有个name=xer可能存在越权漏洞可用把xer改为King

成功登录King账号

果然是高权限有个控制面板打开把允许上传打开上传

上传尝试再一次


md还是失败看来King下面没有.ssh目录继续信息收集找可以用的用户名
在King的博客里找到这样一篇文章
译文大致为
嘿,伙计,如果我要在网站上做更多的工作,我真的需要 sudo 访问权限。而且我不知道交互式使用 rails 用户,对我来说是不是个好主意,也许我们应该分开,我梦见了/etc/sudoers 中的 coderguy…。
…看来这个rails就是我们要找的用户名了
第三次尝试上传
额由于之前实验时上传过他表示名字重复不过不影响

成功上传后来到id_rsa的目录用ssh -i id_rsa [email protected]
成功登录
优化终端

查看内核uname -a

用searchsploit找到一个可利用脚本

把该脚本用http上传到靶机
注意下载到靶机的tmp目录下(tmp权限控制不严)

在靶机编译脚本时发现靶机没有gcc。。。。真晦气

算了本地编译了再传


给exp执行权限

执行exp提权成功

这次打靶学到很多东西,到处是细节
版权声明
本文为[小王先森&]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_49340699/article/details/118302040
边栏推荐
- Interview questions for system engineers, college students, ant gold clothes on three sides
- 使用多个可选过滤器过滤 Eloquent 模型
- No more simple intention lock
- R language MANOVA function robust one-way MANOVA, Wilks in rrcov package Test function robust one-way MANOVA, Adonis function of vegan package, nonparametric MANOVA equivalent
- Use of Prometheus
- Servlet
- 2022年Redis最新面试题第1篇 - Redis基础知识
- 捕获了一只发生概率小于万分之一的Bug
- EventBridge 集成云服务实践
- Boutique: thousand word long text hand-in-hand teaches you to use the byte beating volcanic engine veimagex
猜你喜欢

系统工程师面试问题,大专生三面蚂蚁金服

CLion中“This file does not belong to any project, code insight features might not work properly”的报错

Huawei cloud hosting experience: your software storage expert

贼厉害,最新Android面试合集

Set the countdown of 5 seconds in setTimeout

爬虫学习——获得数据后的数据存储(csv & Excel 的写入与读取)

High expansion and high availability engineering practice of recommended resource bits related to short video app

PR如何调整导出的数据速率和总比特率

It's enough to study butterfly theme beautification

3D 沙盒游戏之人物的点击行走移动
随机推荐
EventBridge 集成云服务实践
谈谈SWEN20003软件开发技巧
If the garment industry wants to survive the "epidemic disaster", why does winner fashion become a growth sample?
PraNet训练文件train.py详解——shaoshuai
The video course "vite Learning Guide - webify deployment project based on Tencent cloud" was launched "cloud + community"
On software development skills of swen2003
js查找数组下标
Prometheus 的使用
贼厉害,最新Android面试合集
2022年Redis最新面试题第1篇 - Redis基础知识
R language MANOVA function robust one-way MANOVA, Wilks in rrcov package Test function robust one-way MANOVA, Adonis function of vegan package, nonparametric MANOVA equivalent
作文以记之 ~ 二叉树的中序遍历
Use of Prometheus
系统工程师面试问题,大专生三面蚂蚁金服
PR carries out JPEG frame compression and exports it as AVI video
OTS parsing error: invalid version tag solution
Principle and application of closure
【Pranet】论文及代码解读——cfsong
2022年年金险有哪些好的产品呢?
学习 Butterfly主题美化 这一篇就够了