当前位置:网站首页>【DC-2 Range Penetration】
【DC-2 Range Penetration】
2022-08-03 05:39:00 【A paper - deserted】
前言
将DC2The shooting range is built locally,How to get itflag并拿到root权限呢?
一、主机发现
To build locally, you need to scan the hosts in the local area network to discoverDC2的ip地址
命令可使用 nmap -sP x.x.x.x/24,ping包发现
Check out its open services and ports
开启了http和tcp,尝试访问

访问不到,根据上面的提示,Also saying can't redirect to it,Then you need to change the configuration file
windowsChanged on the hostC:\Windows\System32\drivers\etc\hosts文件
liunx更改/etc/hosts
增加 10.40.2.116 dc-2这样一条命令
再访问
就可以了
看看其他信息
我们看到CMS是wordpress,数据库是MYSQL,wordpress是一种使用PHP语言和MySQL数据库开发的博客平台
三大PHP CMS网站:Drupal、 Wordpress、Joomla
使用dirbScan to see if there are any hidden files
see such a file,尝试访问
是一个登录界面,But don't know the username and password,后面可能会用到
二、开始渗透
1.flag2

大致意思:Tell us it might be neededcewltools and switching users
使用cewl生成密码
使用wpscan扫出用户

三个用户admin,jerry,tom,写入到user.txt用于爆破
爆破结果
用户名:jerry 密码:adipiscing
用户名:tom 密码:parturient
So log in to the backend of the website
我们使用Jerry找到了flag2,但是tom用户登录不行

Tell us we can't use itworldpress,但是我们还有ssh
2.flag3
jerry不能登录,所以用tom
View the file foundflag3.txt,但是不能查看
我们发现使用cat命令的时候提示,tom用户使用的-rbash(权限限制的shell),因此需要换一个更大的权限.
Check out the commands that can be executedvi
vi查看flag3.txt
3.flag4
绕过rbash
我们获取到的shell为:Restricted shell(受限制的shell),可以添加环境变量来绕过
BASH_CMDS[a]=/bin/sh;a
$ export PATH=$PATH:/bin/
$ export PATH=$PATH:/usr/bin/

切换用户

4.flag5
提权,试试sudo提权
see you cangit提权
搜索git提权命令,https://gtfobins.github.io/#
Just give it a try
提权成功
看到最后的flag
总结
通过DCRange penetration familiarizes us with the penetration process
边栏推荐
猜你喜欢
随机推荐
【转】最小描述长度准则MDL(Minimun Description Length)
求因子数量
ss-5.consul服务端+生产者+消费者
用scikit-learn学习谱聚类
jsp通过form表单提交数据到servlet报404
-元素之和-
7.17(7)
OptionError: ‘Pattern matched multiple keys‘
【反弹shell与提权】
网络流媒体下载的 10 种方法(以下载 Echo 音乐为例)
ModelArts第二次培训
【Flask】Flask-SQLAlchemy的增删改查(CRUD)操作
ss-4.1-1个eurekaServer+1个providerPayment+1个consumerOrder
【数组排序】+日常
软件测试 -- 入门 1 软件测试是什么?
MySQL 优化建议详解
Apache2-XXE漏洞渗透
uni-app 滚动到顶部/指定位置
飞机大战完整版
pta a.1003 的收获







